Files
renovate/lib/util/package-rules/registryurls.ts
Sebastian Poxhofer 7be38227f0 feat(package-rules): add matchRegistryUrls option (#41966)
* feat(package-rules): add matchRegistryUrls option

* chore: add patternMatch option

* Update docs/usage/configuration-options.md

Co-authored-by: RahulGautamSingh <rahultesnik@gmail.com>

---------

Co-authored-by: RahulGautamSingh <rahultesnik@gmail.com>
2026-03-19 11:42:27 +00:00

23 lines
637 B
TypeScript

import { isNullOrUndefined } from '@sindresorhus/is';
import type {
PackageRule,
PackageRuleInputConfig,
} from '../../config/types.ts';
import { anyMatchRegexOrGlobList } from '../string-match.ts';
import { Matcher } from './base.ts';
export class RegistryUrlsMatcher extends Matcher {
override matches(
{ registryUrls }: PackageRuleInputConfig,
{ matchRegistryUrls }: PackageRule,
): boolean | null {
if (isNullOrUndefined(matchRegistryUrls)) {
return null;
}
if (isNullOrUndefined(registryUrls)) {
return false;
}
return anyMatchRegexOrGlobList(registryUrls, matchRegistryUrls);
}
}