Skip to content

Commit

Permalink
stream: support array of streams in promises pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
Mesteery authored Sep 23, 2021
1 parent fd86dad commit c9ed79f
Showing 1 changed file with 6 additions and 0 deletions.
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

0 comments on commit c9ed79f

Please sign in to comment.