update-check
Advanced tools
Comparing version 1.2.0 to 1.3.0
21
index.js
@@ -113,9 +113,8 @@ // Native | ||
const regURL = registryUrl(scope); | ||
const url = new URL(full, regURL); | ||
// For scoped packages, getting a certain dist tag is not supported | ||
const url = new URL(scope ? full : `${full}/${encode(distTag)}`, regURL); | ||
let version = null; | ||
let spec = null; | ||
try { | ||
({version} = await loadPackage(url)); | ||
spec = await loadPackage(url); | ||
} catch (err) { | ||
@@ -131,4 +130,3 @@ // We need to cover: | ||
const spec = await loadPackage(url, authInfo); | ||
version = spec['dist-tags'].latest; | ||
spec = await loadPackage(url, authInfo); | ||
} else { | ||
@@ -139,2 +137,8 @@ throw err; | ||
const version = spec['dist-tags'][distTag]; | ||
if (!version) { | ||
throw new Error(`Distribution tag ${distTag} is not available`); | ||
} | ||
return version; | ||
@@ -172,7 +176,2 @@ }; | ||
const details = getDetails(pkg.name); | ||
if (details.scope && config.distTag) { | ||
throw new Error('For scoped packages, the npm registry does not support getting a certain tag'); | ||
} | ||
const time = Date.now(); | ||
@@ -179,0 +178,0 @@ const {distTag, interval} = Object.assign({}, defaultConfig, config); |
{ | ||
"name": "update-check", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "Minimalistic update notifications for command line interfaces", | ||
@@ -5,0 +5,0 @@ "main": "./index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8932
157