@zip.js/zip.js 2.8.13 → 2.8.15

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
@@ -5242,6 +5242,9 @@ function getHeaderInfo(options) {
5242
5242
  setUint32(rawExtraFieldZip64View, rawExtraFieldZip64Offset, diskNumberStart);
5243
5243
  rawExtraFieldZip64Offset += 4;
5244
5244
  }
5245
+ if (rawLocalExtraFieldZip64Offset == 4) {
5246
+ rawLocalExtraFieldZip64 = new Uint8Array();
5247
+ }
5245
5248
  }
5246
5249
  } else {
5247
5250
  rawExtraFieldZip64 = new Uint8Array();
@@ -5553,22 +5556,22 @@ function updateLocalHeader({
5553
5556
  if (!encrypted) {
5554
5557
  setUint32(localHeaderView, HEADER_OFFSET_SIGNATURE + 4, signature);
5555
5558
  }
5556
- if (!zip64) {
5559
+ if (!zip64CompressedSize) {
5557
5560
  setUint32(localHeaderView, HEADER_OFFSET_COMPRESSED_SIZE + 4, compressedSize);
5561
+ }
5562
+ if (!zip64UncompressedSize) {
5558
5563
  setUint32(localHeaderView, HEADER_OFFSET_UNCOMPRESSED_SIZE + 4, uncompressedSize);
5559
5564
  }
5560
5565
  }
5561
- if (zip64) {
5562
- if (localExtraFieldZip64Length) {
5563
- let localHeaderOffset = HEADER_SIZE + getLength(rawFilename) + 4;
5564
- if (zip64UncompressedSize) {
5565
- setBigUint64(localHeaderView, localHeaderOffset, BigInt(uncompressedSize));
5566
- localHeaderOffset += 8;
5567
- }
5568
- if (zip64CompressedSize) {
5569
- setBigUint64(localHeaderView, localHeaderOffset, BigInt(compressedSize));
5570
- localHeaderOffset += 8;
5571
- }
5566
+ if (zip64 && localExtraFieldZip64Length) {
5567
+ let localHeaderOffset = HEADER_SIZE + getLength(rawFilename) + 4;
5568
+ if (zip64UncompressedSize) {
5569
+ setBigUint64(localHeaderView, localHeaderOffset, BigInt(uncompressedSize));
5570
+ localHeaderOffset += 8;
5571
+ }
5572
+ if (zip64CompressedSize) {
5573
+ setBigUint64(localHeaderView, localHeaderOffset, BigInt(compressedSize));
5574
+ localHeaderOffset += 8;
5572
5575
  }
5573
5576
  }
5574
5577
  }
package/index.d.ts CHANGED
@@ -1331,8 +1331,8 @@ export class ZipWriter<Type> {
1331
1331
  ): Promise<EntryMetaData>;
1332
1332
 
1333
1333
  /**
1334
- * Removes an entry from the zip file. Note that the entry is not removed from the zip file, but it
1335
- * is not written to the entries directory.
1334
+ * Removes an entry from the central directory that will be written for the zip file. The entry
1335
+ * data itself cannot be removed because it has already been streamed to the output.
1336
1336
  *
1337
1337
  * @param entry The entry to remove. This can be an {@link Entry} instance or the filename of the entry.
1338
1338
  * @returns `true` if the entry has been removed, `false` otherwise.
@@ -1529,9 +1529,9 @@ export interface ZipWriterConstructorOptions extends WorkerConfiguration {
1529
1529
  /**
1530
1530
  * `true` to add a data descriptor.
1531
1531
  *
1532
- * When set to `false`, the {@link ZipWriterConstructorOptions#bufferedWrite} option will automatically be
1532
+ * When set to `false`, the {@link ZipWriterConstructorOptions#bufferedWrite} option will automatically be
1533
1533
  * set to `true`. It will be automatically set to `false` when it is `undefined` and the
1534
- * {@link ZipWriterConstructorOptions#bufferedWrite} option is set to `true`, or ` when the
1534
+ * {@link ZipWriterConstructorOptions#bufferedWrite} option is set to `true`, or when the
1535
1535
  * {@link ZipWriterConstructorOptions#zipCrypto} option is set to `true`. Otherwise, the default value is `true`.
1536
1536
  */
1537
1537
  dataDescriptor?: boolean;