From c9ed79fe1cac4eb4f2f0717bc8e9e8540769e35b Mon Sep 17 00:00:00 2001 From: Mestery Date: Thu, 23 Sep 2021 19:26:25 +0200 Subject: [PATCH] stream: support array of streams in promises pipeline Fixes: https://github.com/nodejs/node/issues/40191 --- lib/stream/promises.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/stream/promises.js b/lib/stream/promises.js index 0db01a8b208d60..714c8f11427e32 100644 --- a/lib/stream/promises.js +++ b/lib/stream/promises.js @@ -1,6 +1,7 @@ 'use strict'; const { + ArrayIsArray, ArrayPrototypePop, Promise, } = primordials; @@ -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);