fix(streams): tighten stream typings and guard optional runtime paths for duplex and wrapper utilities

This commit is contained in:
2026-04-30 12:04:51 +00:00
parent f78469a299
commit fccd0f86ad
19 changed files with 1687 additions and 4247 deletions
+7 -2
View File
@@ -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;