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

Typing error on 2.6.84 #408

Closed EdoardoTona closed 1 year ago

EdoardoTona commented 1 year ago

With the version 2.6.84 I get this error:

Error: node_modules/@zip.js/zip.js/index.d.ts:873:18 - error TS2430: Interface 'Entry' incorrectly extends interface 'EntryMetaData'.
  The types returned by 'getData(...)' are incompatible between these types.
    Type 'Promise<Type | undefined>' is not assignable to type 'Promise<Type>'.
      Type 'Type | undefined' is not assignable to type 'Type'.
        'Type' could be instantiated with an arbitrary type which could be unrelated to 'Type | undefined'.

873 export interface Entry extends EntryMetaData {
                     ~~~~~

moreover I get other errors in my code because the Entry.getData() returns Blob | undefined instead of Blob as before (maybe this is the expected behaviour but it's a breaking change for a minor update)

gildas-lormeau commented 1 year ago

Thank you, I just published the version 2.7.0 which should fix this issue. I did not considered it previously as a breaking change because the library is written in JS.

gildas-lormeau commented 1 year ago

The version 2.7.1 fixes the breaking change.