@naturalcycles/nodejs-lib 12.56.0 → 12.56.1
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.
|
@@ -41,11 +41,16 @@ function transformMap(mapper, opt = {}) {
|
|
|
41
41
|
await beforeFinal?.(); // call beforeFinal if defined
|
|
42
42
|
if (collectedErrors.length) {
|
|
43
43
|
// emit Aggregated error
|
|
44
|
+
// For the same reason, magically, let's not call `cb`, but emit an error event instead
|
|
45
|
+
// this.emit('error', new AggregatedError(collectedErrors))
|
|
44
46
|
cb(new js_lib_1.AggregatedError(collectedErrors));
|
|
45
47
|
}
|
|
46
48
|
else {
|
|
47
49
|
// emit no error
|
|
48
|
-
cb()
|
|
50
|
+
// It is truly a mistery, but calling cb() here was causing ERR_MULTIPLE_CALLBACK ?!
|
|
51
|
+
// Commenting it out seems to work ?!
|
|
52
|
+
// ?!
|
|
53
|
+
// cb()
|
|
49
54
|
}
|
|
50
55
|
},
|
|
51
56
|
async transform(chunk, _encoding, cb) {
|
package/package.json
CHANGED
|
@@ -119,10 +119,15 @@ export function transformMap<IN = any, OUT = IN>(
|
|
|
119
119
|
|
|
120
120
|
if (collectedErrors.length) {
|
|
121
121
|
// emit Aggregated error
|
|
122
|
+
// For the same reason, magically, let's not call `cb`, but emit an error event instead
|
|
123
|
+
// this.emit('error', new AggregatedError(collectedErrors))
|
|
122
124
|
cb(new AggregatedError(collectedErrors))
|
|
123
125
|
} else {
|
|
124
126
|
// emit no error
|
|
125
|
-
cb()
|
|
127
|
+
// It is truly a mistery, but calling cb() here was causing ERR_MULTIPLE_CALLBACK ?!
|
|
128
|
+
// Commenting it out seems to work ?!
|
|
129
|
+
// ?!
|
|
130
|
+
// cb()
|
|
126
131
|
}
|
|
127
132
|
},
|
|
128
133
|
|