Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRebecca Turner <me@re-becca.org>2016-06-17 00:28:09 +0300
committerRebecca Turner <me@re-becca.org>2016-06-17 00:58:01 +0300
commit257fe11052987e5cfec2abdf52392dd95a6c6ef3 (patch)
tree18cd43a9a7a584950dba4839ba0ca9ef6ff6b58d /node_modules/npm-package-arg
parent4a18922e56f9dc902fbb4daa8f5fafa4a1b89376 (diff)
npm-package-arg@4.2.0
Add `escapedName` to the result. It is suitable for passing through to a registry without further processing. Credit: @nexdrew
Diffstat (limited to 'node_modules/npm-package-arg')
-rw-r--r--node_modules/npm-package-arg/.npmignore1
-rw-r--r--node_modules/npm-package-arg/.travis.yml4
-rw-r--r--node_modules/npm-package-arg/README.md19
-rw-r--r--node_modules/npm-package-arg/npa.js155
-rw-r--r--node_modules/npm-package-arg/package.json77
-rw-r--r--node_modules/npm-package-arg/test/basic.js253
-rw-r--r--node_modules/npm-package-arg/test/bitbucket.js97
-rw-r--r--node_modules/npm-package-arg/test/github.js130
-rw-r--r--node_modules/npm-package-arg/test/gitlab.js95
-rw-r--r--node_modules/npm-package-arg/test/windows.js92
10 files changed, 483 insertions, 440 deletions
diff --git a/node_modules/npm-package-arg/.npmignore b/node_modules/npm-package-arg/.npmignore
new file mode 100644
index 000000000..c2658d7d1
--- /dev/null
+++ b/node_modules/npm-package-arg/.npmignore
@@ -0,0 +1 @@
+node_modules/
diff --git a/node_modules/npm-package-arg/.travis.yml b/node_modules/npm-package-arg/.travis.yml
index ab9182bf2..d8ce5e1a7 100644
--- a/node_modules/npm-package-arg/.travis.yml
+++ b/node_modules/npm-package-arg/.travis.yml
@@ -1,10 +1,10 @@
language: node_js
node_js:
+ - "6"
- "5"
- "4"
- - iojs
- "0.12"
- "0.10"
- - "0.8"
sudo: false
script: "npm test"
+
diff --git a/node_modules/npm-package-arg/README.md b/node_modules/npm-package-arg/README.md
index 82968a4be..9f4aee1c0 100644
--- a/node_modules/npm-package-arg/README.md
+++ b/node_modules/npm-package-arg/README.md
@@ -22,12 +22,13 @@ var parsed = npa("@bar/foo@1.2")
// Returns an object like:
{
- raw: '@bar/foo@1.2', // what was passed in
- name: "@bar/foo", // the name of the package
- scope: "@bar", // the private scope of the package, or null
- type: "range", // the type of specifier this is
- spec: ">=1.2.0 <1.3.0" // the expanded specifier
- rawSpec: "1.2" // the specifier as passed in
+ raw: '@bar/foo@1.2', // what was passed in
+ name: '@bar/foo', // the name of the package
+ escapedName: '@bar%2ffoo', // the escaped name, for making requests against a registry
+ scope: '@bar', // the scope of the package, or null
+ type: 'range', // the type of specifier this is
+ spec: '>=1.2.0 <1.3.0', // the expanded specifier
+ rawSpec: '1.2' // the specifier as passed in
}
// Parsing urls pointing at hosted git services produces a variation:
@@ -38,6 +39,7 @@ var parsed = npa("git+https://github.com/user/foo")
raw: 'git+https://github.com/user/foo',
scope: null,
name: null,
+ escapedName: null,
rawSpec: 'git+https://github.com/user/foo',
spec: 'user/foo',
type: 'hosted',
@@ -97,8 +99,11 @@ keys:
* `rawSpec` - The part after the `name@...`, as it was originally
provided.
* `scope` - If a name is something like `@org/module` then the `scope`
- field will be set to `org`. If it doesn't have a scoped name, then
+ field will be set to `@org`. If it doesn't have a scoped name, then
scope is `null`.
+* `escapedName` - A version of `name` escaped to match the npm scoped packages
+ specification. Mostly used when making requests against a registry. When
+ `name` is `null`, `escapedName` will also be `null`.
If you only include a name and no specifier part, eg, `foo` or `foo@` then
a default of `latest` will be used (as of 4.1.0). This is contrast with
diff --git a/node_modules/npm-package-arg/npa.js b/node_modules/npm-package-arg/npa.js
index 1e6deb1ec..07139696d 100644
--- a/node_modules/npm-package-arg/npa.js
+++ b/node_modules/npm-package-arg/npa.js
@@ -1,57 +1,61 @@
-var url = require("url")
-var assert = require("assert")
-var util = require("util")
-var semver = require("semver")
-var path = require("path")
-var HostedGit = require("hosted-git-info")
+var url = require('url')
+var assert = require('assert')
+var util = require('util')
+var semver = require('semver')
+var HostedGit = require('hosted-git-info')
module.exports = npa
-var isWindows = process.platform === "win32" || global.FAKE_WINDOWS
+var isWindows = process.platform === 'win32' || global.FAKE_WINDOWS
var slashRe = isWindows ? /\\|[/]/ : /[/]/
var parseName = /^(?:@([^/]+?)[/])?([^/]+?)$/
var nameAt = /^(@([^/]+?)[/])?([^/]+?)@/
-var debug = util.debuglog ? util.debuglog("npa")
- : /\bnpa\b/i.test(process.env.NODE_DEBUG || "")
- ? function () {
- console.error("NPA: " + util.format.apply(util, arguments).split("\n").join("\nNPA: "))
- } : function () {}
+var debug = util.debuglog
+ ? util.debuglog('npa')
+ : /\bnpa\b/i.test(process.env.NODE_DEBUG || '')
+ ? function () {
+ console.error('NPA: ' + util.format.apply(util, arguments).split('\n').join('\nNPA: '))
+ }
+ : function () {}
function validName (name) {
if (!name) {
- debug("not a name %j", name)
+ debug('not a name %j', name)
return false
}
var n = name.trim()
- if (!n || n.charAt(0) === "."
- || !n.match(/^[a-zA-Z0-9]/)
- || n.match(/[/()&?#|<>@:%\s\\*'"!~`]/)
- || n.toLowerCase() === "node_modules"
- || n !== encodeURIComponent(n)
- || n.toLowerCase() === "favicon.ico") {
- debug("not a valid name %j", name)
+ if (!n || n.charAt(0) === '.' ||
+ !n.match(/^[a-zA-Z0-9]/) ||
+ n.match(/[/()&?#|<>@:%\s\\*'"!~`]/) ||
+ n.toLowerCase() === 'node_modules' ||
+ n !== encodeURIComponent(n) ||
+ n.toLowerCase() === 'favicon.ico') {
+ debug('not a valid name %j', name)
return false
}
return n
}
function npa (arg) {
- assert.equal(typeof arg, "string")
+ assert.equal(typeof arg, 'string')
arg = arg.trim()
- var res = new Result
+ var res = new Result()
res.raw = arg
res.scope = null
+ res.escapedName = null
// See if it's something like foo@...
var nameparse = arg.match(nameAt)
- debug("nameparse", nameparse)
+ debug('nameparse', nameparse)
if (nameparse && validName(nameparse[3]) &&
- (!nameparse[2] || validName(nameparse[2]))) {
- res.name = (nameparse[1] || "") + nameparse[3]
- if (nameparse[2])
- res.scope = "@" + nameparse[2]
+ (!nameparse[2] || validName(nameparse[2]))) {
+ res.name = (nameparse[1] || '') + nameparse[3]
+ res.escapedName = escapeName(res.name)
+ if (nameparse[2]) {
+ res.scope = '@' + nameparse[2]
+ }
arg = arg.substr(nameparse[0].length)
} else {
res.name = null
@@ -61,13 +65,13 @@ function npa (arg) {
res.spec = arg
var urlparse = url.parse(arg)
- debug("urlparse", urlparse)
+ debug('urlparse', urlparse)
// windows paths look like urls
// don't be fooled!
if (isWindows && urlparse && urlparse.protocol &&
- urlparse.protocol.match(/^[a-zA-Z]:$/)) {
- debug("windows url-ish local path", urlparse)
+ urlparse.protocol.match(/^[a-zA-Z]:$/)) {
+ debug('windows url-ish local path', urlparse)
urlparse = {}
}
@@ -82,32 +86,34 @@ function npa (arg) {
// if it's got / chars in it, then assume that it's local.
if (res.name) {
- if (arg == '') arg = 'latest'
+ if (arg === '') arg = 'latest'
var version = semver.valid(arg, true)
var range = semver.validRange(arg, true)
// foo@...
if (version) {
res.spec = version
- res.type = "version"
+ res.type = 'version'
} else if (range) {
res.spec = range
- res.type = "range"
+ res.type = 'range'
} else if (slashRe.test(arg)) {
parseLocal(res, arg)
} else {
- res.type = "tag"
+ res.type = 'tag'
res.spec = arg
}
} else {
var p = arg.match(parseName)
if (p && validName(p[2]) &&
- (!p[1] || validName(p[1]))) {
- res.type = "tag"
- res.spec = "latest"
- res.rawSpec = ""
+ (!p[1] || validName(p[1]))) {
+ res.type = 'tag'
+ res.spec = 'latest'
+ res.rawSpec = ''
res.name = arg
- if (p[1])
- res.scope = "@" + p[1]
+ res.escapedName = escapeName(res.name)
+ if (p[1]) {
+ res.scope = '@' + p[1]
+ }
} else {
parseLocal(res, arg)
}
@@ -116,52 +122,57 @@ function npa (arg) {
return res
}
+function escapeName (name) {
+ // scoped packages in couch must have slash url-encoded, e.g. @foo%2Fbar
+ return name && name.replace('/', '%2f')
+}
+
function parseLocal (res, arg) {
// turns out nearly every character is allowed in fs paths
if (/\0/.test(arg)) {
- throw new Error("Invalid Path: " + JSON.stringify(arg))
+ throw new Error('Invalid Path: ' + JSON.stringify(arg))
}
- res.type = "local"
+ res.type = 'local'
res.spec = arg
}
function parseUrl (res, arg, urlparse) {
var gitHost = HostedGit.fromUrl(arg)
if (gitHost) {
- res.type = "hosted"
- res.spec = gitHost.toString(),
+ res.type = 'hosted'
+ res.spec = gitHost.toString()
res.hosted = {
- type: gitHost.type,
- ssh: gitHost.ssh(),
- sshUrl: gitHost.sshurl(),
- httpsUrl: gitHost.https(),
- gitUrl: gitHost.git(),
- shortcut: gitHost.shortcut(),
- directUrl: gitHost.file("package.json")
+ type: gitHost.type,
+ ssh: gitHost.ssh(),
+ sshUrl: gitHost.sshurl(),
+ httpsUrl: gitHost.https(),
+ gitUrl: gitHost.git(),
+ shortcut: gitHost.shortcut(),
+ directUrl: gitHost.file('package.json')
}
return res
}
// check the protocol, and then see if it's git or not
switch (urlparse.protocol) {
- case "git:":
- case "git+http:":
- case "git+https:":
- case "git+rsync:":
- case "git+ftp:":
- case "git+ssh:":
- case "git+file:":
- res.type = "git"
- res.spec = arg.replace(/^git[+]/, "")
+ case 'git:':
+ case 'git+http:':
+ case 'git+https:':
+ case 'git+rsync:':
+ case 'git+ftp:':
+ case 'git+ssh:':
+ case 'git+file:':
+ res.type = 'git'
+ res.spec = arg.replace(/^git[+]/, '')
break
- case "http:":
- case "https:":
- res.type = "remote"
+ case 'http:':
+ case 'https:':
+ res.type = 'remote'
res.spec = arg
break
- case "file:":
- res.type = "local"
+ case 'file:':
+ res.type = 'local'
if (isWindows && arg.match(/^file:\/\/\/?[a-z]:/i)) {
// Windows URIs usually parse all wrong, so we just take matters
// into our own hands, in this case.
@@ -172,19 +183,17 @@ function parseUrl (res, arg, urlparse) {
break
default:
- throw new Error("Unsupported URL Type: " + arg)
- break
+ throw new Error('Unsupported URL Type: ' + arg)
}
return res
}
-
function Result () {
- if (!(this instanceof Result)) return new Result
+ if (!(this instanceof Result)) return new Result()
}
-Result.prototype.name = null
-Result.prototype.type = null
-Result.prototype.spec = null
-Result.prototype.raw = null
+Result.prototype.name = null
+Result.prototype.type = null
+Result.prototype.spec = null
+Result.prototype.raw = null
Result.prototype.hosted = null
diff --git a/node_modules/npm-package-arg/package.json b/node_modules/npm-package-arg/package.json
index 1044852bc..b9f5b4d4a 100644
--- a/node_modules/npm-package-arg/package.json
+++ b/node_modules/npm-package-arg/package.json
@@ -1,88 +1,97 @@
{
"_args": [
[
- "npm-package-arg@4.1.1",
- "/Users/zkat/Documents/code/npm"
+ {
+ "raw": "npm-package-arg@4.2.0",
+ "scope": null,
+ "name": "npm-package-arg",
+ "rawSpec": "4.2.0",
+ "spec": "4.2.0",
+ "type": "version"
+ },
+ "/Users/rebecca/code/npm"
]
],
- "_from": "npm-package-arg@>=4.1.0 <4.2.0",
- "_id": "npm-package-arg@4.1.1",
+ "_from": "npm-package-arg@4.2.0",
+ "_id": "npm-package-arg@4.2.0",
"_inCache": true,
"_installable": true,
"_location": "/npm-package-arg",
- "_nodeVersion": "5.6.0",
+ "_nodeVersion": "6.2.1",
"_npmOperationalInternal": {
"host": "packages-16-east.internal.npmjs.com",
- "tmp": "tmp/npm-package-arg-4.1.1.tgz_1461107377267_0.3723941845819354"
+ "tmp": "tmp/npm-package-arg-4.2.0.tgz_1465952856229_0.8071578682865947"
},
"_npmUser": {
- "email": "kat@sykosomatic.org",
- "name": "zkat"
+ "name": "othiym23",
+ "email": "ogd@aoaioxxysz.net"
},
- "_npmVersion": "3.8.7",
+ "_npmVersion": "3.9.6",
"_phantomChildren": {},
"_requested": {
- "name": "npm-package-arg",
- "raw": "npm-package-arg@4.1.1",
- "rawSpec": "4.1.1",
+ "raw": "npm-package-arg@4.2.0",
"scope": null,
- "spec": "4.1.1",
+ "name": "npm-package-arg",
+ "rawSpec": "4.2.0",
+ "spec": "4.2.0",
"type": "version"
},
"_requiredBy": [
+ "#USER",
"/",
"/init-package-json",
"/npm-registry-client",
"/realize-package-specifier"
],
- "_resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-4.1.1.tgz",
- "_shasum": "86d9dca985b4c5e5d59772dfd5de6919998a495a",
+ "_resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-4.2.0.tgz",
+ "_shasum": "809bc61cabf54bd5ff94f6165c89ba8ee88c115c",
"_shrinkwrap": null,
- "_spec": "npm-package-arg@4.1.1",
- "_where": "/Users/zkat/Documents/code/npm",
+ "_spec": "npm-package-arg@4.2.0",
+ "_where": "/Users/rebecca/code/npm",
"author": {
- "email": "i@izs.me",
"name": "Isaac Z. Schlueter",
+ "email": "i@izs.me",
"url": "http://blog.izs.me/"
},
"bugs": {
"url": "https://github.com/npm/npm-package-arg/issues"
},
"dependencies": {
- "hosted-git-info": "^2.1.4",
- "semver": "4 || 5"
+ "hosted-git-info": "^2.1.5",
+ "semver": "^5.1.0"
},
"description": "Parse the things that can be arguments to `npm install`",
"devDependencies": {
- "tap": "^1.2.0"
+ "standard": "^7.1.2",
+ "tap": "^5.7.2"
},
"directories": {
"test": "test"
},
"dist": {
- "shasum": "86d9dca985b4c5e5d59772dfd5de6919998a495a",
- "tarball": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-4.1.1.tgz"
+ "shasum": "809bc61cabf54bd5ff94f6165c89ba8ee88c115c",
+ "tarball": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-4.2.0.tgz"
},
- "gitHead": "b39730cf0362576be0f3d3bfbc090af512a6afd2",
+ "gitHead": "b54a9286ef387dd1fd109c54a42e8de45d7b07e8",
"homepage": "https://github.com/npm/npm-package-arg",
"license": "ISC",
"main": "npa.js",
"maintainers": [
{
- "email": "me@re-becca.org",
- "name": "iarna"
+ "name": "iarna",
+ "email": "me@re-becca.org"
},
{
- "email": "i@izs.me",
- "name": "isaacs"
+ "name": "isaacs",
+ "email": "i@izs.me"
},
{
- "email": "ogd@aoaioxxysz.net",
- "name": "othiym23"
+ "name": "othiym23",
+ "email": "ogd@aoaioxxysz.net"
},
{
- "email": "kat@sykosomatic.org",
- "name": "zkat"
+ "name": "zkat",
+ "email": "kat@sykosomatic.org"
}
],
"name": "npm-package-arg",
@@ -93,7 +102,7 @@
"url": "git+https://github.com/npm/npm-package-arg.git"
},
"scripts": {
- "test": "tap test/*.js"
+ "test": "standard && tap --coverage test/*.js"
},
- "version": "4.1.1"
+ "version": "4.2.0"
}
diff --git a/node_modules/npm-package-arg/test/basic.js b/node_modules/npm-package-arg/test/basic.js
index 7e4112b46..95f260a3c 100644
--- a/node_modules/npm-package-arg/test/basic.js
+++ b/node_modules/npm-package-arg/test/basic.js
@@ -1,168 +1,187 @@
-var npa = require("../npa.js")
-var path = require("path")
+var npa = require('../npa.js')
+var path = require('path')
-require("tap").test("basic", function (t) {
+require('tap').test('basic', function (t) {
t.setMaxListeners(999)
var tests = {
- "foo@1.2": {
- name: "foo",
- type: "range",
- spec: ">=1.2.0 <1.3.0",
- raw: "foo@1.2",
- rawSpec: "1.2"
- },
-
- "@foo/bar": {
- raw: "@foo/bar",
- name: "@foo/bar",
- scope: "@foo",
- rawSpec: "",
- spec: "latest",
- type: "tag"
- },
-
- "@foo/bar@": {
- raw: "@foo/bar@",
- name: "@foo/bar",
- scope: "@foo",
- rawSpec: "",
- spec: "latest",
- type: "tag"
- },
-
- "@foo/bar@baz": {
- raw: "@foo/bar@baz",
- name: "@foo/bar",
- scope: "@foo",
- rawSpec: "baz",
- spec: "baz",
- type: "tag"
- },
-
- "@f fo o al/ a d s ;f ": {
- raw: "@f fo o al/ a d s ;f",
+ 'foo@1.2': {
+ name: 'foo',
+ escapedName: 'foo',
+ type: 'range',
+ spec: '>=1.2.0 <1.3.0',
+ raw: 'foo@1.2',
+ rawSpec: '1.2'
+ },
+
+ '@foo/bar': {
+ raw: '@foo/bar',
+ name: '@foo/bar',
+ escapedName: '@foo%2fbar',
+ scope: '@foo',
+ rawSpec: '',
+ spec: 'latest',
+ type: 'tag'
+ },
+
+ '@foo/bar@': {
+ raw: '@foo/bar@',
+ name: '@foo/bar',
+ escapedName: '@foo%2fbar',
+ scope: '@foo',
+ rawSpec: '',
+ spec: 'latest',
+ type: 'tag'
+ },
+
+ '@foo/bar@baz': {
+ raw: '@foo/bar@baz',
+ name: '@foo/bar',
+ escapedName: '@foo%2fbar',
+ scope: '@foo',
+ rawSpec: 'baz',
+ spec: 'baz',
+ type: 'tag'
+ },
+
+ '@f fo o al/ a d s ;f ': {
+ raw: '@f fo o al/ a d s ;f',
name: null,
- rawSpec: "@f fo o al/ a d s ;f",
- spec: "@f fo o al/ a d s ;f",
- type: "local"
+ escapedName: null,
+ rawSpec: '@f fo o al/ a d s ;f',
+ spec: '@f fo o al/ a d s ;f',
+ type: 'local'
},
- "foo@1.2.3": {
- name: "foo",
- type: "version",
- spec: "1.2.3",
- raw: "foo@1.2.3"
+ 'foo@1.2.3': {
+ name: 'foo',
+ escapedName: 'foo',
+ type: 'version',
+ spec: '1.2.3',
+ raw: 'foo@1.2.3'
},
- "foo@=v1.2.3": {
- name: "foo",
- type: "version",
- spec: "1.2.3",
- raw: "foo@=v1.2.3",
- rawSpec: "=v1.2.3"
+ 'foo@=v1.2.3': {
+ name: 'foo',
+ escapedName: 'foo',
+ type: 'version',
+ spec: '1.2.3',
+ raw: 'foo@=v1.2.3',
+ rawSpec: '=v1.2.3'
},
- "git+ssh://git@notgithub.com/user/foo#1.2.3": {
+ 'git+ssh://git@notgithub.com/user/foo#1.2.3': {
name: null,
- type: "git",
- spec: "ssh://git@notgithub.com/user/foo#1.2.3",
- raw: "git+ssh://git@notgithub.com/user/foo#1.2.3"
+ escapedName: null,
+ type: 'git',
+ spec: 'ssh://git@notgithub.com/user/foo#1.2.3',
+ raw: 'git+ssh://git@notgithub.com/user/foo#1.2.3'
},
- "git+file://path/to/repo#1.2.3": {
+ 'git+file://path/to/repo#1.2.3': {
name: null,
- type: "git",
- spec: "file://path/to/repo#1.2.3",
- raw: "git+file://path/to/repo#1.2.3"
+ escapedName: null,
+ type: 'git',
+ spec: 'file://path/to/repo#1.2.3',
+ raw: 'git+file://path/to/repo#1.2.3'
},
- "git://notgithub.com/user/foo": {
+ 'git://notgithub.com/user/foo': {
name: null,
- type: "git",
- spec: "git://notgithub.com/user/foo",
- raw: "git://notgithub.com/user/foo"
+ escapedName: null,
+ type: 'git',
+ spec: 'git://notgithub.com/user/foo',
+ raw: 'git://notgithub.com/user/foo'
},
- "@foo/bar@git+ssh://notgithub.com/user/foo": {
- name: "@foo/bar",
- scope: "@foo",
- spec: "ssh://notgithub.com/user/foo",
- rawSpec: "git+ssh://notgithub.com/user/foo",
- raw: "@foo/bar@git+ssh://notgithub.com/user/foo"
+ '@foo/bar@git+ssh://notgithub.com/user/foo': {
+ name: '@foo/bar',
+ escapedName: '@foo%2fbar',
+ scope: '@foo',
+ spec: 'ssh://notgithub.com/user/foo',
+ rawSpec: 'git+ssh://notgithub.com/user/foo',
+ raw: '@foo/bar@git+ssh://notgithub.com/user/foo'
},
- "/path/to/foo": {
+ '/path/to/foo': {
name: null,
- type: "local",
- spec: path.resolve(__dirname, "/path/to/foo"),
- raw: "/path/to/foo"
+ escapedName: null,
+ type: 'local',
+ spec: path.resolve(__dirname, '/path/to/foo'),
+ raw: '/path/to/foo'
},
- "file:path/to/foo": {
+ 'file:path/to/foo': {
name: null,
- type: "local",
- spec: "path/to/foo",
- raw: "file:path/to/foo"
+ escapedName: null,
+ type: 'local',
+ spec: 'path/to/foo',
+ raw: 'file:path/to/foo'
},
- "file:~/path/to/foo": {
+ 'file:~/path/to/foo': {
name: null,
- type: "local",
- spec: "~/path/to/foo",
- raw: "file:~/path/to/foo"
+ escapedName: null,
+ type: 'local',
+ spec: '~/path/to/foo',
+ raw: 'file:~/path/to/foo'
},
- "file:../path/to/foo": {
+ 'file:../path/to/foo': {
name: null,
- type: "local",
- spec: "../path/to/foo",
- raw: "file:../path/to/foo"
+ escapedName: null,
+ type: 'local',
+ spec: '../path/to/foo',
+ raw: 'file:../path/to/foo'
},
- "file:///path/to/foo": {
+ 'file:///path/to/foo': {
name: null,
- type: "local",
- spec: "/path/to/foo",
- raw: "file:///path/to/foo"
+ escapedName: null,
+ type: 'local',
+ spec: '/path/to/foo',
+ raw: 'file:///path/to/foo'
},
- "https://server.com/foo.tgz": {
+ 'https://server.com/foo.tgz': {
name: null,
- type: "remote",
- spec: "https://server.com/foo.tgz",
- raw: "https://server.com/foo.tgz"
- },
-
- "foo@latest": {
- name: "foo",
- type: "tag",
- spec: "latest",
- raw: "foo@latest"
- },
-
- "foo": {
- name: "foo",
- type: "tag",
- spec: "latest",
- raw: "foo"
+ escapedName: null,
+ type: 'remote',
+ spec: 'https://server.com/foo.tgz',
+ raw: 'https://server.com/foo.tgz'
+ },
+
+ 'foo@latest': {
+ name: 'foo',
+ escapedName: 'foo',
+ type: 'tag',
+ spec: 'latest',
+ raw: 'foo@latest'
+ },
+
+ 'foo': {
+ name: 'foo',
+ escapedName: 'foo',
+ type: 'tag',
+ spec: 'latest',
+ raw: 'foo'
}
}
Object.keys(tests).forEach(function (arg) {
var res = npa(arg)
- t.type(res, "Result", arg + " is result")
- t.has(res, tests[arg], arg + " matches expectations")
+ t.type(res, 'Result', arg + ' is result')
+ t.has(res, tests[arg], arg + ' matches expectations')
})
// Completely unreasonable invalid garbage throws an error
- t.throws(function() {
- npa("this is not a \0 valid package name or url")
+ t.throws(function () {
+ npa('this is not a \0 valid package name or url')
})
- t.throws(function() {
- npa("gopher://yea right")
- }, "Unsupported URL Type: gopher://yea right")
+ t.throws(function () {
+ npa('gopher://yea right')
+ }, 'Unsupported URL Type: gopher://yea right')
t.end()
})
diff --git a/node_modules/npm-package-arg/test/bitbucket.js b/node_modules/npm-package-arg/test/bitbucket.js
index 1dff34ffa..53efd8986 100644
--- a/node_modules/npm-package-arg/test/bitbucket.js
+++ b/node_modules/npm-package-arg/test/bitbucket.js
@@ -1,81 +1,80 @@
-var npa = require("../npa.js")
-var path = require("path")
+var npa = require('../npa.js')
-require("tap").test("basic", function (t) {
+require('tap').test('basic', function (t) {
t.setMaxListeners(999)
var tests = {
- "bitbucket:user/foo-js": {
+ 'bitbucket:user/foo-js': {
name: null,
- type: "hosted",
- hosted: { type: "bitbucket" },
- spec: "bitbucket:user/foo-js",
- raw: "bitbucket:user/foo-js"
+ type: 'hosted',
+ hosted: { type: 'bitbucket' },
+ spec: 'bitbucket:user/foo-js',
+ raw: 'bitbucket:user/foo-js'
},
- "bitbucket:user/foo-js#bar/baz": {
+ 'bitbucket:user/foo-js#bar/baz': {
name: null,
- type: "hosted",
- hosted: { type: "bitbucket" },
- spec: "bitbucket:user/foo-js#bar/baz",
- raw: "bitbucket:user/foo-js#bar/baz"
+ type: 'hosted',
+ hosted: { type: 'bitbucket' },
+ spec: 'bitbucket:user/foo-js#bar/baz',
+ raw: 'bitbucket:user/foo-js#bar/baz'
},
- "bitbucket:user..blerg--/..foo-js# . . . . . some . tags / / /": {
+ 'bitbucket:user..blerg--/..foo-js# . . . . . some . tags / / /': {
name: null,
- type: "hosted",
- hosted: { type: "bitbucket" },
- spec: "bitbucket:user..blerg--/..foo-js# . . . . . some . tags / / /",
- raw: "bitbucket:user..blerg--/..foo-js# . . . . . some . tags / / /"
+ type: 'hosted',
+ hosted: { type: 'bitbucket' },
+ spec: 'bitbucket:user..blerg--/..foo-js# . . . . . some . tags / / /',
+ raw: 'bitbucket:user..blerg--/..foo-js# . . . . . some . tags / / /'
},
- "bitbucket:user/foo-js#bar/baz/bin": {
+ 'bitbucket:user/foo-js#bar/baz/bin': {
name: null,
- type: "hosted",
- hosted: { type: "bitbucket" },
- spec: "bitbucket:user/foo-js#bar/baz/bin",
- raw: "bitbucket:user/foo-js#bar/baz/bin"
+ type: 'hosted',
+ hosted: { type: 'bitbucket' },
+ spec: 'bitbucket:user/foo-js#bar/baz/bin',
+ raw: 'bitbucket:user/foo-js#bar/baz/bin'
},
- "foo@bitbucket:user/foo-js": {
- name: "foo",
- type: "hosted",
- hosted: { type: "bitbucket" },
- spec: "bitbucket:user/foo-js",
- raw: "foo@bitbucket:user/foo-js"
+ 'foo@bitbucket:user/foo-js': {
+ name: 'foo',
+ type: 'hosted',
+ hosted: { type: 'bitbucket' },
+ spec: 'bitbucket:user/foo-js',
+ raw: 'foo@bitbucket:user/foo-js'
},
- "git+ssh://git@bitbucket.org/user/foo#1.2.3": {
+ 'git+ssh://git@bitbucket.org/user/foo#1.2.3': {
name: null,
- type: "hosted",
- hosted: { type: "bitbucket" },
- spec: "git+ssh://git@bitbucket.org/user/foo.git#1.2.3",
- raw: "git+ssh://git@bitbucket.org/user/foo#1.2.3"
+ type: 'hosted',
+ hosted: { type: 'bitbucket' },
+ spec: 'git+ssh://git@bitbucket.org/user/foo.git#1.2.3',
+ raw: 'git+ssh://git@bitbucket.org/user/foo#1.2.3'
},
- "https://bitbucket.org/user/foo.git": {
+ 'https://bitbucket.org/user/foo.git': {
name: null,
- type: "hosted",
- hosted: { type: "bitbucket" },
- spec: "git+https://bitbucket.org/user/foo.git",
- raw: "https://bitbucket.org/user/foo.git"
+ type: 'hosted',
+ hosted: { type: 'bitbucket' },
+ spec: 'git+https://bitbucket.org/user/foo.git',
+ raw: 'https://bitbucket.org/user/foo.git'
},
- "@foo/bar@git+ssh://bitbucket.org/user/foo": {
- name: "@foo/bar",
- scope: "@foo",
- type: "hosted",
- hosted: { type: "bitbucket" },
- spec: "git+ssh://git@bitbucket.org/user/foo.git",
- rawSpec: "git+ssh://bitbucket.org/user/foo",
- raw: "@foo/bar@git+ssh://bitbucket.org/user/foo"
+ '@foo/bar@git+ssh://bitbucket.org/user/foo': {
+ name: '@foo/bar',
+ scope: '@foo',
+ type: 'hosted',
+ hosted: { type: 'bitbucket' },
+ spec: 'git+ssh://git@bitbucket.org/user/foo.git',
+ rawSpec: 'git+ssh://bitbucket.org/user/foo',
+ raw: '@foo/bar@git+ssh://bitbucket.org/user/foo'
}
}
Object.keys(tests).forEach(function (arg) {
var res = npa(arg)
- t.type(res, "Result", arg + " is a result")
- t.has(res, tests[arg], arg + " matches expectations")
+ t.type(res, 'Result', arg + ' is a result')
+ t.has(res, tests[arg], arg + ' matches expectations')
})
t.end()
diff --git a/node_modules/npm-package-arg/test/github.js b/node_modules/npm-package-arg/test/github.js
index a2c146002..a7cc1f462 100644
--- a/node_modules/npm-package-arg/test/github.js
+++ b/node_modules/npm-package-arg/test/github.js
@@ -1,105 +1,103 @@
-var npa = require("../npa.js")
-var path = require("path")
+var npa = require('../npa.js')
-require("tap").test("basic", function (t) {
+require('tap').test('basic', function (t) {
t.setMaxListeners(999)
var tests = {
- "user/foo-js": {
+ 'user/foo-js': {
name: null,
- type: "hosted",
- hosted: { type: "github" },
- spec: "github:user/foo-js",
- raw: "user/foo-js"
+ type: 'hosted',
+ hosted: { type: 'github' },
+ spec: 'github:user/foo-js',
+ raw: 'user/foo-js'
},
- "user/foo-js#bar/baz": {
+ 'user/foo-js#bar/baz': {
name: null,
- type: "hosted",
- hosted: { type: "github" },
- spec: "github:user/foo-js#bar/baz",
- raw: "user/foo-js#bar/baz"
+ type: 'hosted',
+ hosted: { type: 'github' },
+ spec: 'github:user/foo-js#bar/baz',
+ raw: 'user/foo-js#bar/baz'
},
- "user..blerg--/..foo-js# . . . . . some . tags / / /": {
+ 'user..blerg--/..foo-js# . . . . . some . tags / / /': {
name: null,
- type: "hosted",
- hosted: { type: "github" },
- spec: "github:user..blerg--/..foo-js# . . . . . some . tags / / /",
- raw: "user..blerg--/..foo-js# . . . . . some . tags / / /"
+ type: 'hosted',
+ hosted: { type: 'github' },
+ spec: 'github:user..blerg--/..foo-js# . . . . . some . tags / / /',
+ raw: 'user..blerg--/..foo-js# . . . . . some . tags / / /'
},
- "user/foo-js#bar/baz/bin": {
+ 'user/foo-js#bar/baz/bin': {
name: null,
- type: "hosted",
- hosted: { type: "github" },
- raw: "github:user/foo-js#bar/baz/bin",
- raw: "user/foo-js#bar/baz/bin"
+ type: 'hosted',
+ hosted: { type: 'github' },
+ raw: 'user/foo-js#bar/baz/bin'
},
- "foo@user/foo-js": {
- name: "foo",
- type: "hosted",
- hosted: { type: "github" },
- spec: "github:user/foo-js",
- raw: "foo@user/foo-js"
+ 'foo@user/foo-js': {
+ name: 'foo',
+ type: 'hosted',
+ hosted: { type: 'github' },
+ spec: 'github:user/foo-js',
+ raw: 'foo@user/foo-js'
},
- "github:user/foo-js": {
+ 'github:user/foo-js': {
name: null,
- type: "hosted",
- hosted: { type: "github" },
- spec: "github:user/foo-js",
- raw: "github:user/foo-js"
+ type: 'hosted',
+ hosted: { type: 'github' },
+ spec: 'github:user/foo-js',
+ raw: 'github:user/foo-js'
},
- "git+ssh://git@github.com/user/foo#1.2.3": {
+ 'git+ssh://git@github.com/user/foo#1.2.3': {
name: null,
- type: "hosted",
- hosted: { type: "github" },
- spec: "git+ssh://git@github.com/user/foo.git#1.2.3",
- raw: "git+ssh://git@github.com/user/foo#1.2.3"
+ type: 'hosted',
+ hosted: { type: 'github' },
+ spec: 'git+ssh://git@github.com/user/foo.git#1.2.3',
+ raw: 'git+ssh://git@github.com/user/foo#1.2.3'
},
- "git://github.com/user/foo": {
+ 'git://github.com/user/foo': {
name: null,
- type: "hosted",
- hosted: { type: "github" },
- spec: "git://github.com/user/foo.git",
- raw: "git://github.com/user/foo"
+ type: 'hosted',
+ hosted: { type: 'github' },
+ spec: 'git://github.com/user/foo.git',
+ raw: 'git://github.com/user/foo'
},
- "https://github.com/user/foo.git": {
+ 'https://github.com/user/foo.git': {
name: null,
- type: "hosted",
- hosted: { type: "github" },
- spec: "git+https://github.com/user/foo.git",
- raw: "https://github.com/user/foo.git"
+ type: 'hosted',
+ hosted: { type: 'github' },
+ spec: 'git+https://github.com/user/foo.git',
+ raw: 'https://github.com/user/foo.git'
},
- "@foo/bar@git+ssh://github.com/user/foo": {
- name: "@foo/bar",
- scope: "@foo",
- type: "hosted",
- hosted: { type: "github" },
- spec: "git+ssh://git@github.com/user/foo.git",
- rawSpec: "git+ssh://github.com/user/foo",
- raw: "@foo/bar@git+ssh://github.com/user/foo"
+ '@foo/bar@git+ssh://github.com/user/foo': {
+ name: '@foo/bar',
+ scope: '@foo',
+ type: 'hosted',
+ hosted: { type: 'github' },
+ spec: 'git+ssh://git@github.com/user/foo.git',
+ rawSpec: 'git+ssh://github.com/user/foo',
+ raw: '@foo/bar@git+ssh://github.com/user/foo'
},
- "foo@bar/foo": {
- name: "foo",
- type: "hosted",
- hosted: { type: "github" },
- spec: "github:bar/foo",
- raw: "foo@bar/foo"
- }
+ 'foo@bar/foo': {
+ name: 'foo',
+ type: 'hosted',
+ hosted: { type: 'github' },
+ spec: 'github:bar/foo',
+ raw: 'foo@bar/foo'
+ }
}
Object.keys(tests).forEach(function (arg) {
var res = npa(arg)
- t.type(res, "Result", arg + " is a result")
- t.has(res, tests[arg], arg + " matches expectations")
+ t.type(res, 'Result', arg + ' is a result')
+ t.has(res, tests[arg], arg + ' matches expectations')
})
t.end()
diff --git a/node_modules/npm-package-arg/test/gitlab.js b/node_modules/npm-package-arg/test/gitlab.js
index c9a8ef9f2..b1bff98f9 100644
--- a/node_modules/npm-package-arg/test/gitlab.js
+++ b/node_modules/npm-package-arg/test/gitlab.js
@@ -1,81 +1,78 @@
-var npa = require("../npa.js")
-var path = require("path")
+var npa = require('../npa.js')
-require("tap").test("basic", function (t) {
+require('tap').test('basic', function (t) {
t.setMaxListeners(999)
var tests = {
- "gitlab:user/foo-js": {
+ 'gitlab:user/foo-js': {
name: null,
- type: "hosted",
- hosted: { type: "gitlab" },
- raw: "gitlab:user/foo-js",
- raw: "gitlab:user/foo-js"
+ type: 'hosted',
+ hosted: { type: 'gitlab' },
+ raw: 'gitlab:user/foo-js'
},
- "gitlab:user/foo-js#bar/baz": {
+ 'gitlab:user/foo-js#bar/baz': {
name: null,
- type: "hosted",
- hosted: { type: "gitlab" },
- raw: "gitlab:user/foo-js#bar/baz",
- raw: "gitlab:user/foo-js#bar/baz"
+ type: 'hosted',
+ hosted: { type: 'gitlab' },
+ raw: 'gitlab:user/foo-js#bar/baz'
},
- "gitlab:user..blerg--/..foo-js# . . . . . some . tags / / /": {
+ 'gitlab:user..blerg--/..foo-js# . . . . . some . tags / / /': {
name: null,
- type: "hosted",
- hosted: { type: "gitlab" },
- spec: "gitlab:user..blerg--/..foo-js# . . . . . some . tags / / /",
- raw: "gitlab:user..blerg--/..foo-js# . . . . . some . tags / / /"
+ type: 'hosted',
+ hosted: { type: 'gitlab' },
+ spec: 'gitlab:user..blerg--/..foo-js# . . . . . some . tags / / /',
+ raw: 'gitlab:user..blerg--/..foo-js# . . . . . some . tags / / /'
},
- "gitlab:user/foo-js#bar/baz/bin": {
+ 'gitlab:user/foo-js#bar/baz/bin': {
name: null,
- type: "hosted",
- hosted: { type: "gitlab" },
- spec: "gitlab:user/foo-js#bar/baz/bin",
- raw: "gitlab:user/foo-js#bar/baz/bin"
+ type: 'hosted',
+ hosted: { type: 'gitlab' },
+ spec: 'gitlab:user/foo-js#bar/baz/bin',
+ raw: 'gitlab:user/foo-js#bar/baz/bin'
},
- "foo@gitlab:user/foo-js": {
- name: "foo",
- type: "hosted",
- hosted: { type: "gitlab" },
- spec: "gitlab:user/foo-js",
- raw: "foo@gitlab:user/foo-js"
+ 'foo@gitlab:user/foo-js': {
+ name: 'foo',
+ type: 'hosted',
+ hosted: { type: 'gitlab' },
+ spec: 'gitlab:user/foo-js',
+ raw: 'foo@gitlab:user/foo-js'
},
- "git+ssh://git@gitlab.com/user/foo#1.2.3": {
+ 'git+ssh://git@gitlab.com/user/foo#1.2.3': {
name: null,
- type: "hosted",
- hosted: { type: "gitlab" },
- spec: "git+ssh://git@gitlab.com/user/foo.git#1.2.3",
- raw: "git+ssh://git@gitlab.com/user/foo#1.2.3"
+ type: 'hosted',
+ hosted: { type: 'gitlab' },
+ spec: 'git+ssh://git@gitlab.com/user/foo.git#1.2.3',
+ raw: 'git+ssh://git@gitlab.com/user/foo#1.2.3'
},
- "https://gitlab.com/user/foo.git": {
+ 'https://gitlab.com/user/foo.git': {
name: null,
- type: "hosted",
- hosted: { type: "gitlab" },
- spec: "git+https://gitlab.com/user/foo.git",
- raw: "https://gitlab.com/user/foo.git"
+ type: 'hosted',
+ hosted: { type: 'gitlab' },
+ spec: 'git+https://gitlab.com/user/foo.git',
+ raw: 'https://gitlab.com/user/foo.git'
},
- "@foo/bar@git+ssh://gitlab.com/user/foo": {
- name: "@foo/bar",
- scope: "@foo",
- type: "hosted",
- hosted: { type: "gitlab" },
- spec: "git+ssh://git@gitlab.com/user/foo.git",
- rawSpec: "git+ssh://gitlab.com/user/foo",
- raw: "@foo/bar@git+ssh://gitlab.com/user/foo"
+ '@foo/bar@git+ssh://gitlab.com/user/foo': {
+ name: '@foo/bar',
+ scope: '@foo',
+ type: 'hosted',
+ hosted: { type: 'gitlab' },
+ spec: 'git+ssh://git@gitlab.com/user/foo.git',
+ rawSpec: 'git+ssh://gitlab.com/user/foo',
+ raw: '@foo/bar@git+ssh://gitlab.com/user/foo'
}
}
Object.keys(tests).forEach(function (arg) {
var res = npa(arg)
- t.type(res, "Result", arg + " is a result")
- t.has(res, tests[arg], arg + " matches expectations")
+ t.type(res, 'Result', arg + ' is a result')
+ t.has(res, tests[arg], arg + ' matches expectations')
})
t.end()
diff --git a/node_modules/npm-package-arg/test/windows.js b/node_modules/npm-package-arg/test/windows.js
index b91416e2f..a10fa5b68 100644
--- a/node_modules/npm-package-arg/test/windows.js
+++ b/node_modules/npm-package-arg/test/windows.js
@@ -1,69 +1,75 @@
global.FAKE_WINDOWS = true
-var npa = require("../npa.js")
-var test = require("tap").test
-var path = require("path")
+var npa = require('../npa.js')
+var test = require('tap').test
var cases = {
- "C:\\x\\y\\z": {
- raw: "C:\\x\\y\\z",
+ 'C:\\x\\y\\z': {
+ raw: 'C:\\x\\y\\z',
scope: null,
name: null,
- rawSpec: "C:\\x\\y\\z",
- spec: "C:\\x\\y\\z",
- type: "local"
+ escapedName: null,
+ rawSpec: 'C:\\x\\y\\z',
+ spec: 'C:\\x\\y\\z',
+ type: 'local'
},
- "foo@C:\\x\\y\\z": {
- raw: "foo@C:\\x\\y\\z",
+ 'foo@C:\\x\\y\\z': {
+ raw: 'foo@C:\\x\\y\\z',
scope: null,
- name: "foo",
- rawSpec: "C:\\x\\y\\z",
- spec: "C:\\x\\y\\z",
- type: "local"
+ name: 'foo',
+ escapedName: 'foo',
+ rawSpec: 'C:\\x\\y\\z',
+ spec: 'C:\\x\\y\\z',
+ type: 'local'
},
- "foo@file:///C:\\x\\y\\z": {
- raw: "foo@file:///C:\\x\\y\\z",
+ 'foo@file:///C:\\x\\y\\z': {
+ raw: 'foo@file:///C:\\x\\y\\z',
scope: null,
- name: "foo",
- rawSpec: "file:///C:\\x\\y\\z",
- spec: "C:\\x\\y\\z",
- type: "local"
+ name: 'foo',
+ escapedName: 'foo',
+ rawSpec: 'file:///C:\\x\\y\\z',
+ spec: 'C:\\x\\y\\z',
+ type: 'local'
},
- "foo@file://C:\\x\\y\\z": {
- raw: "foo@file://C:\\x\\y\\z",
+ 'foo@file://C:\\x\\y\\z': {
+ raw: 'foo@file://C:\\x\\y\\z',
scope: null,
- name: "foo",
- rawSpec: "file://C:\\x\\y\\z",
- spec: "C:\\x\\y\\z",
- type: "local"
+ name: 'foo',
+ escapedName: 'foo',
+ rawSpec: 'file://C:\\x\\y\\z',
+ spec: 'C:\\x\\y\\z',
+ type: 'local'
},
- "file:///C:\\x\\y\\z": {
- raw: "file:///C:\\x\\y\\z",
+ 'file:///C:\\x\\y\\z': {
+ raw: 'file:///C:\\x\\y\\z',
scope: null,
name: null,
- rawSpec: "file:///C:\\x\\y\\z",
- spec: "C:\\x\\y\\z",
- type: "local"
+ escapedName: null,
+ rawSpec: 'file:///C:\\x\\y\\z',
+ spec: 'C:\\x\\y\\z',
+ type: 'local'
},
- "file://C:\\x\\y\\z": {
- raw: "file://C:\\x\\y\\z",
+ 'file://C:\\x\\y\\z': {
+ raw: 'file://C:\\x\\y\\z',
scope: null,
name: null,
- rawSpec: "file://C:\\x\\y\\z",
- spec: "C:\\x\\y\\z",
- type: "local"
+ escapedName: null,
+ rawSpec: 'file://C:\\x\\y\\z',
+ spec: 'C:\\x\\y\\z',
+ type: 'local'
},
- "foo@/foo/bar/baz": {
- raw: "foo@/foo/bar/baz",
+ 'foo@/foo/bar/baz': {
+ raw: 'foo@/foo/bar/baz',
scope: null,
- name: "foo",
- rawSpec: "/foo/bar/baz",
- spec: "/foo/bar/baz",
- type: "local"
+ name: 'foo',
+ escapedName: 'foo',
+ rawSpec: '/foo/bar/baz',
+ spec: '/foo/bar/baz',
+ type: 'local'
}
}
-test("parse a windows path", function (t) {
+test('parse a windows path', function (t) {
Object.keys(cases).forEach(function (c) {
var expect = cases[c]
var actual = npa(c)