@zip.js/zip.js 2.8.13 → 2.8.14

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
  }