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>; 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';
} }

View file

@ -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);
} }