@@ -2647,8 +2647,8 @@ const finished = util.promisify(stream.finished);
26472647
26482648const writable = fs .createWriteStream (' ./file' );
26492649
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 ) {
26522652 // Handle backpressure on write().
26532653 if (! writable .write (chunk)) {
26542654 if (writable .destroyed ) return ;
@@ -2661,7 +2661,7 @@ async function pump(iterator, writable) {
26612661(async function () {
26622662 // Ensure completion without errors.
26632663 await Promise .all ([
2664- pump (iterator , writable),
2664+ pump (iterable , writable),
26652665 finished (writable)
26662666 ]);
26672667})();
@@ -2685,7 +2685,7 @@ const finished = util.promisify(stream.finished);
26852685const writable = fs .createWriteStream (' ./file' );
26862686
26872687(async function () {
2688- const readable = Readable .from (iterator );
2688+ const readable = Readable .from (iterable );
26892689 readable .pipe (writable);
26902690 // Ensure completion without errors.
26912691 await finished (writable);
@@ -2700,7 +2700,7 @@ const pipeline = util.promisify(stream.pipeline);
27002700const writable = fs .createWriteStream (' ./file' );
27012701
27022702(async function () {
2703- const readable = Readable .from (iterator );
2703+ const readable = Readable .from (iterable );
27042704 await pipeline (readable, writable);
27052705})();
27062706```
0 commit comments