| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 0185e3a commit b7a8878
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -228,7 +228,9 @@ function pipeline(...streams) { | |||
| 228 | 228 | // always returns a stream which can be further | |
| 229 | 229 | // composed through `.pipe(stream)`. | |
| 230 | 230 | ||
| 231 | - const pt = new PassThrough(); | ||
| 231 | + const pt = new PassThrough({ | ||
| 232 | + objectMode: true | ||
| 233 | + }); | ||
| 232 | 234 | if (isPromise(ret)) { | |
| 233 | 235 | ret | |
| 234 | 236 | .then((val) => { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1049,3 +1049,15 @@ const { promisify } = require('util'); | |||
| 1049 | 1049 | src.push('asd'); | |
| 1050 | 1050 | dst.destroy(); | |
| 1051 | 1051 | } | |
| 1052 | + | ||
| 1053 | + { | ||
| 1054 | + pipeline(async function * () { | ||
| 1055 | + yield 'asd'; | ||
| 1056 | + }, async function * (source) { | ||
| 1057 | + for await (const chunk of source) { | ||
| 1058 | + yield { chunk }; | ||
| 1059 | + } | ||
| 1060 | + }, common.mustCall((err) => { | ||
| 1061 | + assert.ifError(err); | ||
| 1062 | + })); | ||
| 1063 | + } | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments