@@ -2647,8 +2647,8 @@ const finished = util.promisify(stream.finished);
2647
2647
2648
2648
const writable = fs .createWriteStream (' ./file' );
2649
2649
2650
- async function pump (iterator , writable ) {
2651
- for await (const chunk of iterator ) {
2650
+ async function pump (iterable , writable ) {
2651
+ for await (const chunk of iterable ) {
2652
2652
// Handle backpressure on write().
2653
2653
if (! writable .write (chunk)) {
2654
2654
if (writable .destroyed ) return ;
@@ -2661,7 +2661,7 @@ async function pump(iterator, writable) {
2661
2661
(async function () {
2662
2662
// Ensure completion without errors.
2663
2663
await Promise .all ([
2664
- pump (iterator , writable),
2664
+ pump (iterable , writable),
2665
2665
finished (writable)
2666
2666
]);
2667
2667
})();
@@ -2685,7 +2685,7 @@ const finished = util.promisify(stream.finished);
2685
2685
const writable = fs .createWriteStream (' ./file' );
2686
2686
2687
2687
(async function () {
2688
- const readable = Readable .from (iterator );
2688
+ const readable = Readable .from (iterable );
2689
2689
readable .pipe (writable);
2690
2690
// Ensure completion without errors.
2691
2691
await finished (writable);
@@ -2700,7 +2700,7 @@ const pipeline = util.promisify(stream.pipeline);
2700
2700
const writable = fs .createWriteStream (' ./file' );
2701
2701
2702
2702
(async function () {
2703
- const readable = Readable .from (iterator );
2703
+ const readable = Readable .from (iterable );
2704
2704
await pipeline (readable, writable);
2705
2705
})();
2706
2706
```
0 commit comments