@naturalcycles/js-lib 14.117.0 → 14.118.0
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/array/array.util.js +4 -4
- package/dist/datetime/dateInterval.js +1 -0
- package/dist/datetime/localDate.js +2 -0
- package/dist/datetime/localTime.js +2 -3
- package/dist/datetime/timeInterval.js +1 -0
- package/dist/decorators/asyncMemo.decorator.d.ts +2 -2
- package/dist/decorators/createPromiseDecorator.d.ts +6 -6
- package/dist/decorators/logMethod.decorator.js +4 -5
- package/dist/decorators/memo.decorator.d.ts +2 -2
- package/dist/error/tryCatch.d.ts +1 -1
- package/dist/http/fetcher.d.ts +146 -0
- package/dist/http/fetcher.js +298 -0
- package/dist/http/http.model.d.ts +2 -0
- package/dist/http/http.model.js +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/object/deepEquals.js +1 -0
- package/dist/object/object.util.js +8 -10
- package/dist/promise/pRetry.d.ts +1 -1
- package/dist/promise/pTimeout.d.ts +1 -1
- package/dist/string/pupa.d.ts +2 -2
- package/dist/string/readingTime.d.ts +1 -1
- package/dist/string/safeJsonStringify.js +5 -7
- package/dist/string/stringifyAny.js +2 -1
- package/dist/string/url.util.js +1 -1
- package/dist-esm/array/array.util.js +4 -4
- package/dist-esm/datetime/dateInterval.js +1 -0
- package/dist-esm/datetime/localDate.js +2 -0
- package/dist-esm/datetime/localTime.js +2 -3
- package/dist-esm/datetime/timeInterval.js +1 -0
- package/dist-esm/decorators/logMethod.decorator.js +4 -5
- package/dist-esm/http/fetcher.js +251 -0
- package/dist-esm/http/http.model.js +1 -0
- package/dist-esm/index.js +2 -0
- package/dist-esm/object/deepEquals.js +1 -0
- package/dist-esm/object/object.util.js +8 -10
- package/dist-esm/string/safeJsonStringify.js +5 -7
- package/dist-esm/string/stringifyAny.js +2 -1
- package/dist-esm/string/url.util.js +1 -1
- package/package.json +1 -1
- package/src/array/array.util.ts +4 -4
- package/src/datetime/dateInterval.ts +1 -0
- package/src/datetime/localDate.ts +2 -0
- package/src/datetime/localTime.ts +2 -2
- package/src/datetime/timeInterval.ts +1 -0
- package/src/decorators/asyncMemo.decorator.ts +2 -2
- package/src/decorators/createPromiseDecorator.ts +4 -4
- package/src/decorators/logMethod.decorator.ts +4 -4
- package/src/decorators/memo.decorator.ts +2 -2
- package/src/error/tryCatch.ts +1 -1
- package/src/http/fetcher.ts +469 -0
- package/src/http/http.model.ts +3 -0
- package/src/index.ts +2 -0
- package/src/object/deepEquals.ts +1 -0
- package/src/object/object.util.ts +7 -8
- package/src/promise/pRetry.ts +1 -1
- package/src/promise/pTimeout.ts +1 -1
- package/src/string/pupa.ts +1 -1
- package/src/string/readingTime.ts +1 -1
- package/src/string/safeJsonStringify.ts +3 -5
- package/src/string/stringifyAny.ts +3 -1
- package/src/string/url.util.ts +1 -1
|
@@ -26,11 +26,9 @@ function serializer(replacer?: Reviver, cycleReplacer?: Reviver): Reviver {
|
|
|
26
26
|
const stack: any[] = []
|
|
27
27
|
const keys: string[] = []
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return '[Circular ~.' + keys.slice(0, stack.indexOf(value)).join('.') + ']'
|
|
33
|
-
}
|
|
29
|
+
cycleReplacer ??= function (key, value) {
|
|
30
|
+
if (stack[0] === value) return '[Circular ~]'
|
|
31
|
+
return '[Circular ~.' + keys.slice(0, stack.indexOf(value)).join('.') + ']'
|
|
34
32
|
}
|
|
35
33
|
|
|
36
34
|
return function (key, value) {
|
|
@@ -89,7 +89,9 @@ export function _stringifyAny(obj: any, opt: StringifyAnyOptions = {}): string {
|
|
|
89
89
|
// This is to fix the rare error (happened with Got) where `err.message` was changed,
|
|
90
90
|
// but err.stack had "old" err.message
|
|
91
91
|
// This should "fix" that
|
|
92
|
-
|
|
92
|
+
const sLines = s.split('\n').length
|
|
93
|
+
|
|
94
|
+
s = [s, ...obj.stack.split('\n').slice(sLines)].join('\n')
|
|
93
95
|
}
|
|
94
96
|
|
|
95
97
|
if (_isErrorObject(obj)) {
|
package/src/string/url.util.ts
CHANGED
|
@@ -16,7 +16,7 @@ import type { StringMap } from '../types'
|
|
|
16
16
|
export function _parseQueryString(search: string): StringMap {
|
|
17
17
|
const qs: StringMap = {}
|
|
18
18
|
search
|
|
19
|
-
.slice(search
|
|
19
|
+
.slice(search.startsWith('?') ? 1 : 0)
|
|
20
20
|
.split('&')
|
|
21
21
|
.forEach(p => {
|
|
22
22
|
const [k, v] = p.split('=')
|