Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
stream: support array of streams in promises pipeline
Fixes: #40191
  • Loading branch information
Mesteery authored Sep 23, 2021
commit c9ed79fe1cac4eb4f2f0717bc8e9e8540769e35b
6 changes: 6 additions & 0 deletions lib/stream/promises.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

const {
ArrayIsArray,
ArrayPrototypePop,
Promise,
} = primordials;
Expand All @@ -23,6 +24,11 @@ function pipeline(...streams) {
signal = options.signal;
}

// pipeline(streams)
if (streams.length === 1 && ArrayIsArray(streams[0])) {
streams = streams[0];
}

pl(streams, (err, value) => {
if (err) {
reject(err);
Expand Down