Closed ethanshry closed 1 year ago
Decompress
is synchronous and accepts a FlateStreamHandler
, see these docs. Errors are thrown by push
and not sent to the callback at all. AsyncDecompress
is a different class entirely that does have the expected arguments.
@101arrowz It makes sense to me that Decompress
should use FlateStreamHandler
, while AsyncDecompress
would use AsyncFlateStreamHandler
, however I think those docs back up what I am seeing locally- the Decompress
constructor accepts an AsyncFlateStreamHandler
as the argument.
Maybe I am confused on the expected usage?
Ah I screwed up the types in the constructor. Will fix. Just use .ondata
for now.
Fixed and will release in v0.8.1.
v0.8.1 should be out, let me know if there are any more issues!
How to reproduce Install the library:
Run the following code:
Declared type for the AsyncDecompress handler is:
Expected log output:
null Uint8Array(14)... false
Recieved log output:Uint8Array(14)... false undefined
The problem
As per the documentation, I would expect arguments to be in the order
err, chunk, final
, however it looks like arguments are insteadchunk, final, err
.