Skip to content

Commit ee8f1bc

Browse files
mandel59targos
authored andcommitted
doc: fix about decodeStrings property of stream.Writable
This fixes negation ommitted in a former commit. It also simplifies the text in general. PR-URL: #19752 Refs: 80ea0c5 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
1 parent 41c8ab9 commit ee8f1bc

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

doc/api/stream.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1437,13 +1437,12 @@ buffered. When the `callback` is invoked, the stream might emit a [`'drain'`][]
14371437
event. If a stream implementation is capable of processing multiple chunks of
14381438
data at once, the `writable._writev()` method should be implemented.
14391439

1440-
If the `decodeStrings` property is set in the constructor options, then
1441-
`chunk` may be a string rather than a Buffer, and `encoding` will
1442-
indicate the character encoding of the string. This is to support
1443-
implementations that have an optimized handling for certain string
1444-
data encodings. If the `decodeStrings` property is explicitly set to `false`,
1445-
the `encoding` argument can be safely ignored, and `chunk` will remain the same
1446-
object that is passed to `.write()`.
1440+
If the `decodeStrings` property is explicitly set to `false` in the constructor
1441+
options, then `chunk` will remain the same object that is passed to `.write()`,
1442+
and may be a string rather than a `Buffer`. This is to support implementations
1443+
that have an optimized handling for certain string data encodings. In that case,
1444+
the `encoding` argument will indicate the character encoding of the string.
1445+
Otherwise, the `encoding` argument can be safely ignored.
14471446

14481447
The `writable._write()` method is prefixed with an underscore because it is
14491448
internal to the class that defines it, and should never be called directly by

0 commit comments

Comments
 (0)