mirror of
https://github.com/renovatebot/renovate.git
synced 2026-11-02 10:33:39 +00:00
930cf6633c
fix: Additional vi.mock path corrections and prettier formatting
23 lines
581 B
TypeScript
23 lines
581 B
TypeScript
import { isUndefined } from '@sindresorhus/is';
|
|
import type {
|
|
PackageRule,
|
|
PackageRuleInputConfig,
|
|
} from '../../config/types.ts';
|
|
import { matchRegexOrGlobList } from '../string-match.ts';
|
|
import { Matcher } from './base.ts';
|
|
|
|
export class DepNameMatcher extends Matcher {
|
|
override matches(
|
|
{ depName }: PackageRuleInputConfig,
|
|
{ matchDepNames }: PackageRule,
|
|
): boolean | null {
|
|
if (isUndefined(matchDepNames)) {
|
|
return null;
|
|
}
|
|
if (isUndefined(depName)) {
|
|
return false;
|
|
}
|
|
return matchRegexOrGlobList(depName, matchDepNames);
|
|
}
|
|
}
|