Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a big one, please read carefully before upgrading from
prior versions, especially if you extend Minipass in a subclass.
Breaking Changes
types changed in subtle ways, and several behaviors got
stricter.
EventEmitter
rather thanStream
.Nothing from the
Stream
class was ever used by Minipass, butit inherited from
Stream
to pass checks in some streamlibraries that checked
instanceof Stream
. Unfortunately, thetype difference in the
pipe()
method signature made itchallenging to continue doing in TypeScript.
after a Minipass stream is instantiated, as this would thwart
TypeScript's static checks. As a consequence:
setEncoding
method and theencoding
setter aredeprecated. Encoding may only be set in the constructor
options object.
objectMode
is no longer inferred by writing something otherthan a string or Buffer. It may only be set in the
constructor options object.
stream.unpipe(dest)
,stream.removeListener('data', handler)
,stream.removeAllListeners('data')
, and/orstream.removeAllListeners()
, then the data will stop flowing.Note that it is still possible to explicitly discard a stream's
data by calling
stream.resume()
in the absence of anyconsumers.
Features and Fixes
Minipass streams slower in some cases than node core streams.
Minipass is now faster than node core streams for all data
types.
stream.collect()
for objectMode streamswill have a
dataLength
property equal to 0, rather thanundefined.
isStream
is moved from a static member on the Minipass classto a named export.
isWritable()
andisReadable()
methods added.