What's Changed in v2.25.1
Bug fixes
- A generator of disks passed to
SplitDataWriter, theZipWriterconstructor,getData()orexportZip()can now yield a bareWritableStream, as declared, instead of failing with "Cannot read properties of undefined (reading 'getWriter')"; a disk given as an object exposing awritableproperty keeps working
Type declarations
- A synchronous generator, and an asynchronous generator ending without a value, now type-check as the disks of a split zip file passed to
SplitDataWriter, theZipWriterconstructor,FileEntry#getData(),ZipFileEntry#getData()andexportZip(). Both already worked at runtime. PreviouslySplitDataWriter,ZipWriterandFileEntry#getData()required an asynchronous generator returning aboolean, so the plainasync function* () { yield writer; }did not type-check, andZipFileEntry#getData()andexportZip()rejected synchronous generators. The newSplitDataWriterGeneratortype declares these generators. The value a generator returns when it completes, if any, is the writer of the last disk - A generator returning a
boolean, as the previous declaration required, no longer type-checks. Returningtruemade the write fail once the generator ran out of disks, with "Cannot create property 'size' on boolean 'true'" in 2.25.0 and "Invalid writer (size must be writable)" now. End the generator without a value, or with the writer of the last disk - The
commentoption ofexportBlob(),exportData64URI(),exportUint8Array(),exportWritable(),exportZip()andgetExportedSize(), onZipDirectoryEntryandZipFS, is now declared. It already worked at runtime. It sets the comment of the exported entries, replacing the comment of the entries imported from a zip file, while an entry added with acommentoption of its own keeps that comment. The comment of the zip file itself is still theglobalCommentoption ZipFileEntry#writeris deprecated: zip.js never sets it, so its value is alwaysundefined
Documentation
WritableWriter#maxSizeandSplitDataWriter#maxSize: the limit set by a disk also applies to the following disks until one sets another limit. A disk withoutmaxSizekeeps the limit of the previous disk, not themaxSizepassed to theSplitDataWriterconstructor- The "Reading untrusted zip files" section moved to the end of the README, after "Tests"
Contributing
- New
REVIEW.mdchecklist in the repository: the generated files to rebuild and commit, the worker message property names, the test registration, the rules of the library code and the code style
Full Changelog: v2.25.0...v2.25.1
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com