fix(core): update
This commit is contained in:
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@push.rocks/smartstream',
|
||||
version: '3.0.23',
|
||||
version: '3.0.24',
|
||||
description: 'simplifies access to node streams'
|
||||
}
|
||||
|
@ -115,22 +115,22 @@ export class SmartDuplex<TInput = any, TOutput = any> extends Duplex {
|
||||
const tools: IStreamTools = {
|
||||
truncate: () => callback(),
|
||||
push: async (pipeObject) => {
|
||||
this.push(pipeObject);
|
||||
this.backpressuredArray.push(pipeObject);
|
||||
},
|
||||
};
|
||||
|
||||
try {
|
||||
const finalChunk = await this.options.finalFunction(tools);
|
||||
if (finalChunk) {
|
||||
this.push(finalChunk);
|
||||
this.backpressuredArray.push(finalChunk);
|
||||
}
|
||||
} catch (err) {
|
||||
this.push(null);
|
||||
this.backpressuredArray.push(null);
|
||||
callback(err);
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.push(null);
|
||||
this.backpressuredArray.push(null);
|
||||
callback();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user