refactor: remove appendRegistryUrls

This commit is contained in:
Rhys Arkins 2021-01-21 10:04:22 +01:00
parent 6cf8735204
commit d0531f52fb
2 changed files with 3 additions and 4 deletions

View file

@ -75,7 +75,6 @@ export interface DatasourceApi {
getDigest?(config: DigestConfig, newValue?: string): Promise<string | null>;
getReleases(config: GetReleasesConfig): Promise<ReleaseResult | null>;
defaultRegistryUrls?: string[];
appendRegistryUrls?: string[];
defaultConfig?: Record<string, unknown>;
registryStrategy?: 'first' | 'hunt' | 'merge';
}

View file

@ -151,13 +151,13 @@ function resolveRegistryUrls(
datasource: Datasource,
extractedUrls: string[]
): string[] {
const { defaultRegistryUrls = [], appendRegistryUrls = [] } = datasource;
const { defaultRegistryUrls = [] } = datasource;
const customUrls = extractedUrls?.filter(Boolean);
let registryUrls: string[];
if (is.nonEmptyArray(customUrls)) {
registryUrls = [...extractedUrls, ...appendRegistryUrls];
registryUrls = [...customUrls];
} else {
registryUrls = [...defaultRegistryUrls, ...appendRegistryUrls];
registryUrls = [...defaultRegistryUrls];
}
return registryUrls.filter(Boolean);
}