v2.8.37
·
383 commits
to master
since this release
What's Changed in v2.8.37
This release adds support for third-party csutom compression codecs such as Zstandard, reduces the size of written zip files by storing the NTFS extra field only when necessary, and fixes several issues found by @danny0838.
New features
- New
registerCodec(definition)andunregisterCodec(compressionMethod)APIs to plug custom compression methods intoZipWriterandZipReader. ACodecDefinitionassociates a compression method ID and format name withCompressionStream/DecompressionStreamclasses, provided directly or lazy-loaded in workers viacodecURI, with an optionalversionNeeded. This enables reading and writing entries compressed with Zstandard (method 93), for example with the fzstd library. New errors:ERR_INVALID_CODEC_DEFINITION,ERR_RESERVED_COMPRESSION_METHOD,ERR_INVALID_CODEC_MODULE - New
ntfsTimestampoption (#666): the NTFS extra field is now written only when it preserves information the extended timestamp extra field cannot represent, i.e. a last modification date outside its supported range or explicitlastAccessDate/creationDatevalues. This saves 72 bytes per entry in the common case. Set it totrueto always write the field (previous behavior) orfalseto never write it
Bug fixes
- Compressing an empty file with a non-default
levelproduced an invalid entry (compressedSizeequal to 0) with the "native" variant using the JavaScript port of zlib (#667) - The maximum last modification date when
extendedTimestampis disabled is now clamped to 2107-12-31 23:59:58 instead of 2107-12-31 00:00:00, and the documentation no longer mentions the nonexistent date "November 31, 2107" (#665) - Entries with a malformed AES encryption strength (outside 1–3) are now rejected when reading instead of only when the strength is missing
- Trailing junk after the compressed data is now ignored when decompressing with the JavaScript port of zlib, consistently with the native implementations
Behavior changes
- The
usdzoption now stores entries uncompressed by default (unlesslevelorcompressionMethodis set explicitly) and throws the newERR_UNSUPPORTED_ENCRYPTION_USDZerror when a password is set, in accordance with the USDZ specification which mandates zero compression and no encryption
Full Changelog: v2.8.36...v2.8.37