npm-package-arg
Advanced tools
Comparing version 6.0.0 to 6.1.0
20
npa.js
@@ -65,2 +65,4 @@ 'use strict' | ||
return fromFile(res, where) | ||
} else if (spec && /^npm:/i.test(spec)) { | ||
return fromAlias(res, where) | ||
} | ||
@@ -235,4 +237,4 @@ if (!HostedGit) HostedGit = require('hosted-git-info') | ||
if (match) { | ||
setGitCommittish(res, match.gitCommittish) | ||
res.fetchSpec = match.fetchSpec | ||
res.gitCommittish = match.gitCommittish | ||
} else { | ||
@@ -258,2 +260,18 @@ setGitCommittish(res, urlparse.hash != null ? urlparse.hash.slice(1) : '') | ||
function fromAlias (res, where) { | ||
const subSpec = npa(res.rawSpec.substr(4), where) | ||
if (subSpec.type === 'alias') { | ||
throw new Error('nested aliases not supported') | ||
} | ||
if (!subSpec.registry) { | ||
throw new Error('aliases only work for registry deps') | ||
} | ||
res.subSpec = subSpec | ||
res.registry = true | ||
res.type = 'alias' | ||
res.saveSpec = null | ||
res.fetchSpec = null | ||
return res | ||
} | ||
function fromRegistry (res) { | ||
@@ -260,0 +278,0 @@ res.registry = true |
{ | ||
"name": "npm-package-arg", | ||
"version": "6.0.0", | ||
"version": "6.1.0", | ||
"description": "Parse the things that can be arguments to `npm install`", | ||
@@ -13,13 +13,22 @@ "main": "npa.js", | ||
"dependencies": { | ||
"hosted-git-info": "^2.5.0", | ||
"osenv": "^0.1.4", | ||
"semver": "^5.4.1", | ||
"hosted-git-info": "^2.6.0", | ||
"osenv": "^0.1.5", | ||
"semver": "^5.5.0", | ||
"validate-npm-package-name": "^3.0.0" | ||
}, | ||
"devDependencies": { | ||
"standard": "9.0.2", | ||
"tap": "^10.3.0" | ||
"standard": "^11.0.1", | ||
"standard-version": "^4.3.0", | ||
"tap": "^11.1.3", | ||
"weallbehave": "^1.2.0", | ||
"weallcontribute": "^1.0.8" | ||
}, | ||
"scripts": { | ||
"test": "standard && tap -J --coverage test/*.js" | ||
"prerelease": "npm t", | ||
"postrelease": "npm publish && git push --follow-tags", | ||
"pretest": "standard", | ||
"release": "standard-version -s", | ||
"test": "tap -J --coverage test/*.js", | ||
"update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", | ||
"update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" | ||
}, | ||
@@ -26,0 +35,0 @@ "repository": { |
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
15298
5
269
5
Updatedhosted-git-info@^2.6.0
Updatedosenv@^0.1.5
Updatedsemver@^5.5.0