npm-package-arg
Advanced tools
Comparing version 10.1.0 to 11.0.0
@@ -260,36 +260,19 @@ 'use strict' | ||
// environment switch for testing | ||
if (process.env.NPM_PACKAGE_ARG_8909_STRICT !== '1') { | ||
// XXX backwards compatibility lack of compliance with 8909 | ||
// Remove when we want a breaking change to come into RFC compliance. | ||
if (resolvedUrl.host && resolvedUrl.host !== 'localhost') { | ||
const rawSpec = res.rawSpec.replace(/^file:\/\//, 'file:///') | ||
resolvedUrl = new url.URL(rawSpec, `file://${path.resolve(where)}/`) | ||
specUrl = new url.URL(rawSpec) | ||
rawNoPrefix = rawSpec.replace(/^file:/, '') | ||
} | ||
// turn file:/../foo into file:../foo | ||
// for 1, 2 or 3 leading slashes since we attempted | ||
// in the previous step to make it a file protocol url with a leading slash | ||
if (/^\/{1,3}\.\.?(\/|$)/.test(rawNoPrefix)) { | ||
const rawSpec = res.rawSpec.replace(/^file:\/{1,3}/, 'file:') | ||
resolvedUrl = new url.URL(rawSpec, `file://${path.resolve(where)}/`) | ||
specUrl = new url.URL(rawSpec) | ||
rawNoPrefix = rawSpec.replace(/^file:/, '') | ||
} | ||
// XXX end 8909 violation backwards compatibility section | ||
} | ||
// file:foo - relative url to ./foo | ||
// file:/foo - absolute path /foo | ||
// file:///foo - absolute path to /foo, no authority host | ||
// file://localhost/foo - absolute path to /foo, on localhost | ||
// file://foo - absolute path to / on foo host (error!) | ||
// XXX backwards compatibility lack of compliance with RFC 8909 | ||
if (resolvedUrl.host && resolvedUrl.host !== 'localhost') { | ||
const msg = `Invalid file: URL, must be absolute if // present` | ||
throw Object.assign(new Error(msg), { | ||
raw: res.rawSpec, | ||
parsed: resolvedUrl, | ||
}) | ||
const rawSpec = res.rawSpec.replace(/^file:\/\//, 'file:///') | ||
resolvedUrl = new url.URL(rawSpec, `file://${path.resolve(where)}/`) | ||
specUrl = new url.URL(rawSpec) | ||
rawNoPrefix = rawSpec.replace(/^file:/, '') | ||
} | ||
// turn file:/../foo into file:../foo | ||
// for 1, 2 or 3 leading slashes since we attempted | ||
// in the previous step to make it a file protocol url with a leading slash | ||
if (/^\/{1,3}\.\.?(\/|$)/.test(rawNoPrefix)) { | ||
const rawSpec = res.rawSpec.replace(/^file:\/{1,3}/, 'file:') | ||
resolvedUrl = new url.URL(rawSpec, `file://${path.resolve(where)}/`) | ||
specUrl = new url.URL(rawSpec) | ||
rawNoPrefix = rawSpec.replace(/^file:/, '') | ||
} | ||
// XXX end RFC 8909 violation backwards compatibility section | ||
@@ -296,0 +279,0 @@ // turn /C:/blah into just C:/blah on windows |
{ | ||
"name": "npm-package-arg", | ||
"version": "10.1.0", | ||
"version": "11.0.0", | ||
"description": "Parse the things that can be arguments to `npm install`", | ||
@@ -14,3 +14,3 @@ "main": "./lib/npa.js", | ||
"dependencies": { | ||
"hosted-git-info": "^6.0.0", | ||
"hosted-git-info": "^7.0.0", | ||
"proc-log": "^3.0.0", | ||
@@ -22,3 +22,3 @@ "semver": "^7.3.5", | ||
"@npmcli/eslint-config": "^4.0.0", | ||
"@npmcli/template-oss": "4.10.0", | ||
"@npmcli/template-oss": "4.18.0", | ||
"tap": "^16.0.1" | ||
@@ -48,3 +48,3 @@ }, | ||
"engines": { | ||
"node": "^14.17.0 || ^16.13.0 || >=18.0.0" | ||
"node": "^16.14.0 || >=18.0.0" | ||
}, | ||
@@ -60,4 +60,11 @@ "tap": { | ||
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", | ||
"version": "4.10.0" | ||
"version": "4.18.0", | ||
"publish": true, | ||
"ciVersions": [ | ||
"16.14.0", | ||
"16.x", | ||
"18.0.0", | ||
"18.x" | ||
] | ||
} | ||
} |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
0
19123
372
1
+ Addedhosted-git-info@7.0.2(transitive)
+ Addedlru-cache@10.4.3(transitive)
- Removedhosted-git-info@6.1.1(transitive)
- Removedlru-cache@7.18.3(transitive)
Updatedhosted-git-info@^7.0.0