From 648551b19ae5225256390ee6144a6186ccc5f0d9 Mon Sep 17 00:00:00 2001 From: Cristian Dominguez Date: Mon, 4 Nov 2024 17:15:38 -0300 Subject: [PATCH] fix: check stric types for suffix --- src/resolve/metadataResolver.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/resolve/metadataResolver.ts b/src/resolve/metadataResolver.ts index 3d39cffa0..7c325a6c4 100644 --- a/src/resolve/metadataResolver.ts +++ b/src/resolve/metadataResolver.ts @@ -373,7 +373,16 @@ const parseAsContentMetadataXml = const suffixType = registry.getTypeBySuffix(extName(fsPath)); if (!suffixType) return false; - return fsPath.split(sep).includes(suffixType.directoryName); + const matchesSuffixType = fsPath.split(sep).includes(suffixType.directoryName); + if (matchesSuffixType) return matchesSuffixType; + + // it might be a type that requires strict parent folder name. + const strictFolderSuffixType = registry + .getStrictFolderTypes() + .find((l) => l.suffix === suffixType.suffix && l.directoryName && l.name !== suffixType.name); + if (!strictFolderSuffixType) return false; + + return fsPath.split(sep).includes(strictFolderSuffixType.directoryName); }; /**