Skip to content

Commit

Permalink
chore: reset cdnjs datasource exports and logs
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins committed Jun 19, 2020
1 parent cf06b69 commit 78a1443
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/datasource/cdnjs/index.ts
Expand Up @@ -7,13 +7,13 @@ export const id = 'cdnjs';

const http = new Http(id);

export interface CdnjsAsset {
interface CdnjsAsset {
version: string;
files: string[];
sri?: Record<string, string>;
}

export interface CdnjsResponse {
interface CdnjsResponse {
homepage?: string;
repository?: {
type: 'git' | unknown;
Expand All @@ -30,6 +30,7 @@ async function downloadLibrary(library: string): CachePromise<CdnjsResponse> {
export async function getReleases({
lookupName,
}: GetReleasesConfig): Promise<ReleaseResult | null> {
// Each library contains multiple assets, so we cache at the library level instead of per-asset
const library = lookupName.split('/')[0];
try {
const { assets, homepage, repository } = await cacheAble({
Expand All @@ -56,7 +57,7 @@ export async function getReleases({
return result;
} catch (err) {
if (err.statusCode === 404) {
logger.debug({ library, err }, 'Package lookup error');
logger.debug({ library }, 'cdnjs library not found');
return null;
}
// Throw a DatasourceError for all other types of errors
Expand Down

0 comments on commit 78a1443

Please sign in to comment.