0
0
mirror of https://github.com/renovatebot/renovate.git synced 2024-12-22 21:48:32 +00:00
renovatebot_renovate/lib/modules/manager/npm/extract/utils.ts
2023-11-07 15:50:29 +00:00

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;
}