| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 3befe80 commit 2585b81
1 file 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 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments