Skip to content

v2.8.37

Choose a tag to compare

@gildas-lormeau gildas-lormeau released this 10 Aug 21:01
· 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) and unregisterCodec(compressionMethod) APIs to plug custom compression methods into ZipWriter and ZipReader. A CodecDefinition associates a compression method ID and format name with CompressionStream/DecompressionStream classes, provided directly or lazy-loaded in workers via codecURI, with an optional versionNeeded. 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 ntfsTimestamp option (#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 explicit lastAccessDate/creationDate values. This saves 72 bytes per entry in the common case. Set it to true to always write the field (previous behavior) or false to never write it

Bug fixes

  • Compressing an empty file with a non-default level produced an invalid entry (compressedSize equal to 0) with the "native" variant using the JavaScript port of zlib (#667)
  • The maximum last modification date when extendedTimestamp is 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 usdz option now stores entries uncompressed by default (unless level or compressionMethod is set explicitly) and throws the new ERR_UNSUPPORTED_ENCRYPTION_USDZ error 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