Skip to content

Commit c9ed79f

Browse files
authored
stream: support array of streams in promises pipeline
Fixes: #40191
1 parent fd86dad commit c9ed79f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/stream/promises.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use strict';
22

33
const {
4+
ArrayIsArray,
45
ArrayPrototypePop,
56
Promise,
67
} = primordials;
@@ -23,6 +24,11 @@ function pipeline(...streams) {
2324
signal = options.signal;
2425
}
2526

27+
// pipeline(streams)
28+
if (streams.length === 1 && ArrayIsArray(streams[0])) {
29+
streams = streams[0];
30+
}
31+
2632
pl(streams, (err, value) => {
2733
if (err) {
2834
reject(err);

0 commit comments

Comments
 (0)