Files
Sergei Zharinov 930cf6633c refactor: Rewrite imports with .ts extensions (#40700)
fix: Additional vi.mock path corrections and prettier formatting
2026-01-26 22:48:17 +00:00

12 lines
397 B
TypeScript

import { logger } from '../../../../logger/index.ts';
import { minimatch } from '../../../../util/minimatch.ts';
export function matchesAnyPattern(val: string, patterns: string[]): boolean {
const res = patterns.some(
(pattern) =>
pattern === `${val}/` || minimatch(pattern, { dot: true }).match(val),
);
logger.trace({ val, patterns, res }, `matchesAnyPattern`);
return res;
}