Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@pnpm/git-resolver

Package Overview
Dependencies
Maintainers
2
Versions
133
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pnpm/git-resolver - npm Package Compare versions

Comparing version 8.0.7 to 8.0.8

23

lib/parsePref.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc