From e8e067ea77b4c4a5dc54767c2cf01a18bd58cc43 Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Fri, 3 Nov 2023 22:26:15 +0100 Subject: [PATCH] fix(core): update --- test/test.streamfunction.ts | 4 ++-- ts/00_commitinfo_data.ts | 2 +- ts/smartstream.classes.smartduplex.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/test.streamfunction.ts b/test/test.streamfunction.ts index aef5186..1d99c45 100644 --- a/test/test.streamfunction.ts +++ b/test/test.streamfunction.ts @@ -16,7 +16,7 @@ tap.test('should handle a read stream', async (tools) => { streamTools.push('wow =========== \n'); return Buffer.from(result); }, - streamEndFunction: async (tools) => { + finalFunction: async (tools) => { return Buffer.from('this is the end'); }, }), @@ -24,7 +24,7 @@ tap.test('should handle a read stream', async (tools) => { writeAndTransformFunction: async (chunkStringArg) => { console.log(chunkStringArg.toString()); }, - streamEndFunction: async (tools) => { + finalFunction: async (tools) => { tools.push(null); }, }) diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index bcf3787..809a92c 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@push.rocks/smartstream', - version: '3.0.4', + version: '3.0.5', description: 'simplifies access to node streams' } diff --git a/ts/smartstream.classes.smartduplex.ts b/ts/smartstream.classes.smartduplex.ts index 4ba28c4..2ef0215 100644 --- a/ts/smartstream.classes.smartduplex.ts +++ b/ts/smartstream.classes.smartduplex.ts @@ -17,7 +17,7 @@ export interface IStreamEndFunction { export interface SmartStreamOptions extends DuplexOptions { readFunction?: () => Promise; writeAndTransformFunction?: IWriteAndTransformFunction; - streamEndFunction?: IStreamEndFunction; + finalFunction?: IStreamEndFunction; // Add other custom options if necessary } @@ -117,7 +117,7 @@ export class SmartDuplex extends Duplex { super(optionsArg); this.readFunction = optionsArg?.readFunction; this.writeAndTransformFunction = optionsArg?.writeAndTransformFunction; - this.streamEndFunction = optionsArg?.streamEndFunction; + this.streamEndFunction = optionsArg?.finalFunction; } public async _read(size: number): Promise {