@pnpm/git-resolver
Advanced tools
Comparing version 8.0.7 to 8.0.8
@@ -30,2 +30,3 @@ "use strict"; | ||
exports.parsePref = void 0; | ||
// cspell:ignore sshurl | ||
const url_1 = __importStar(require("url")); | ||
@@ -56,8 +57,8 @@ const fetch_1 = require("@pnpm/fetch"); | ||
const correctPref = correctUrl(pref); | ||
const urlparse = new url_1.URL(correctPref); | ||
if (!urlparse?.protocol) | ||
const url = new url_1.URL(correctPref); | ||
if (!url?.protocol) | ||
return null; | ||
const committish = (urlparse.hash?.length > 1) ? decodeURIComponent(urlparse.hash.slice(1)) : null; | ||
const committish = (url.hash?.length > 1) ? decodeURIComponent(url.hash.slice(1)) : null; | ||
return { | ||
fetchSpec: urlToFetchSpec(urlparse), | ||
fetchSpec: urlToFetchSpec(url), | ||
normalizedPref: pref, | ||
@@ -70,5 +71,5 @@ ...setGitCommittish(committish), | ||
exports.parsePref = parsePref; | ||
function urlToFetchSpec(urlparse) { | ||
urlparse.hash = ''; | ||
const fetchSpec = url_1.default.format(urlparse); | ||
function urlToFetchSpec(url) { | ||
url.hash = ''; | ||
const fetchSpec = url_1.default.format(url); | ||
if (fetchSpec.startsWith('git+')) { | ||
@@ -111,3 +112,3 @@ return fetchSpec.slice(4); | ||
// use HTTP HEAD request to test whether this is a private repo, to avoid login prompt. | ||
// this is very similar to yarn's behaviour. | ||
// this is very similar to yarn's behavior. | ||
// npm instead tries git ls-remote directly which prompts user for login credentials. | ||
@@ -170,4 +171,4 @@ // HTTP HEAD on https://domain/user/repo, strip out ".git" | ||
// see https://github.com/yarnpkg/yarn/blob/5682d55/src/util/git.js#L103 | ||
function correctUrl(giturl) { | ||
const parsed = url_1.default.parse(giturl.replace(/^git\+/, '')); // eslint-disable-line n/no-deprecated-api | ||
function correctUrl(gitUrl) { | ||
const parsed = url_1.default.parse(gitUrl.replace(/^git\+/, '')); // eslint-disable-line n/no-deprecated-api | ||
if (parsed.protocol === 'ssh:' && | ||
@@ -181,4 +182,4 @@ parsed.hostname && | ||
} | ||
return giturl; | ||
return gitUrl; | ||
} | ||
//# sourceMappingURL=parsePref.js.map |
{ | ||
"name": "@pnpm/git-resolver", | ||
"version": "8.0.7", | ||
"version": "8.0.8", | ||
"description": "Resolver for git-hosted packages", | ||
@@ -30,4 +30,4 @@ "main": "lib/index.js", | ||
"semver": "^7.5.4", | ||
"@pnpm/resolver-base": "10.0.3", | ||
"@pnpm/fetch": "7.0.4" | ||
"@pnpm/fetch": "7.0.5", | ||
"@pnpm/resolver-base": "10.0.4" | ||
}, | ||
@@ -37,5 +37,5 @@ "devDependencies": { | ||
"@types/is-windows": "^1.0.0", | ||
"@types/semver": "7.3.13", | ||
"@types/semver": "7.5.3", | ||
"is-windows": "^1.0.2", | ||
"@pnpm/git-resolver": "8.0.7" | ||
"@pnpm/git-resolver": "8.0.8" | ||
}, | ||
@@ -42,0 +42,0 @@ "funding": "https://opencollective.com/pnpm", |
Sorry, the diff of this file is not supported yet
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
309
22983
+ Added@pnpm/core-loggers@9.0.4(transitive)
+ Added@pnpm/fetch@7.0.5(transitive)
+ Added@pnpm/resolver-base@10.0.4(transitive)
+ Added@pnpm/types@9.4.0(transitive)
- Removed@pnpm/core-loggers@9.0.3(transitive)
- Removed@pnpm/fetch@7.0.4(transitive)
- Removed@pnpm/resolver-base@10.0.3(transitive)
- Removed@pnpm/types@9.3.0(transitive)
Updated@pnpm/fetch@7.0.5
Updated@pnpm/resolver-base@10.0.4