Skip to content

Commit

Permalink
stream: change comment on duplex stream options
Browse files Browse the repository at this point in the history
'options.XXX' did not convey to me how to use camelCase for different
readable and writable options on a duplex stream. Give an example
instead.

PR-URL: #24247
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
jeswcollins authored and rvagg committed Nov 28, 2018
1 parent 415340f commit 01e8a3a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/_stream_writable.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ function WritableState(options, stream, isDuplex) {
// Duplex streams are both readable and writable, but share
// the same options object.
// However, some cases require setting options to different
// values for the readable and the writable sides of the duplex stream.
// These options can be provided separately as readableXXX and writableXXX.
// values for the readable and the writable sides of the duplex stream,
// e.g. options.readableObjectMode vs. options.writableObjectMode, etc.
if (typeof isDuplex !== 'boolean')
isDuplex = stream instanceof Stream.Duplex;

Expand Down

0 comments on commit 01e8a3a

Please sign in to comment.