Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixup! stream: add a non-destroying iterator to Readable
  • Loading branch information
Linkgoron committed May 4, 2021
commit 87f53168582bf4d3f7e4279d8aaede47737fce68
2 changes: 1 addition & 1 deletion doc/api/stream.md
Original file line number Diff line number Diff line change
Expand Up @@ -1547,7 +1547,7 @@ async function printIterator(readable) {
console.log(chunk); // Will print 2 and then 3
}

console.log(readable.destroyed); // true, stream was totally consumed
console.log(readable.destroyed); // True, stream was totally consumed
}

async function printSymbolAsyncIterator(readable) {
Expand Down
2 changes: 1 addition & 1 deletion lib/internal/streams/readable.js
Original file line number Diff line number Diff line change
Expand Up @@ -1065,7 +1065,7 @@ Readable.prototype[SymbolAsyncIterator] = function() {
return streamToAsyncIterator(this);
};

Readable.prototype.iterator = function (options = {
Readable.prototype.iterator = function(options = {
destroyOnReturn: true,
destroyOnError: true,
}) {
Comment thread
Linkgoron marked this conversation as resolved.
Outdated
Expand Down