Fix small bug
This commit is contained in:
@ -78,16 +78,16 @@ async function fetchPackageInfo(packageName) {
|
|||||||
async function fetchVersionsAndTags(packageName) {
|
async function fetchVersionsAndTags(packageName) {
|
||||||
const info = await fetchPackageInfo(packageName);
|
const info = await fetchPackageInfo(packageName);
|
||||||
|
|
||||||
if (!info) {
|
if (info && info.versions) {
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
versions: Object.keys(info.versions),
|
versions: Object.keys(info.versions),
|
||||||
tags: info['dist-tags']
|
tags: info['dist-tags']
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
async function getVersionsAndTags(packageName) {
|
async function getVersionsAndTags(packageName) {
|
||||||
const cacheKey = `versions-${packageName}`;
|
const cacheKey = `versions-${packageName}`;
|
||||||
const cacheValue = cache.get(cacheKey);
|
const cacheValue = cache.get(cacheKey);
|
||||||
|
|||||||
Reference in New Issue
Block a user