update-check
Advanced tools
+10
-11
@@ -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); |
+1
-1
| { | ||
| "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", |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
8932
-1.9%157
-0.63%