Skip to content
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

Closed
wants to merge 3 commits into from

Conversation

EduardoRFS
Copy link
Contributor

@EduardoRFS EduardoRFS commented Aug 3, 2019

As readable.unshift() share implementation with readable.push() it makes sense to make the doc similar.

Checklist

@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. stream Issues and PRs related to the stream subsystem. labels Aug 3, 2019
doc/api/stream.md Outdated Show resolved Hide resolved
readable.unshift() also allows to pass null and end stream

readable.push() don't allow null when in object mode
@EduardoRFS EduardoRFS changed the title doc: unshift doc when chunk is null doc: make unshift doc compliant with push doc Aug 4, 2019
@EduardoRFS
Copy link
Contributor Author

Updated <3

doc/api/stream.md Outdated Show resolved Hide resolved
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.
Copy link
Member

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).

@Trott
Copy link
Member

Trott commented Aug 6, 2019

/ping @nodejs/streams

@Trott
Copy link
Member

Trott commented Aug 6, 2019

I made the changes (line-wrap and more null clarification) and pushed up to the branch. I kept my changes in a separate fixup commit so they can be removed easily. @mscdex LGTY?

@Trott
Copy link
Member

Trott commented Aug 6, 2019

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Trott
Copy link
Member

Trott commented Aug 7, 2019

Landed in 84a6384.

Thanks for the contribution! 🎉

@Trott Trott closed this Aug 7, 2019
Trott pushed a commit to Trott/io.js that referenced this pull request Aug 7, 2019
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]>
targos pushed a commit that referenced this pull request Aug 19, 2019
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations. stream Issues and PRs related to the stream subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants