fix(core): update
This commit is contained in:
		@@ -16,7 +16,7 @@ tap.test('should handle a read stream', async (tools) => {
 | 
				
			|||||||
        streamTools.push('wow =========== \n');
 | 
					        streamTools.push('wow =========== \n');
 | 
				
			||||||
        return Buffer.from(result);
 | 
					        return Buffer.from(result);
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      streamEndFunction: async (tools) => {
 | 
					      finalFunction: async (tools) => {
 | 
				
			||||||
        return Buffer.from('this is the end');
 | 
					        return Buffer.from('this is the end');
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
    }),
 | 
					    }),
 | 
				
			||||||
@@ -24,7 +24,7 @@ tap.test('should handle a read stream', async (tools) => {
 | 
				
			|||||||
      writeAndTransformFunction: async (chunkStringArg) => {
 | 
					      writeAndTransformFunction: async (chunkStringArg) => {
 | 
				
			||||||
        console.log(chunkStringArg.toString());
 | 
					        console.log(chunkStringArg.toString());
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      streamEndFunction: async (tools) => {
 | 
					      finalFunction: async (tools) => {
 | 
				
			||||||
        tools.push(null);
 | 
					        tools.push(null);
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,6 +3,6 @@
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
export const commitinfo = {
 | 
					export const commitinfo = {
 | 
				
			||||||
  name: '@push.rocks/smartstream',
 | 
					  name: '@push.rocks/smartstream',
 | 
				
			||||||
  version: '3.0.4',
 | 
					  version: '3.0.5',
 | 
				
			||||||
  description: 'simplifies access to node streams'
 | 
					  description: 'simplifies access to node streams'
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,7 +17,7 @@ export interface IStreamEndFunction<rT> {
 | 
				
			|||||||
export interface SmartStreamOptions<TInput, TOutput> extends DuplexOptions {
 | 
					export interface SmartStreamOptions<TInput, TOutput> extends DuplexOptions {
 | 
				
			||||||
  readFunction?: () => Promise<void>;
 | 
					  readFunction?: () => Promise<void>;
 | 
				
			||||||
  writeAndTransformFunction?: IWriteAndTransformFunction<TInput, TOutput>;
 | 
					  writeAndTransformFunction?: IWriteAndTransformFunction<TInput, TOutput>;
 | 
				
			||||||
  streamEndFunction?: IStreamEndFunction<TOutput>;
 | 
					  finalFunction?: IStreamEndFunction<TOutput>;
 | 
				
			||||||
  // Add other custom options if necessary
 | 
					  // Add other custom options if necessary
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -117,7 +117,7 @@ export class SmartDuplex<TInput = any, TOutput = any> extends Duplex {
 | 
				
			|||||||
    super(optionsArg);
 | 
					    super(optionsArg);
 | 
				
			||||||
    this.readFunction = optionsArg?.readFunction;
 | 
					    this.readFunction = optionsArg?.readFunction;
 | 
				
			||||||
    this.writeAndTransformFunction = optionsArg?.writeAndTransformFunction;
 | 
					    this.writeAndTransformFunction = optionsArg?.writeAndTransformFunction;
 | 
				
			||||||
    this.streamEndFunction = optionsArg?.streamEndFunction;
 | 
					    this.streamEndFunction = optionsArg?.finalFunction;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  public async _read(size: number): Promise<void> {
 | 
					  public async _read(size: number): Promise<void> {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user