New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@pnpm/npm-resolver

Package Overview
Dependencies
Maintainers
2
Versions
212
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pnpm/npm-resolver - npm Package Compare versions

Comparing version 15.0.5 to 15.0.6

84

lib/fetch.js

@@ -54,45 +54,47 @@ "use strict";

const op = retry.operation(fetchOpts.retry);
return new Promise((resolve, reject) => op.attempt(async (attempt) => {
let response;
try {
response = await fetch(uri, {
authHeaderValue,
compress: true,
retry: fetchOpts.retry,
timeout: fetchOpts.timeout,
});
}
catch (error) { // eslint-disable-line
reject(new error_1.PnpmError('META_FETCH_FAIL', `GET ${uri}: ${error.message}`, { attempts: attempt }));
return;
}
if (response.status > 400) {
const request = {
authHeaderValue,
url: uri,
};
reject(new RegistryResponseError(request, response, pkgName));
return;
}
// Here we only retry broken JSON responses.
// Other HTTP issues are retried by the @pnpm/fetch library
try {
resolve(await response.json());
}
catch (error) { // eslint-disable-line
const timeout = op.retry(new error_1.PnpmError('BROKEN_METADATA_JSON', error.message));
if (timeout === false) {
reject(op.mainError());
return new Promise((resolve, reject) => {
op.attempt(async (attempt) => {
let response;
try {
response = await fetch(uri, {
authHeaderValue,
compress: true,
retry: fetchOpts.retry,
timeout: fetchOpts.timeout,
});
}
catch (error) { // eslint-disable-line
reject(new error_1.PnpmError('META_FETCH_FAIL', `GET ${uri}: ${error.message}`, { attempts: attempt }));
return;
}
core_loggers_1.requestRetryLogger.debug({
attempt,
error,
maxRetries: fetchOpts.retry.retries,
method: 'GET',
timeout,
url: uri,
});
}
}));
if (response.status > 400) {
const request = {
authHeaderValue,
url: uri,
};
reject(new RegistryResponseError(request, response, pkgName));
return;
}
// Here we only retry broken JSON responses.
// Other HTTP issues are retried by the @pnpm/fetch library
try {
resolve(await response.json());
}
catch (error) { // eslint-disable-line
const timeout = op.retry(new error_1.PnpmError('BROKEN_METADATA_JSON', error.message));
if (timeout === false) {
reject(op.mainError());
return;
}
core_loggers_1.requestRetryLogger.debug({
attempt,
error,
maxRetries: fetchOpts.retry.retries,
method: 'GET',
timeout,
url: uri,
});
}
});
});
}

@@ -99,0 +101,0 @@ exports.fromRegistry = fromRegistry;

{
"name": "@pnpm/npm-resolver",
"version": "15.0.5",
"version": "15.0.6",
"description": "Resolver for npm-hosted packages",

@@ -42,3 +42,3 @@ "main": "lib/index.js",

"semver": "^7.3.8",
"ssri": "10.0.0",
"ssri": "10.0.1",
"version-selector-type": "^3.0.0",

@@ -62,4 +62,4 @@ "@pnpm/core-loggers": "8.0.3",

"@pnpm/fetch": "6.0.5",
"@pnpm/npm-resolver": "15.0.5",
"@pnpm/test-fixtures": "0.0.29"
"@pnpm/npm-resolver": "15.0.6",
"@pnpm/test-fixtures": "0.0.30"
},

@@ -66,0 +66,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