diff --git a/lib/datasource/orb/index.ts b/lib/datasource/orb/index.ts index 59b9ff90b12d24125cd14de6b0cb0251790fb92a..0c903b6ac056a0a73c64f9b07e65f956ed73d627 100644 --- a/lib/datasource/orb/index.ts +++ b/lib/datasource/orb/index.ts @@ -36,6 +36,10 @@ export class OrbDatasource extends Datasource { lookupName, registryUrl, }: GetReleasesConfig): Promise<ReleaseResult | null> { + // istanbul ignore if + if (!registryUrl) { + return null; + } const url = `${registryUrl}graphql-unstable`; const body = { query, @@ -51,19 +55,15 @@ export class OrbDatasource extends Datasource { return null; } // Simplify response before caching and returning - const dep: ReleaseResult = { - releases: null, - }; - if (res.homeUrl?.length) { - dep.homepage = res.homeUrl; - } - dep.homepage = - dep.homepage || `https://circleci.com/developer/orbs/orb/${lookupName}`; - dep.releases = res.versions.map(({ version, createdAt }) => ({ + const homepage = res.homeUrl?.length + ? res.homeUrl + : `https://circleci.com/developer/orbs/orb/${lookupName}`; + const releases = res.versions.map(({ version, createdAt }) => ({ version, - releaseTimestamp: createdAt || null, + releaseTimestamp: createdAt ?? null, })); + const dep = { homepage, releases }; logger.trace({ dep }, 'dep'); return dep; } diff --git a/tsconfig.strict.json b/tsconfig.strict.json index b7bbf3976158ab2491ec67439741616c1125c826..fee429149b033bf34d9c6bc9c0408c1b5924f5a7 100644 --- a/tsconfig.strict.json +++ b/tsconfig.strict.json @@ -118,7 +118,6 @@ "lib/datasource/nuget/index.ts", "lib/datasource/nuget/v2.ts", "lib/datasource/nuget/v3.ts", - "lib/datasource/orb/index.ts", "lib/datasource/packagist/index.ts", "lib/datasource/pod/index.ts", "lib/datasource/pypi/index.ts",