@@ -2644,8 +2644,8 @@ const finished = util.promisify(stream.finished); |
2644 | 2644 |
|
2645 | 2645 | const writable = fs.createWriteStream('./file'); |
2646 | 2646 |
|
2647 | | -async function pump(iterator, writable) { |
2648 | | - for await (const chunk of iterator) { |
| 2647 | +async function pump(iterable, writable) { |
| 2648 | + for await (const chunk of iterable) { |
2649 | 2649 | // Handle backpressure on write(). |
2650 | 2650 | if (!writable.write(chunk)) { |
2651 | 2651 | if (writable.destroyed) return; |
@@ -2658,7 +2658,7 @@ async function pump(iterator, writable) { |
2658 | 2658 | (async function() { |
2659 | 2659 | // Ensure completion without errors. |
2660 | 2660 | await Promise.all([ |
2661 | | - pump(iterator, writable), |
| 2661 | + pump(iterable, writable), |
2662 | 2662 | finished(writable) |
2663 | 2663 | ]); |
2664 | 2664 | })(); |
@@ -2682,7 +2682,7 @@ const finished = util.promisify(stream.finished); |
2682 | 2682 | const writable = fs.createWriteStream('./file'); |
2683 | 2683 |
|
2684 | 2684 | (async function() { |
2685 | | - const readable = Readable.from(iterator); |
| 2685 | + const readable = Readable.from(iterable); |
2686 | 2686 | readable.pipe(writable); |
2687 | 2687 | // Ensure completion without errors. |
2688 | 2688 | await finished(writable); |
@@ -2697,7 +2697,7 @@ const pipeline = util.promisify(stream.pipeline); |
2697 | 2697 | const writable = fs.createWriteStream('./file'); |
2698 | 2698 |
|
2699 | 2699 | (async function() { |
2700 | | - const readable = Readable.from(iterator); |
| 2700 | + const readable = Readable.from(iterable); |
2701 | 2701 | await pipeline(readable, writable); |
2702 | 2702 | })(); |
2703 | 2703 | ``` |
|