Skip to content

Commit 8788046

Browse files
mandel59BridgeAR
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 <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent 7bc5151 commit 8788046

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
@@ -1520,13 +1520,12 @@ buffered. When the `callback` is invoked, the stream might emit a [`'drain'`][]
15201520
event. If a stream implementation is capable of processing multiple chunks of
15211521
data at once, the `writable._writev()` method should be implemented.
15221522

1523-
If the `decodeStrings` property is set in the constructor options, then
1524-
`chunk` may be a string rather than a Buffer, and `encoding` will
1525-
indicate the character encoding of the string. This is to support
1526-
implementations that have an optimized handling for certain string
1527-
data encodings. If the `decodeStrings` property is explicitly set to `false`,
1528-
the `encoding` argument can be safely ignored, and `chunk` will remain the same
1529-
object that is passed to `.write()`.
1523+
If the `decodeStrings` property is explicitly set to `false` in the constructor
1524+
options, then `chunk` will remain the same object that is passed to `.write()`,
1525+
and may be a string rather than a `Buffer`. This is to support implementations
1526+
that have an optimized handling for certain string data encodings. In that case,
1527+
the `encoding` argument will indicate the character encoding of the string.
1528+
Otherwise, the `encoding` argument can be safely ignored.
15301529

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

0 commit comments

Comments
 (0)