@pnpm/fetch
Advanced tools
Comparing version 4.1.1 to 4.1.2
@@ -42,3 +42,3 @@ "use strict"; | ||
}, opts.retry); | ||
const op = retry_1.operation(retryOpts); | ||
const op = (0, retry_1.operation)(retryOpts); | ||
try { | ||
@@ -49,3 +49,3 @@ return await new Promise((resolve, reject) => op.attempt(async (attempt) => { | ||
// this will be retried | ||
const res = await node_fetch_1.default(url, opts); // eslint-disable-line | ||
const res = await (0, node_fetch_1.default)(url, opts); // eslint-disable-line | ||
if ((res.status >= 500 && res.status < 600) || res.status === 429) { | ||
@@ -59,3 +59,3 @@ throw new ResponseError(res); | ||
} | ||
catch (error) { | ||
catch (error) { // eslint-disable-line | ||
const timeout = op.retry(error); | ||
@@ -62,0 +62,0 @@ if (timeout === false) { |
@@ -47,3 +47,3 @@ "use strict"; | ||
while (true) { | ||
const agent = npm_registry_agent_1.default(urlObject.href, { | ||
const agent = (0, npm_registry_agent_1.default)(urlObject.href, { | ||
...defaultOpts, | ||
@@ -56,3 +56,3 @@ ...opts, | ||
// https://github.com/bitinn/node-fetch/issues/245 | ||
const response = await fetch_1.default(urlObject, { | ||
const response = await (0, fetch_1.default)(urlObject, { | ||
agent, | ||
@@ -66,3 +66,3 @@ // if verifying integrity, node-fetch must not decompress | ||
}); | ||
if (!fetch_1.isRedirect(response.status) || redirects >= MAX_FOLLOWED_REDIRECTS) { | ||
if (!(0, fetch_1.isRedirect)(response.status) || redirects >= MAX_FOLLOWED_REDIRECTS) { | ||
return response; | ||
@@ -69,0 +69,0 @@ } |
{ | ||
"name": "@pnpm/fetch", | ||
"version": "4.1.1", | ||
"version": "4.1.2", | ||
"description": "node-fetch with retries", | ||
@@ -16,2 +16,3 @@ "main": "lib/index.js", | ||
"keywords": [ | ||
"pnpm6", | ||
"fetch", | ||
@@ -31,3 +32,3 @@ "npm" | ||
"@pnpm/fetching-types": "2.2.1", | ||
"@pnpm/npm-registry-agent": "5.0.0", | ||
"@pnpm/npm-registry-agent": "5.0.1", | ||
"@zkochan/retry": "^0.2.0", | ||
@@ -34,0 +35,0 @@ "node-fetch": "3.0.0-beta.9" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
16440
+ Added@pnpm/npm-registry-agent@5.0.1(transitive)
+ Added@tootallnate/once@2.0.0(transitive)
+ Addedhttp-proxy-agent@5.0.0(transitive)
+ Addedhttps-proxy-agent@5.0.1(transitive)
+ Addedsocks-proxy-agent@6.2.1(transitive)
- Removed@pnpm/npm-registry-agent@5.0.0(transitive)
- Removed@tootallnate/once@1.1.2(transitive)
- Removedagent-base@4.3.0(transitive)
- Removeddebug@3.2.7(transitive)
- Removedes6-promise@4.2.8(transitive)
- Removedes6-promisify@5.0.0(transitive)
- Removedhttp-proxy-agent@4.0.1(transitive)
- Removedhttps-proxy-agent@3.0.1(transitive)
- Removedsocks-proxy-agent@5.0.1(transitive)