stream-transform
Advanced tools
Comparing version 3.2.10 to 3.3.0
@@ -52,3 +52,12 @@ | ||
const result = this.handler.call(this, chunk, this.options.params); | ||
this.__done(null, [result], cb); | ||
if (result && result.then) { | ||
result.then((result) => { | ||
this.__done(null, [result], cb); | ||
}); | ||
result.catch((err) => { | ||
this.__done(err); | ||
}); | ||
} else { | ||
this.__done(null, [result], cb); | ||
} | ||
}else if(l === 2){ // async | ||
@@ -78,3 +87,4 @@ const callback = (err, ...chunks) => | ||
if(err){ | ||
return this.emit('error', err); | ||
return this.destroy(err); | ||
// return this.emit('error', err); | ||
} | ||
@@ -81,0 +91,0 @@ this.state.finished++; |
{ | ||
"version": "3.2.10", | ||
"version": "3.3.0", | ||
"name": "stream-transform", | ||
@@ -9,3 +9,5 @@ "description": "Object transformations implementing the Node.js `stream.Transform` API", | ||
"csv", | ||
"object" | ||
"object", | ||
"backend", | ||
"frontend" | ||
], | ||
@@ -19,3 +21,3 @@ "author": "David Worms <david@adaltas.com> (https://www.adaltas.com)", | ||
"coffeescript": "~2.7.0", | ||
"csv-generate": "^4.3.0", | ||
"csv-generate": "^4.3.1", | ||
"each": "^2.4.0", | ||
@@ -98,3 +100,3 @@ "eslint": "^8.47.0", | ||
"test": "mocha 'test/**/*.{coffee,ts}'", | ||
"test:legacy": "mocha --loader=./test/loaders/legacy/all.js --ignore test/handler.mode.callback.coffee 'test/**/*.{coffee,ts}'" | ||
"test:legacy": "mocha --loader=./test/loaders/legacy/all.js --ignore test/handler.mode.callback.coffee --ignore test/handler.mode.callback.error.coffee 'test/**/*.{coffee,ts}'" | ||
}, | ||
@@ -119,3 +121,3 @@ "type": "module", | ||
}, | ||
"gitHead": "79939aee56c467ab8f866eac3ebc591279b2f6f2" | ||
"gitHead": "a312a7c4cc8a58cefdaa16cb1ddbf14bf047c4b9" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
976259
28234