@naturalcycles/js-lib 14.131.1 → 14.131.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-esm/http/fetcher.js +3 -2
- package/package.json +1 -1
- package/src/http/fetcher.ts +12 -2
package/dist/http/fetcher.js
CHANGED
|
@@ -346,7 +346,7 @@ class Fetcher {
|
|
|
346
346
|
return norm;
|
|
347
347
|
}
|
|
348
348
|
normalizeOptions(url, opt) {
|
|
349
|
-
const { baseUrl, timeoutSeconds, throwHttpErrors, retryPost, retry4xx, retry5xx, retry, mode } = this.cfg;
|
|
349
|
+
const { baseUrl, timeoutSeconds, throwHttpErrors, retryPost, retry4xx, retry5xx, retry, mode, jsonReviver, } = this.cfg;
|
|
350
350
|
const req = {
|
|
351
351
|
mode,
|
|
352
352
|
url,
|
|
@@ -355,6 +355,7 @@ class Fetcher {
|
|
|
355
355
|
retryPost,
|
|
356
356
|
retry4xx,
|
|
357
357
|
retry5xx,
|
|
358
|
+
jsonReviver,
|
|
358
359
|
...(0, object_util_1._omit)(opt, ['method', 'headers', 'credentials']),
|
|
359
360
|
retry: {
|
|
360
361
|
...retry,
|
package/dist-esm/http/fetcher.js
CHANGED
|
@@ -388,14 +388,15 @@ export class Fetcher {
|
|
|
388
388
|
}
|
|
389
389
|
normalizeOptions(url, opt) {
|
|
390
390
|
var _a, _b;
|
|
391
|
-
const { baseUrl, timeoutSeconds, throwHttpErrors, retryPost, retry4xx, retry5xx, retry, mode } = this.cfg;
|
|
391
|
+
const { baseUrl, timeoutSeconds, throwHttpErrors, retryPost, retry4xx, retry5xx, retry, mode, jsonReviver, } = this.cfg;
|
|
392
392
|
const req = Object.assign(Object.assign({ mode,
|
|
393
393
|
url,
|
|
394
394
|
timeoutSeconds,
|
|
395
395
|
throwHttpErrors,
|
|
396
396
|
retryPost,
|
|
397
397
|
retry4xx,
|
|
398
|
-
retry5xx
|
|
398
|
+
retry5xx,
|
|
399
|
+
jsonReviver }, _omit(opt, ['method', 'headers', 'credentials'])), { retry: Object.assign(Object.assign({}, retry), _filterUndefinedValues(opt.retry || {})), init: _merge(Object.assign(Object.assign({}, this.cfg.init), { method: opt.method || this.cfg.init.method, credentials: opt.credentials || this.cfg.init.credentials, redirect: ((_b = (_a = opt.followRedirects) !== null && _a !== void 0 ? _a : this.cfg.followRedirects) !== null && _b !== void 0 ? _b : true) ? 'follow' : 'error' }), {
|
|
399
400
|
headers: _mapKeys(opt.headers || {}, k => k.toLowerCase()),
|
|
400
401
|
}) });
|
|
401
402
|
// setup url
|
package/package.json
CHANGED
package/src/http/fetcher.ts
CHANGED
|
@@ -436,8 +436,17 @@ export class Fetcher {
|
|
|
436
436
|
}
|
|
437
437
|
|
|
438
438
|
private normalizeOptions(url: string, opt: FetcherOptions): FetcherRequest {
|
|
439
|
-
const {
|
|
440
|
-
|
|
439
|
+
const {
|
|
440
|
+
baseUrl,
|
|
441
|
+
timeoutSeconds,
|
|
442
|
+
throwHttpErrors,
|
|
443
|
+
retryPost,
|
|
444
|
+
retry4xx,
|
|
445
|
+
retry5xx,
|
|
446
|
+
retry,
|
|
447
|
+
mode,
|
|
448
|
+
jsonReviver,
|
|
449
|
+
} = this.cfg
|
|
441
450
|
|
|
442
451
|
const req: FetcherRequest = {
|
|
443
452
|
mode,
|
|
@@ -447,6 +456,7 @@ export class Fetcher {
|
|
|
447
456
|
retryPost,
|
|
448
457
|
retry4xx,
|
|
449
458
|
retry5xx,
|
|
459
|
+
jsonReviver,
|
|
450
460
|
..._omit(opt, ['method', 'headers', 'credentials']),
|
|
451
461
|
retry: {
|
|
452
462
|
...retry,
|