@naturalcycles/nodejs-lib 12.85.1 → 12.85.3
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/got/getGot.d.ts +2 -0
- package/dist/got/getGot.js +2 -0
- package/dist/stream/transform/transformMap.js +1 -1
- package/dist/stream/transform/transformMapSync.js +1 -1
- package/package.json +1 -1
- package/src/got/getGot.ts +2 -0
- package/src/stream/transform/transformMap.ts +6 -2
- package/src/stream/transform/transformMapSync.ts +6 -2
package/dist/got/getGot.d.ts
CHANGED
|
@@ -7,5 +7,7 @@ import { GetGotOptions } from './got.model';
|
|
|
7
7
|
* 2. Hooks that log start/end of request (optional, false by default).
|
|
8
8
|
* 3. Reasonable defaults(tm), e.g non-infinite Timeout
|
|
9
9
|
* 4. Preserves error stack traces (!) (experimental!)
|
|
10
|
+
*
|
|
11
|
+
* @deprecated `getGot` (together with `getKy`) is deprecated in favor of `getFetcher` of js-lib
|
|
10
12
|
*/
|
|
11
13
|
export declare function getGot(opt?: GetGotOptions): Got;
|
package/dist/got/getGot.js
CHANGED
|
@@ -12,6 +12,8 @@ const __1 = require("..");
|
|
|
12
12
|
* 2. Hooks that log start/end of request (optional, false by default).
|
|
13
13
|
* 3. Reasonable defaults(tm), e.g non-infinite Timeout
|
|
14
14
|
* 4. Preserves error stack traces (!) (experimental!)
|
|
15
|
+
*
|
|
16
|
+
* @deprecated `getGot` (together with `getKy`) is deprecated in favor of `getFetcher` of js-lib
|
|
15
17
|
*/
|
|
16
18
|
function getGot(opt = {}) {
|
|
17
19
|
opt.logger ||= console;
|
|
@@ -33,7 +33,7 @@ function transformMap(mapper, opt = {}) {
|
|
|
33
33
|
logErrorStats(true);
|
|
34
34
|
if (collectedErrors.length) {
|
|
35
35
|
// emit Aggregated error
|
|
36
|
-
cb(new
|
|
36
|
+
cb(new AggregateError(collectedErrors, `transformMap resulted in ${collectedErrors.length} error(s)`));
|
|
37
37
|
}
|
|
38
38
|
else {
|
|
39
39
|
// emit no error
|
|
@@ -70,7 +70,7 @@ function transformMapSync(mapper, opt = {}) {
|
|
|
70
70
|
logErrorStats(true);
|
|
71
71
|
if (collectedErrors.length) {
|
|
72
72
|
// emit Aggregated error
|
|
73
|
-
cb(new
|
|
73
|
+
cb(new AggregateError(collectedErrors, `transformMapSync resulted in ${collectedErrors.length} error(s)`));
|
|
74
74
|
}
|
|
75
75
|
else {
|
|
76
76
|
// emit no error
|
package/package.json
CHANGED
package/src/got/getGot.ts
CHANGED
|
@@ -17,6 +17,8 @@ import { GetGotOptions, GotRequestContext } from './got.model'
|
|
|
17
17
|
* 2. Hooks that log start/end of request (optional, false by default).
|
|
18
18
|
* 3. Reasonable defaults(tm), e.g non-infinite Timeout
|
|
19
19
|
* 4. Preserves error stack traces (!) (experimental!)
|
|
20
|
+
*
|
|
21
|
+
* @deprecated `getGot` (together with `getKy`) is deprecated in favor of `getFetcher` of js-lib
|
|
20
22
|
*/
|
|
21
23
|
export function getGot(opt: GetGotOptions = {}): Got {
|
|
22
24
|
opt.logger ||= console
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
_anyToError,
|
|
3
3
|
AbortableAsyncMapper,
|
|
4
|
-
AggregatedError,
|
|
5
4
|
AsyncPredicate,
|
|
6
5
|
CommonLogger,
|
|
7
6
|
END,
|
|
@@ -104,7 +103,12 @@ export function transformMap<IN = any, OUT = IN>(
|
|
|
104
103
|
|
|
105
104
|
if (collectedErrors.length) {
|
|
106
105
|
// emit Aggregated error
|
|
107
|
-
cb(
|
|
106
|
+
cb(
|
|
107
|
+
new AggregateError(
|
|
108
|
+
collectedErrors,
|
|
109
|
+
`transformMap resulted in ${collectedErrors.length} error(s)`,
|
|
110
|
+
),
|
|
111
|
+
)
|
|
108
112
|
} else {
|
|
109
113
|
// emit no error
|
|
110
114
|
cb()
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
2
|
_anyToError,
|
|
3
|
-
AggregatedError,
|
|
4
3
|
CommonLogger,
|
|
5
4
|
END,
|
|
6
5
|
ErrorMode,
|
|
@@ -141,7 +140,12 @@ export function transformMapSync<IN = any, OUT = IN>(
|
|
|
141
140
|
|
|
142
141
|
if (collectedErrors.length) {
|
|
143
142
|
// emit Aggregated error
|
|
144
|
-
cb(
|
|
143
|
+
cb(
|
|
144
|
+
new AggregateError(
|
|
145
|
+
collectedErrors,
|
|
146
|
+
`transformMapSync resulted in ${collectedErrors.length} error(s)`,
|
|
147
|
+
),
|
|
148
|
+
)
|
|
145
149
|
} else {
|
|
146
150
|
// emit no error
|
|
147
151
|
cb()
|