gildas-lormeau / zip.js

JavaScript library to zip and unzip files supporting multi-core compression, compression streams, zip64, split files and encryption.
https://gildas-lormeau.github.io/zip.js
BSD 3-Clause "New" or "Revised" License
3.38k stars 510 forks source link

When is `Entry.getData()` null? #371

Closed AlexErrant closed 1 year ago

AlexErrant commented 1 year ago

Hi, thanks for such a well written and maintained library!

When I look at the d.ts for Entry.getData(), it says getData?, which indicates that the function may or may not be there. Link. I believe this is where getData is defined. In what scenario would this function not be there?

Thanks!

0f-0b commented 1 year ago

Entry.getData is actually defined here, and is only present in entries returned by ZipReader.getEntries or ZipReader.getEntriesGenerator. It does not exist in entries returned by ZipWriter.add or passed to the onprogress callback.