@@ -2639,8 +2639,8 @@ const finished = util.promisify(stream.finished);
2639
2639
2640
2640
const writable = fs .createWriteStream (' ./file' );
2641
2641
2642
- async function pump (iterator , writable ) {
2643
- for await (const chunk of iterator ) {
2642
+ async function pump (iterable , writable ) {
2643
+ for await (const chunk of iterable ) {
2644
2644
// Handle backpressure on write().
2645
2645
if (! writable .write (chunk)) {
2646
2646
if (writable .destroyed ) return ;
@@ -2653,7 +2653,7 @@ async function pump(iterator, writable) {
2653
2653
(async function () {
2654
2654
// Ensure completion without errors.
2655
2655
await Promise .all ([
2656
- pump (iterator , writable),
2656
+ pump (iterable , writable),
2657
2657
finished (writable)
2658
2658
]);
2659
2659
})();
@@ -2677,7 +2677,7 @@ const finished = util.promisify(stream.finished);
2677
2677
const writable = fs .createWriteStream (' ./file' );
2678
2678
2679
2679
(async function () {
2680
- const readable = Readable .from (iterator );
2680
+ const readable = Readable .from (iterable );
2681
2681
readable .pipe (writable);
2682
2682
// Ensure completion without errors.
2683
2683
await finished (writable);
@@ -2692,7 +2692,7 @@ const pipeline = util.promisify(stream.pipeline);
2692
2692
const writable = fs .createWriteStream (' ./file' );
2693
2693
2694
2694
(async function () {
2695
- const readable = Readable .from (iterator );
2695
+ const readable = Readable .from (iterable );
2696
2696
await pipeline (readable, writable);
2697
2697
})();
2698
2698
```
0 commit comments