@naturalcycles/nodejs-lib 12.85.0 → 12.85.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/stream/transform/transformMap.js +1 -1
- package/dist/stream/transform/transformMapSync.js +1 -1
- package/dist/string/inspectAny.js +1 -1
- package/package.json +1 -1
- package/src/stream/transform/transformMap.ts +6 -2
- package/src/stream/transform/transformMapSync.ts +6 -2
- package/src/string/inspectAny.ts +1 -1
|
@@ -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
|
|
@@ -10,7 +10,7 @@ const INSPECT_OPT = {
|
|
|
10
10
|
/**
|
|
11
11
|
* Just a convenience export of a const that fulfills the JsonStringifyFunction interface.
|
|
12
12
|
*/
|
|
13
|
-
const inspectAnyStringifyFn = obj =>
|
|
13
|
+
const inspectAnyStringifyFn = obj => (0, node_util_1.inspect)(obj, INSPECT_OPT);
|
|
14
14
|
exports.inspectAnyStringifyFn = inspectAnyStringifyFn;
|
|
15
15
|
/**
|
|
16
16
|
* Transforms ANY to human-readable string (via util.inspect mainly).
|
package/package.json
CHANGED
|
@@ -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()
|
package/src/string/inspectAny.ts
CHANGED
|
@@ -11,7 +11,7 @@ const INSPECT_OPT: InspectOptions = {
|
|
|
11
11
|
/**
|
|
12
12
|
* Just a convenience export of a const that fulfills the JsonStringifyFunction interface.
|
|
13
13
|
*/
|
|
14
|
-
export const inspectAnyStringifyFn: JsonStringifyFunction = obj =>
|
|
14
|
+
export const inspectAnyStringifyFn: JsonStringifyFunction = obj => inspect(obj, INSPECT_OPT)
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Transforms ANY to human-readable string (via util.inspect mainly).
|