npm-package-arg
Advanced tools
Comparing version 2.0.0 to 2.0.1
14
npa.js
@@ -9,2 +9,5 @@ var url = require("url") | ||
var isWindows = process.platform === "win32" || global.FAKE_WINDOWS | ||
var slashRe = isWindows ? /\\|\// : /\// | ||
var parseName = /^(?:@([^\/]+?)\/)?([^\/]+?)$/ | ||
@@ -62,2 +65,11 @@ var nameAt = /^(@([^\/]+?)\/)?([^\/]+?)@/ | ||
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 = {} | ||
} | ||
if (urlparse.protocol) { | ||
@@ -92,3 +104,3 @@ return parseUrl(res, arg, urlparse) | ||
res.type = "range" | ||
} else if (/\//.test(arg)) { | ||
} else if (slashRe.test(arg)) { | ||
parseLocal(res, arg) | ||
@@ -95,0 +107,0 @@ } else { |
{ | ||
"name": "npm-package-arg", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Parse the things that can be arguments to `npm install`", | ||
@@ -5,0 +5,0 @@ "main": "npa.js", |
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
10856
6
308