-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc: make unshift doc compliant with push doc #28953
Conversation
readable.unshift() also allows to pass null and end stream readable.push() don't allow null when in object mode
Updated <3 |
Co-Authored-By: mscdex <[email protected]>
doc/api/stream.md
Outdated
read queue. For streams not operating in object mode, `chunk` must be a | ||
string, `Buffer` or `Uint8Array`. For object mode streams, `chunk` may be | ||
any JavaScript value other than `null`. | ||
* `encoding` {string} Encoding of string chunks. Must be a valid | ||
`Buffer` encoding, such as `'utf8'` or `'ascii'`. | ||
|
||
Passing `chunk` as `null` signals the end of the stream (EOF), after which no more data can be written. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will (I hope) cause the linter to fail because it is longer than 80 characters. Word wrap at 80 chars? To run the markdown linter, you can run make lint-md
(or, if on Windows, vcbuild lint-md
).
/ping @nodejs/streams |
I made the changes (line-wrap and more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Landed in 84a6384. Thanks for the contribution! 🎉 |
readable.unshift() also allows to pass null and end stream PR-URL: nodejs#28953 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
readable.unshift() also allows to pass null and end stream PR-URL: #28953 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
As
readable.unshift()
share implementation withreadable.push()
it makes sense to make the doc similar.Checklist