Files
renovate/lib/util/package-rules/datasources.ts
Sergei Zharinov 930cf6633c refactor: Rewrite imports with .ts extensions (#40700)
fix: Additional vi.mock path corrections and prettier formatting
2026-01-26 22:48:17 +00:00

23 lines
603 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 DatasourcesMatcher extends Matcher {
override matches(
{ datasource }: PackageRuleInputConfig,
{ matchDatasources }: PackageRule,
): boolean | null {
if (isUndefined(matchDatasources)) {
return null;
}
if (isUndefined(datasource)) {
return false;
}
return matchRegexOrGlobList(datasource, matchDatasources);
}
}