@naturalcycles/js-lib 14.139.1 → 14.139.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/http/fetcher.js +2 -1
- package/dist/promise/pRetry.js +1 -1
- package/dist/seq/seq.js +0 -1
- package/dist-esm/http/fetcher.js +2 -1
- package/dist-esm/promise/pRetry.js +1 -1
- package/dist-esm/seq/seq.js +0 -1
- package/package.json +1 -1
- package/src/http/fetcher.ts +2 -1
- package/src/promise/pRetry.ts +1 -1
- package/src/seq/seq.ts +0 -2
package/dist/http/fetcher.js
CHANGED
|
@@ -119,7 +119,6 @@ class Fetcher {
|
|
|
119
119
|
},
|
|
120
120
|
signature,
|
|
121
121
|
};
|
|
122
|
-
/* eslint-disable no-await-in-loop */
|
|
123
122
|
while (!res.retryStatus.retryStopped) {
|
|
124
123
|
const started = Date.now();
|
|
125
124
|
if (this.cfg.logRequest) {
|
|
@@ -139,6 +138,8 @@ class Fetcher {
|
|
|
139
138
|
// For example, CORS error would result in "TypeError: failed to fetch" here
|
|
140
139
|
res.err = err;
|
|
141
140
|
res.ok = false;
|
|
141
|
+
// important to set it to undefined, otherwise it can keep the previous value (from previous try)
|
|
142
|
+
res.fetchResponse = undefined;
|
|
142
143
|
}
|
|
143
144
|
res.statusFamily = this.getStatusFamily(res);
|
|
144
145
|
if (res.fetchResponse?.ok) {
|
package/dist/promise/pRetry.js
CHANGED
|
@@ -25,7 +25,7 @@ async function pRetry(fn, opt = {}) {
|
|
|
25
25
|
const fname = name || fn.name || 'pRetry function';
|
|
26
26
|
let delay = initialDelay;
|
|
27
27
|
let attempt = 0;
|
|
28
|
-
/* eslint-disable no-
|
|
28
|
+
/* eslint-disable no-constant-condition */
|
|
29
29
|
while (true) {
|
|
30
30
|
const started = Date.now();
|
|
31
31
|
try {
|
package/dist/seq/seq.js
CHANGED
package/dist-esm/http/fetcher.js
CHANGED
|
@@ -127,7 +127,6 @@ export class Fetcher {
|
|
|
127
127
|
},
|
|
128
128
|
signature,
|
|
129
129
|
};
|
|
130
|
-
/* eslint-disable no-await-in-loop */
|
|
131
130
|
while (!res.retryStatus.retryStopped) {
|
|
132
131
|
const started = Date.now();
|
|
133
132
|
if (this.cfg.logRequest) {
|
|
@@ -147,6 +146,8 @@ export class Fetcher {
|
|
|
147
146
|
// For example, CORS error would result in "TypeError: failed to fetch" here
|
|
148
147
|
res.err = err;
|
|
149
148
|
res.ok = false;
|
|
149
|
+
// important to set it to undefined, otherwise it can keep the previous value (from previous try)
|
|
150
|
+
res.fetchResponse = undefined;
|
|
150
151
|
}
|
|
151
152
|
res.statusFamily = this.getStatusFamily(res);
|
|
152
153
|
if ((_g = res.fetchResponse) === null || _g === void 0 ? void 0 : _g.ok) {
|
|
@@ -21,7 +21,7 @@ export async function pRetry(fn, opt = {}) {
|
|
|
21
21
|
const fname = name || fn.name || 'pRetry function';
|
|
22
22
|
let delay = initialDelay;
|
|
23
23
|
let attempt = 0;
|
|
24
|
-
/* eslint-disable no-
|
|
24
|
+
/* eslint-disable no-constant-condition */
|
|
25
25
|
while (true) {
|
|
26
26
|
const started = Date.now();
|
|
27
27
|
try {
|
package/dist-esm/seq/seq.js
CHANGED
package/package.json
CHANGED
package/src/http/fetcher.ts
CHANGED
|
@@ -182,7 +182,6 @@ export class Fetcher {
|
|
|
182
182
|
signature,
|
|
183
183
|
} as FetcherResponse<any>
|
|
184
184
|
|
|
185
|
-
/* eslint-disable no-await-in-loop */
|
|
186
185
|
while (!res.retryStatus.retryStopped) {
|
|
187
186
|
const started = Date.now()
|
|
188
187
|
|
|
@@ -205,6 +204,8 @@ export class Fetcher {
|
|
|
205
204
|
// For example, CORS error would result in "TypeError: failed to fetch" here
|
|
206
205
|
res.err = err as Error
|
|
207
206
|
res.ok = false
|
|
207
|
+
// important to set it to undefined, otherwise it can keep the previous value (from previous try)
|
|
208
|
+
res.fetchResponse = undefined
|
|
208
209
|
}
|
|
209
210
|
res.statusFamily = this.getStatusFamily(res)
|
|
210
211
|
|
package/src/promise/pRetry.ts
CHANGED
package/src/seq/seq.ts
CHANGED