Allow CB to be called by construction streams

This commit is contained in:
Jerry Kurian
2019-08-29 14:39:08 -04:00
parent 9765e6cb49
commit 2524d51aa7
3 changed files with 17 additions and 20 deletions

View File

@@ -52,8 +52,10 @@ class Compose extends Duplex {
return (this.last as NodeJS.ReadableStream).pipe(dest);
}
public write(chunk: any) {
return (this.first as NodeJS.WritableStream).write(chunk);
public _write(chunk: any, encoding: string, cb: any) {
const res = (this.first as NodeJS.WritableStream).write(chunk);
cb();
return res;
}
public on(event: string, cb: any) {