0
0
Fork 0
mirror of https://github.com/renovatebot/renovate.git synced 2025-01-12 22:29:06 +00:00
renovatebot_renovate/lib/util/package-rules/repositories.ts
Rhys Arkins 879f7cc212 feat(packageRules): migrate matchers and excludes (#28602)
Co-authored-by: Sebastian Poxhofer <secustor@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2024-07-25 15:28:16 +02:00

21 lines
584 B
TypeScript

import is from '@sindresorhus/is';
import type { PackageRule, PackageRuleInputConfig } from '../../config/types';
import { matchRegexOrGlobList } from '../string-match';
import { Matcher } from './base';
export class RepositoriesMatcher extends Matcher {
override matches(
{ repository }: PackageRuleInputConfig,
{ matchRepositories }: PackageRule,
): boolean | null {
if (is.undefined(matchRepositories)) {
return null;
}
if (is.undefined(repository)) {
return false;
}
return matchRegexOrGlobList(repository, matchRepositories);
}
}