mirror of
https://github.com/renovatebot/renovate.git
synced 2024-12-22 21:48:32 +00:00
12 lines
385 B
TypeScript
12 lines
385 B
TypeScript
import { logger } from '../../../../logger';
|
|
import { minimatch } from '../../../../util/minimatch';
|
|
|
|
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;
|
|
}
|