diff --git a/src/path-filter.ts b/src/path-filter.ts index 777fa5f4..24876d37 100644 --- a/src/path-filter.ts +++ b/src/path-filter.ts @@ -22,13 +22,22 @@ export function matchPathFilter( // multi path if (Array.isArray(pathFilter)) { - if (pathFilter.every(isStringPath)) { + const stringPaths = pathFilter.filter(isStringPath); + const globPaths = pathFilter.filter(isGlobPath); + + // Handle mixed arrays + if (stringPaths.length && globPaths.length) { + return ( + matchMultiPath(stringPaths, uri) || + matchMultiGlobPath(globPaths, uri) + ); + } + if (stringPaths.length) { return matchMultiPath(pathFilter, uri); } - if (pathFilter.every(isGlobPath)) { - return matchMultiGlobPath(pathFilter as string[], uri); + if (globPaths.length) { + return matchMultiGlobPath(pathFilter, uri); } - throw new Error(ERRORS.ERR_CONTEXT_MATCHER_INVALID_ARRAY); }