-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Closed
Labels
streamIssues and PRs related to the stream subsystem.Issues and PRs related to the stream subsystem.
Description
Looking at https://github.com/nodejs/node/blob/master/lib/internal/streams/end-of-stream.js#L31
It looks like "eos" uses the writable and readable properties to detect whether a stream is Readablelike or Writablelike. However, according my current incomplete understanding of these properties (#29377), they cannot/should not be used for this purpose, i.e. a Readable stream could in theory have a readable = false which later becomes a readable = true.
Should we maybe change these lines to something like e.g:
const isReadable = (
typeof stream.readable === 'boolean' ||
stream._readableState ||
typeof stream.readableEnded === 'boolean'
);
let readable = opts.readable || (opts.readable !== false && isReadable);Metadata
Metadata
Assignees
Labels
streamIssues and PRs related to the stream subsystem.Issues and PRs related to the stream subsystem.