@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-native.cjs CHANGED
@@ -5238,6 +5238,9 @@ function getHeaderInfo(options) {
5238
5238
  setUint32(rawExtraFieldZip64View, rawExtraFieldZip64Offset, diskNumberStart);
5239
5239
  rawExtraFieldZip64Offset += 4;
5240
5240
  }
5241
+ if (rawLocalExtraFieldZip64Offset == 4) {
5242
+ rawLocalExtraFieldZip64 = new Uint8Array();
5243
+ }
5241
5244
  }
5242
5245
  } else {
5243
5246
  rawExtraFieldZip64 = new Uint8Array();
@@ -5549,22 +5552,22 @@ function updateLocalHeader({
5549
5552
  if (!encrypted) {
5550
5553
  setUint32(localHeaderView, HEADER_OFFSET_SIGNATURE + 4, signature);
5551
5554
  }
5552
- if (!zip64) {
5555
+ if (!zip64CompressedSize) {
5553
5556
  setUint32(localHeaderView, HEADER_OFFSET_COMPRESSED_SIZE + 4, compressedSize);
5557
+ }
5558
+ if (!zip64UncompressedSize) {
5554
5559
  setUint32(localHeaderView, HEADER_OFFSET_UNCOMPRESSED_SIZE + 4, uncompressedSize);
5555
5560
  }
5556
5561
  }
5557
- if (zip64) {
5558
- if (localExtraFieldZip64Length) {
5559
- let localHeaderOffset = HEADER_SIZE + getLength(rawFilename) + 4;
5560
- if (zip64UncompressedSize) {
5561
- setBigUint64(localHeaderView, localHeaderOffset, BigInt(uncompressedSize));
5562
- localHeaderOffset += 8;
5563
- }
5564
- if (zip64CompressedSize) {
5565
- setBigUint64(localHeaderView, localHeaderOffset, BigInt(compressedSize));
5566
- localHeaderOffset += 8;
5567
- }
5562
+ if (zip64 && 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;
5568
5571
  }
5569
5572
  }
5570
5573
  }