Skip to content

Releases: httptoolkit/brotli-wasm

v2.0.0

12 Jul 16:25
e1a6e5a
Compare
Choose a tag to compare

Breaking changes

Streams API has changed significantly, streams no longer expose result() or last_input_offset() methods, and the compress() and decompress() methods return a result object, not just a buffer. Instead of querying state from the stream itself, you can now access it from the result, which exposes 3 properties:

  • buf - the output (the compressed/decompressed data.
  • code - the result code, corresponding to a value from brotli.BrotliStreamResultCode.
  • input_offset - the offset into the input stream that was read during this operation.

This resolves many issues with streams that could result in data corruption and processing failures. See the README for an updated example of how to use this with web streams.

The non-streaming API remains unchanged.