Closed nadhifikbarw closed 1 year ago
It would be best if you ignored everything inside the process.env.READABLE_STREAM === 'disable'
block when preparing the types.
isDisturbed
is correctly exposed as require('readable-stream').isDisturbed()
because require('readable-stream')
exposes Readable
and not Stream
as its entry point (mostly for historical reasons).
Thanks! appreciate the additional context, will close the discussion.
Hi, I'm curious about potentially deeper technical context or historical reasoning behind why
isDisturbed
is exported from top level on condition whereStream
built-in lib is present. When as of 16-x docs it has always been exposed as static insideReadable
class?https://github.com/nodejs/readable-stream/blob/232e71154dbdc34f6a97a0449f902455ec495373/src/index.js#L3-L13
My use case right now only to update
d.ts file
forreadable-stream 4.x.x
that will mostly rely on just re-exporting existing type fromstream.d.ts
and I haven't checked built-in implementation that might exposedisDistrubed
on top-level but undocumented.Since v16.8.0 is the first Node version where that feature is released according to official docs, wouldn't that mean
Stream.isDisturbed
is still missing from Node 12-15 versions which are the support range for 4.x ?Unless I'm oblivious on some part of the build process that might goes on that influence the end code produced for this library or I completely misunderstood module resolution on line 3 of
require('stream')
where it doesn't actually load from built-in module implementation. Would love to know the details so I can accurately reflect the code on the Typescript ambient module definition!