diff options
author | Kat Marchán <kzm@sykosomatic.org> | 2017-10-19 04:06:51 +0300 |
---|---|---|
committer | Kat Marchán <kzm@sykosomatic.org> | 2017-10-19 04:06:51 +0300 |
commit | eb19a9691cf76fbc9c5b66aa7aadb5d905af467a (patch) | |
tree | fdae4bcac280b89e767845231c98ae45caa1c985 /node_modules/npm-package-arg | |
parent | bf4241fb0f5c17a3491e4073821da639b96051a6 (diff) |
npm-package-arg@6.0.0
Diffstat (limited to 'node_modules/npm-package-arg')
-rw-r--r-- | node_modules/npm-package-arg/README.md | 2 | ||||
-rw-r--r-- | node_modules/npm-package-arg/npa.js | 15 | ||||
-rw-r--r-- | node_modules/npm-package-arg/package.json | 32 |
3 files changed, 27 insertions, 22 deletions
diff --git a/node_modules/npm-package-arg/README.md b/node_modules/npm-package-arg/README.md index d45032dc7..847341b21 100644 --- a/node_modules/npm-package-arg/README.md +++ b/node_modules/npm-package-arg/README.md @@ -1,5 +1,7 @@ # npm-package-arg +[![Build Status](https://travis-ci.org/npm/npm-package-arg.svg?branch=master)](https://travis-ci.org/npm/npm-package-arg) + Parses package name and specifier passed to commands like `npm install` or `npm cache add`, or as found in `package.json` dependency sections. diff --git a/node_modules/npm-package-arg/npa.js b/node_modules/npm-package-arg/npa.js index a61c05742..dc885b1ff 100644 --- a/node_modules/npm-package-arg/npa.js +++ b/node_modules/npm-package-arg/npa.js @@ -18,6 +18,15 @@ const isFilename = /[.](?:tgz|tar.gz|tar)$/i function npa (arg, where) { let name let spec + if (typeof arg === 'object') { + if (arg instanceof Result && (!where || where === arg.where)) { + return arg + } else if (arg.name && arg.rawSpec) { + return npa.resolve(arg.name, arg.rawSpec, where || arg.where) + } else { + return npa(arg.raw, where || arg.where) + } + } const nameEndsAt = arg[0] === '@' ? arg.slice(1).indexOf('@') + 1 : arg.indexOf('@') const namePart = nameEndsAt > 0 ? arg.slice(0, nameEndsAt) : arg if (isURL.test(arg)) { @@ -131,10 +140,8 @@ function setGitCommittish (res, committish) { if (committish != null && committish.length >= 7 && committish.slice(0, 7) === 'semver:') { res.gitRange = decodeURIComponent(committish.slice(7)) res.gitCommittish = null - } else if (committish == null || committish === '') { - res.gitCommittish = 'master' } else { - res.gitCommittish = committish + res.gitCommittish = committish === '' ? null : committish } return res } @@ -204,7 +211,7 @@ function matchGitScp (spec) { const matched = spec.match(/^git\+ssh:\/\/([^:#]+:[^#]+(?:\.git)?)(?:#(.*))?$/i) return matched && !matched[1].match(/:[0-9]+\/?.*$/i) && { fetchSpec: matched[1], - gitCommittish: matched[2] || 'master' + gitCommittish: matched[2] == null ? null : matched[2] } } diff --git a/node_modules/npm-package-arg/package.json b/node_modules/npm-package-arg/package.json index 7e83e1e68..383688514 100644 --- a/node_modules/npm-package-arg/package.json +++ b/node_modules/npm-package-arg/package.json @@ -1,31 +1,27 @@ { - "_from": "npm-package-arg@5.1.2", - "_id": "npm-package-arg@5.1.2", + "_from": "npm-package-arg@latest", + "_id": "npm-package-arg@6.0.0", "_inBundle": false, - "_integrity": "sha512-wJBsrf0qpypPT7A0LART18hCdyhpCMxeTtcb0X4IZO2jsP6Om7EHN1d9KSKiqD+KVH030RVNpWS9thk+pb7wzA==", + "_integrity": "sha512-hwC7g81KLgRmchv9ol6f3Fx4Yyc9ARX5X5niDHVILgpuvf08JRIgOZcEfpFXli3BgESoTrkauqorXm6UbvSgSg==", "_location": "/npm-package-arg", "_phantomChildren": {}, "_requested": { - "type": "version", + "type": "tag", "registry": true, - "raw": "npm-package-arg@5.1.2", + "raw": "npm-package-arg@latest", "name": "npm-package-arg", "escapedName": "npm-package-arg", - "rawSpec": "5.1.2", + "rawSpec": "latest", "saveSpec": null, - "fetchSpec": "5.1.2" + "fetchSpec": "latest" }, "_requiredBy": [ "#USER", - "/", - "/init-package-json", - "/npm-registry-client", - "/pacote", - "/pacote/npm-pick-manifest" + "/" ], - "_resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-5.1.2.tgz", - "_shasum": "fb18d17bb61e60900d6312619919bd753755ab37", - "_spec": "npm-package-arg@5.1.2", + "_resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.0.0.tgz", + "_shasum": "8cce04b49d3f9faec3f56b0fe5f4391aeb9d2fac", + "_spec": "npm-package-arg@latest", "_where": "/Users/zkat/Documents/code/npm", "author": { "name": "Isaac Z. Schlueter", @@ -37,9 +33,9 @@ }, "bundleDependencies": false, "dependencies": { - "hosted-git-info": "^2.4.2", + "hosted-git-info": "^2.5.0", "osenv": "^0.1.4", - "semver": "^5.1.0", + "semver": "^5.4.1", "validate-npm-package-name": "^3.0.0" }, "deprecated": false, @@ -65,5 +61,5 @@ "scripts": { "test": "standard && tap -J --coverage test/*.js" }, - "version": "5.1.2" + "version": "6.0.0" } |