-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
Reword stream docs to clarify that decodeStrings encodes strings #25468
Conversation
I was implementing a Writable stream and misunderstood `decodeStrings` to mean 'will decode `Buffer`s into `string`s before calling `_write`'. This change adds a little more detail to the description of `decodeStrings` to clarify its effect on a Writable stream & what gets passed to `_write`. Changing the name of the option to `encodeStrings` would make it much easier to understand, but the name was chosen in 2012 and the option used in many projects (22k mentions of 'decodeStringsr in JS projects in GitHub). Deprecating the old name & rolling out a replacement is beyond my capabilities as a first-time contributor. Fixes: nodejs#25464
1dcd23f
to
2aaa4d2
Compare
whoops, missed the bit in the contribution guide about prefixing the commit message with the subsystem |
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.
Thank you!
doc/api/stream.md
Outdated
* `chunk` {Buffer|string|any} The `Buffer` to be written, converted from the | ||
`string` passed to [`stream.write()`][stream-write]. If the stream's | ||
`decodeStrings` option is `false` or the stream is operating in object mode, | ||
chunk will not be converted & will be whatever was passed to |
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.
chunk will not be converted & will be whatever was passed to | |
the chunk will not be converted & will be whatever was passed to |
doc/api/stream.md
Outdated
* `chunk` {Buffer|string|any} The `Buffer` to be transformed, converted from | ||
the `string` passed to [`stream.write()`][stream-write]. If the stream's | ||
`decodeStrings` option is `false` or the stream is operating in object mode, | ||
chunk will not be converted & will be whatever was passed to |
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.
chunk will not be converted & will be whatever was passed to | |
the chunk will not be converted & will be whatever was passed to |
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.
thanks, makes sense
I was implementing a Writable stream and misunderstood `decodeStrings` to mean 'will decode `Buffer`s into `string`s before calling `_write`'. This change adds a little more detail to the description of `decodeStrings` to clarify its effect on a Writable stream & what gets passed to `_write`. Changing the name of the option to `encodeStrings` would make it much easier to understand, but the name was chosen in 2012 and the option used in many projects (22k mentions of 'decodeStringsr in JS projects in GitHub). Deprecating the old name & rolling out a replacement is beyond my capabilities as a first-time contributor. PR-URL: nodejs#25468 Fixes: nodejs#25464 Reviewed-By: Anna Henningsen <anna@addaleax.net>
Landed in fac11b0 |
I was implementing a Writable stream and misunderstood `decodeStrings` to mean 'will decode `Buffer`s into `string`s before calling `_write`'. This change adds a little more detail to the description of `decodeStrings` to clarify its effect on a Writable stream & what gets passed to `_write`. Changing the name of the option to `encodeStrings` would make it much easier to understand, but the name was chosen in 2012 and the option used in many projects (22k mentions of 'decodeStringsr in JS projects in GitHub). Deprecating the old name & rolling out a replacement is beyond my capabilities as a first-time contributor. PR-URL: #25468 Fixes: #25464 Reviewed-By: Anna Henningsen <anna@addaleax.net>
I was implementing a Writable stream and misunderstood `decodeStrings` to mean 'will decode `Buffer`s into `string`s before calling `_write`'. This change adds a little more detail to the description of `decodeStrings` to clarify its effect on a Writable stream & what gets passed to `_write`. Changing the name of the option to `encodeStrings` would make it much easier to understand, but the name was chosen in 2012 and the option used in many projects (22k mentions of 'decodeStringsr in JS projects in GitHub). Deprecating the old name & rolling out a replacement is beyond my capabilities as a first-time contributor. PR-URL: #25468 Fixes: #25464 Reviewed-By: Anna Henningsen <anna@addaleax.net>
I was implementing a Writable stream and misunderstood `decodeStrings` to mean 'will decode `Buffer`s into `string`s before calling `_write`'. This change adds a little more detail to the description of `decodeStrings` to clarify its effect on a Writable stream & what gets passed to `_write`. Changing the name of the option to `encodeStrings` would make it much easier to understand, but the name was chosen in 2012 and the option used in many projects (22k mentions of 'decodeStringsr in JS projects in GitHub). Deprecating the old name & rolling out a replacement is beyond my capabilities as a first-time contributor. PR-URL: #25468 Fixes: #25464 Reviewed-By: Anna Henningsen <anna@addaleax.net>
I was implementing a Writable stream and misunderstood `decodeStrings` to mean 'will decode `Buffer`s into `string`s before calling `_write`'. This change adds a little more detail to the description of `decodeStrings` to clarify its effect on a Writable stream & what gets passed to `_write`. Changing the name of the option to `encodeStrings` would make it much easier to understand, but the name was chosen in 2012 and the option used in many projects (22k mentions of 'decodeStringsr in JS projects in GitHub). Deprecating the old name & rolling out a replacement is beyond my capabilities as a first-time contributor. PR-URL: #25468 Fixes: #25464 Reviewed-By: Anna Henningsen <anna@addaleax.net>
I was implementing a Writable stream and misunderstood
decodeStrings
to mean 'will decode
Buffer
s intostring
s before calling_write
'.This change adds a little more detail to the description of
decodeStrings
to clarify its effect on a Writable stream & what getspassed to
_write
.Changing the name of the option to
encodeStrings
would make it mucheasier to understand, but the name was chosen in 2012 and the option
used in many projects (22k mentions of 'decodeStringsr in JS projects in
GitHub). Deprecating the old name & rolling out a replacement is beyond
my capabilities as a first-time contributor.
Fixes: #25464
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes