fix(core): update
This commit is contained in:
parent
0ae3fee987
commit
d1561ad1b7
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@push.rocks/smartstream',
|
name: '@push.rocks/smartstream',
|
||||||
version: '2.0.7',
|
version: '2.0.8',
|
||||||
description: 'simplifies access to node streams'
|
description: 'simplifies access to node streams'
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
export * from './smartstream.classes.passthrough.js';
|
||||||
export * from './smartstream.classes.smartstream.js';
|
export * from './smartstream.classes.smartstream.js';
|
||||||
export * from './smartstream.classes.streamwrapper.js';
|
export * from './smartstream.classes.streamwrapper.js';
|
||||||
export * from './smartstream.classes.streamintake.js';
|
export * from './smartstream.classes.streamintake.js';
|
||||||
|
19
ts/smartstream.classes.passthrough.ts
Normal file
19
ts/smartstream.classes.passthrough.ts
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
import * as plugins from './smartstream.plugins.js';
|
||||||
|
|
||||||
|
export class PassThrough extends plugins.stream.Duplex {
|
||||||
|
constructor(options?: plugins.stream.DuplexOptions) {
|
||||||
|
super(options);
|
||||||
|
}
|
||||||
|
|
||||||
|
_read(size: number): void {
|
||||||
|
// No-op: Data written will be automatically available for reading.
|
||||||
|
}
|
||||||
|
|
||||||
|
_write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void {
|
||||||
|
if (this.push(chunk, encoding)) {
|
||||||
|
callback();
|
||||||
|
} else {
|
||||||
|
this.once('drain', callback);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user