| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 8ca50b6 commit d3449ca
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -138,10 +138,9 @@ async function pumpToNode(iterable, writable, finish, { end }) { | |||
| 138 | 138 | ||
| 139 | 139 | if (end) { | |
| 140 | 140 | writable.end(); | |
| 141 | + await wait(); | ||
| 141 | 142 | } | |
| 142 | 143 | ||
| 143 | - await wait(); | ||
| 144 | - | ||
| 145 | 144 | finish(); | |
| 146 | 145 | } catch (err) { | |
| 147 | 146 | finish(error !== err ? aggregateTwoErrors(error, err) : err); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1616,3 +1616,21 @@ const tsp = require('timers/promises'); | |||
| 1616 | 1616 | dup.push(null); | |
| 1617 | 1617 | dup.read(); | |
| 1618 | 1618 | } | |
| 1619 | + | ||
| 1620 | + { | ||
| 1621 | + let res = ''; | ||
| 1622 | + const writable = new Writable({ | ||
| 1623 | + write(chunk, enc, cb) { | ||
| 1624 | + res += chunk; | ||
| 1625 | + cb(); | ||
| 1626 | + } | ||
| 1627 | + }); | ||
| 1628 | + pipelinep(async function*() { | ||
| 1629 | + yield 'hello'; | ||
| 1630 | + await Promise.resolve(); | ||
| 1631 | + yield 'world'; | ||
| 1632 | + }, writable, { end: false }).then(common.mustCall(() => { | ||
| 1633 | + assert.strictEqual(res, 'helloworld'); | ||
| 1634 | + assert.strictEqual(writable.closed, false); | ||
| 1635 | + })); | ||
| 1636 | + } | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments