Update demux
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { pipeline, TransformOptions, Transform } from "stream";
|
||||
import { AllStreams, isReadable } from "../helpers";
|
||||
|
||||
export function compose(
|
||||
streams: Array<
|
||||
@@ -21,18 +22,6 @@ enum EventSubscription {
|
||||
Self,
|
||||
}
|
||||
|
||||
type AllStreams =
|
||||
| NodeJS.ReadableStream
|
||||
| NodeJS.ReadWriteStream
|
||||
| NodeJS.WritableStream;
|
||||
|
||||
function isReadable(stream: AllStreams): stream is NodeJS.WritableStream {
|
||||
return (
|
||||
(stream as NodeJS.ReadableStream).pipe !== undefined &&
|
||||
(stream as any).readable === true
|
||||
);
|
||||
}
|
||||
|
||||
export class Compose extends Transform {
|
||||
private first: AllStreams;
|
||||
private last: AllStreams;
|
||||
|
||||
Reference in New Issue
Block a user