npm-package-arg
Advanced tools
Comparing version 2.0.2 to 2.0.3
10
npa.js
@@ -136,3 +136,11 @@ var url = require("url") | ||
function maybeGitHubShorthand (arg) { | ||
return /^[^@ \/%]+\/[^@ \/%]+$/.test(arg) | ||
// Note: This does not fully test the git ref format. | ||
// See https://www.kernel.org/pub/software/scm/git/docs/git-check-ref-format.html | ||
// | ||
// The only way to do this properly would be to shell out to | ||
// git-check-ref-format, and as this is a fast sync function, | ||
// we don't want to do that. Just let git fail if it turns | ||
// out that the commit-ish is invalid. | ||
// GH usernames cannot start with . or - | ||
return /^[^@%\/\s\.-][^@%\/\s]*\/[^@\s\/%]+(?:#.*)?$/.test(arg) | ||
} | ||
@@ -139,0 +147,0 @@ |
{ | ||
"name": "npm-package-arg", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "Parse the things that can be arguments to `npm install`", | ||
@@ -5,0 +5,0 @@ "main": "npa.js", |
@@ -102,2 +102,23 @@ var npa = require("../npa.js") | ||
"user/foo-js#bar/baz": { | ||
name: null, | ||
type: "github", | ||
spec: "user/foo-js#bar/baz", | ||
raw: "user/foo-js#bar/baz" | ||
}, | ||
"user..blerg--/..foo-js# . . . . . some . tags / / /": { | ||
name: null, | ||
type: "github", | ||
spec: "user..blerg--/..foo-js# . . . . . some . tags / / /", | ||
raw: "user..blerg--/..foo-js# . . . . . some . tags / / /" | ||
}, | ||
"user/foo-js#bar/baz/bin": { | ||
name: null, | ||
type: "github", | ||
spec: "user/foo-js#bar/baz/bin", | ||
raw: "user/foo-js#bar/baz/bin" | ||
}, | ||
"foo@user/foo-js": { | ||
@@ -104,0 +125,0 @@ name: "foo", |
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
11846
334