We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5bf6a1c commit a047a37Copy full SHA for a047a37
1 file changed
src/matchers/documents.ts
@@ -16,13 +16,14 @@ export async function isDocumentMatch(
16
const normalized = normalizeInstanceOrArray(config.documents);
17
const documents = await context.loadDocuments(normalized);
18
19
- if (!documents) return false;
+ if (!documents.length) return false;
20
21
- for (const document of documents) {
22
- if (!document.location) break;
23
- const relativeDocumentPath = matcher.getRelativePath(document.location);
24
- return matcher.match(relativeDocumentPath);
25
- }
+ const paths = documents
+ .map(({ location = '' }) => location)
+ .map(matcher.getRelativePath)
+ .filter(Boolean);
26
27
- return false;
+ if (!paths.length) return false;
+
28
+ return paths.some(matcher.match);
29
}
0 commit comments