@zip.js/zip.js 2.8.24 → 2.8.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs CHANGED
@@ -2794,7 +2794,7 @@ async function readUint8ArrayHttpReader(httpReader, index, length, sendRequest,
2794
2794
  if (eocdCache && index == size - END_OF_CENTRAL_DIR_LENGTH && length == END_OF_CENTRAL_DIR_LENGTH) {
2795
2795
  return eocdCache;
2796
2796
  }
2797
- if (index >= size) {
2797
+ if (index >= size || length === 0) {
2798
2798
  return new Uint8Array();
2799
2799
  } else {
2800
2800
  if (index + length > size) {
package/index.d.ts CHANGED
@@ -1657,7 +1657,7 @@ export interface EntryDataOnprogressOptions {
1657
1657
  * @param total The total number of bytes.
1658
1658
  * @returns An empty promise or `undefined`.
1659
1659
  */
1660
- onstart?(total: number): Promise<void> | undefined;
1660
+ onstart?(total: number): Promise<void> | void;
1661
1661
  /**
1662
1662
  * The function called during compression/decompression.
1663
1663
  *
@@ -1665,14 +1665,14 @@ export interface EntryDataOnprogressOptions {
1665
1665
  * @param total The total number of bytes.
1666
1666
  * @returns An empty promise or `undefined`.
1667
1667
  */
1668
- onprogress?(progress: number, total: number): Promise<void> | undefined;
1668
+ onprogress?(progress: number, total: number): Promise<void> | void;
1669
1669
  /**
1670
1670
  * The function called when ending compression/decompression.
1671
1671
  *
1672
1672
  * @param computedSize The total number of bytes (computed).
1673
1673
  * @returns An empty promise or `undefined`.
1674
1674
  */
1675
- onend?(computedSize: number): Promise<void> | undefined;
1675
+ onend?(computedSize: number): Promise<void> | void;
1676
1676
  }
1677
1677
 
1678
1678
  /**
@@ -1691,7 +1691,7 @@ export interface EntryOnprogressOptions {
1691
1691
  progress: number,
1692
1692
  total: number,
1693
1693
  entry: EntryMetaData
1694
- ): Promise<void> | undefined;
1694
+ ): Promise<void> | void;
1695
1695
  }
1696
1696
 
1697
1697
  /**