@@ -2644,8 +2644,8 @@ const finished = util.promisify(stream.finished);
26442644
26452645const writable = fs .createWriteStream (' ./file' );
26462646
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 ) {
26492649 // Handle backpressure on write().
26502650 if (! writable .write (chunk)) {
26512651 if (writable .destroyed ) return ;
@@ -2658,7 +2658,7 @@ async function pump(iterator, writable) {
26582658(async function () {
26592659 // Ensure completion without errors.
26602660 await Promise .all ([
2661- pump (iterator , writable),
2661+ pump (iterable , writable),
26622662 finished (writable)
26632663 ]);
26642664})();
@@ -2682,7 +2682,7 @@ const finished = util.promisify(stream.finished);
26822682const writable = fs .createWriteStream (' ./file' );
26832683
26842684(async function () {
2685- const readable = Readable .from (iterator );
2685+ const readable = Readable .from (iterable );
26862686 readable .pipe (writable);
26872687 // Ensure completion without errors.
26882688 await finished (writable);
@@ -2697,7 +2697,7 @@ const pipeline = util.promisify(stream.pipeline);
26972697const writable = fs .createWriteStream (' ./file' );
26982698
26992699(async function () {
2700- const readable = Readable .from (iterator );
2700+ const readable = Readable .from (iterable );
27012701 await pipeline (readable, writable);
27022702})();
27032703```
0 commit comments