diff --git a/lib/modules/datasource/pod/index.ts b/lib/modules/datasource/pod/index.ts index 7fd676b237982d80cd340d1698478cce8b9648b9..946af80dd811af487149b4ead0729248700691a8 100644 --- a/lib/modules/datasource/pod/index.ts +++ b/lib/modules/datasource/pod/index.ts @@ -59,7 +59,7 @@ function releasesGithubUrl( function handleError(packageName: string, err: HttpError): void { const errorData = { packageName, err }; - const statusCode = err.response?.statusCode; + const statusCode = err.response?.statusCode ?? 0; if (statusCode === 429 || (statusCode >= 500 && statusCode < 600)) { logger.warn({ packageName, err }, `CocoaPods registry failure`); throw new ExternalHostError(err); @@ -80,7 +80,7 @@ function handleError(packageName: string, err: HttpError): void { function isDefaultRepo(url: string): boolean { const match = githubRegex.exec(url); if (match) { - const { account, repo } = match.groups || {}; + const { account, repo } = match.groups ?? {}; return ( account.toLowerCase() === 'cocoapods' && repo.toLowerCase() === 'specs' ); // https://github.com/CocoaPods/Specs.git @@ -215,6 +215,11 @@ export class PodDatasource extends Datasource { packageName, registryUrl, }: GetReleasesConfig): Promise<ReleaseResult | null> { + // istanbul ignore if + if (!registryUrl) { + return null; + } + const podName = packageName.replace(regEx(/\/.*$/), ''); let baseUrl = registryUrl.replace(regEx(/\/+$/), ''); baseUrl = massageGithubUrl(baseUrl); @@ -226,7 +231,7 @@ export class PodDatasource extends Datasource { let result: ReleaseResult | null = null; const match = githubRegex.exec(baseUrl); if (match) { - const { hostURL, account, repo } = match?.groups || {}; + const { hostURL, account, repo } = match?.groups ?? {}; const opts = { hostURL, account, repo }; result = await this.getReleasesFromGithub(podName, opts); } else { diff --git a/tsconfig.strict.json b/tsconfig.strict.json index 4325b2499022d3a3abdc5c71fa1dca5ac4143b00..ac14c1e98e538e0b4a59fdc3db9eb3006940804a 100644 --- a/tsconfig.strict.json +++ b/tsconfig.strict.json @@ -77,7 +77,6 @@ "lib/modules/datasource/nuget/v2.ts", "lib/modules/datasource/nuget/v3.ts", "lib/modules/datasource/packagist/index.ts", - "lib/modules/datasource/pod/index.ts", "lib/modules/datasource/pypi/index.ts", "lib/modules/datasource/repology/index.ts", "lib/modules/datasource/ruby-version/index.ts",