File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -219,6 +219,11 @@ function pipeline(...streams) {
219
219
PassThrough = require ( '_stream_passthrough' ) ;
220
220
}
221
221
222
+ // If the last argument to pipeline is not a stream
223
+ // we must create a proxy stream so that pipeline(...)
224
+ // always returns a stream which can be further
225
+ // composed through `.pipe(stream)`.
226
+
222
227
const pt = new PassThrough ( ) ;
223
228
if ( isPromise ( ret ) ) {
224
229
ret
@@ -253,6 +258,9 @@ function pipeline(...streams) {
253
258
}
254
259
}
255
260
261
+ // TODO(ronag): Consider returning a Duplex proxy if the first argument
262
+ // is a writable. Would improve composability.
263
+ // See, https://github.com/nodejs/node/issues/32020
256
264
return ret ;
257
265
}
258
266
You can’t perform that action at this time.
0 commit comments