diff --git a/node_modules/npm-package-arg/lib/npa.js b/node_modules/npm-package-arg/lib/npa.js index 8094b3e732cd9..e92605811ae3e 100644 --- a/node_modules/npm-package-arg/lib/npa.js +++ b/node_modules/npm-package-arg/lib/npa.js @@ -17,6 +17,7 @@ const hasSlashes = isWindows ? /\\|[/]/ : /[/]/ const isURL = /^(?:git[+])?[a-z]+:/i const isGit = /^[^@]+@[^:.]+\.[^:]+:.+$/i const isFilename = /[.](?:tgz|tar.gz|tar)$/i +const isPortNumber = /:[0-9]+(\/|$)/i function npa (arg, where) { let name @@ -324,7 +325,9 @@ function fromURL (res) { // git+ssh://git@my.custom.git.com:username/project.git#deadbeef // ...and various combinations. The username in the beginning is *required*. const matched = rawSpec.match(/^git\+ssh:\/\/([^:#]+:[^#]+(?:\.git)?)(?:#(.*))?$/i) - if (matched && !matched[1].match(/:[0-9]+\/?.*$/i)) { + // Filter out all-number "usernames" which are really port numbers + // They can either be :1234 :1234/ or :1234/path but not :12abc + if (matched && !matched[1].match(isPortNumber)) { res.type = 'git' setGitAttrs(res, matched[2]) res.fetchSpec = matched[1] diff --git a/node_modules/npm-package-arg/package.json b/node_modules/npm-package-arg/package.json index 80baa3d32a52f..ab285eb6c610c 100644 --- a/node_modules/npm-package-arg/package.json +++ b/node_modules/npm-package-arg/package.json @@ -1,6 +1,6 @@ { "name": "npm-package-arg", - "version": "12.0.0", + "version": "12.0.1", "description": "Parse the things that can be arguments to `npm install`", "main": "./lib/npa.js", "directories": { @@ -18,7 +18,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^5.0.0", - "@npmcli/template-oss": "4.23.3", + "@npmcli/template-oss": "4.23.4", "tap": "^16.0.1" }, "scripts": { @@ -55,7 +55,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.23.3", + "version": "4.23.4", "publish": true } } diff --git a/package-lock.json b/package-lock.json index cd4d309777cc4..c05f06661ca5a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -129,7 +129,7 @@ "normalize-package-data": "^7.0.0", "npm-audit-report": "^6.0.0", "npm-install-checks": "^7.1.1", - "npm-package-arg": "^12.0.0", + "npm-package-arg": "^12.0.1", "npm-pick-manifest": "^10.0.0", "npm-profile": "^11.0.1", "npm-registry-fetch": "^18.0.2", @@ -12166,9 +12166,9 @@ } }, "node_modules/npm-package-arg": { - "version": "12.0.0", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-12.0.0.tgz", - "integrity": "sha512-ZTE0hbwSdTNL+Stx2zxSqdu2KZfNDcrtrLdIk7XGnQFYBWYDho/ORvXtn5XEePcL3tFpGjHCV3X3xrtDh7eZ+A==", + "version": "12.0.1", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-12.0.1.tgz", + "integrity": "sha512-aDxjFfPV3Liw0WOBWlyZLMBqtbgbg03rmGvHDJa2Ttv7tIz+1oB5qWec4psCDFZcZi9b5XdGkPdQiJxOPzvQRQ==", "inBundle": true, "license": "ISC", "dependencies": { diff --git a/package.json b/package.json index e5faa5a57579b..7b8303c52ccde 100644 --- a/package.json +++ b/package.json @@ -96,7 +96,7 @@ "normalize-package-data": "^7.0.0", "npm-audit-report": "^6.0.0", "npm-install-checks": "^7.1.1", - "npm-package-arg": "^12.0.0", + "npm-package-arg": "^12.0.1", "npm-pick-manifest": "^10.0.0", "npm-profile": "^11.0.1", "npm-registry-fetch": "^18.0.2",