fix(streams): tighten stream typings and guard optional runtime paths for duplex and wrapper utilities
This commit is contained in:
@@ -59,7 +59,7 @@ export class StreamWrapper {
|
||||
}
|
||||
|
||||
// combine the stream
|
||||
let finalStream = null;
|
||||
let finalStream: plugins.stream.Duplex | null = null;
|
||||
let firstIteration: boolean = true;
|
||||
for (const stream of streamExecutionArray) {
|
||||
if (firstIteration === true) {
|
||||
@@ -71,12 +71,17 @@ export class StreamWrapper {
|
||||
for (const customEventObject of this.customEventObjectArray) {
|
||||
stream.on(customEventObject.eventName, customEventObject.eventFunction);
|
||||
}
|
||||
if (!firstIteration) {
|
||||
if (!firstIteration && finalStream) {
|
||||
finalStream = finalStream.pipe(stream);
|
||||
}
|
||||
firstIteration = false;
|
||||
}
|
||||
|
||||
if (!finalStream) {
|
||||
done.resolve();
|
||||
return done.promise;
|
||||
}
|
||||
|
||||
this.streamStartedDeferred.resolve();
|
||||
|
||||
let resolved = false;
|
||||
|
||||
Reference in New Issue
Block a user