mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-12 06:56:24 +00:00
refactor: remove appendRegistryUrls
This commit is contained in:
parent
6cf8735204
commit
d0531f52fb
2 changed files with 3 additions and 4 deletions
|
@ -75,7 +75,6 @@ export interface DatasourceApi {
|
||||||
getDigest?(config: DigestConfig, newValue?: string): Promise<string | null>;
|
getDigest?(config: DigestConfig, newValue?: string): Promise<string | null>;
|
||||||
getReleases(config: GetReleasesConfig): Promise<ReleaseResult | null>;
|
getReleases(config: GetReleasesConfig): Promise<ReleaseResult | null>;
|
||||||
defaultRegistryUrls?: string[];
|
defaultRegistryUrls?: string[];
|
||||||
appendRegistryUrls?: string[];
|
|
||||||
defaultConfig?: Record<string, unknown>;
|
defaultConfig?: Record<string, unknown>;
|
||||||
registryStrategy?: 'first' | 'hunt' | 'merge';
|
registryStrategy?: 'first' | 'hunt' | 'merge';
|
||||||
}
|
}
|
||||||
|
|
|
@ -151,13 +151,13 @@ function resolveRegistryUrls(
|
||||||
datasource: Datasource,
|
datasource: Datasource,
|
||||||
extractedUrls: string[]
|
extractedUrls: string[]
|
||||||
): string[] {
|
): string[] {
|
||||||
const { defaultRegistryUrls = [], appendRegistryUrls = [] } = datasource;
|
const { defaultRegistryUrls = [] } = datasource;
|
||||||
const customUrls = extractedUrls?.filter(Boolean);
|
const customUrls = extractedUrls?.filter(Boolean);
|
||||||
let registryUrls: string[];
|
let registryUrls: string[];
|
||||||
if (is.nonEmptyArray(customUrls)) {
|
if (is.nonEmptyArray(customUrls)) {
|
||||||
registryUrls = [...extractedUrls, ...appendRegistryUrls];
|
registryUrls = [...customUrls];
|
||||||
} else {
|
} else {
|
||||||
registryUrls = [...defaultRegistryUrls, ...appendRegistryUrls];
|
registryUrls = [...defaultRegistryUrls];
|
||||||
}
|
}
|
||||||
return registryUrls.filter(Boolean);
|
return registryUrls.filter(Boolean);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue