@zip.js/zip.js 2.8.11 → 2.8.13

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/dist/zip.js CHANGED
@@ -5195,15 +5195,19 @@
5195
5195
  let { version, compressionMethod } = options;
5196
5196
  const compressed = !directory && (level > 0 || (level === UNDEFINED_VALUE && compressionMethod !== 0));
5197
5197
  let rawExtraFieldZip64;
5198
+ let rawLocalExtraFieldZip64;
5198
5199
  const uncompressedFile = passThrough || !compressed;
5199
5200
  const zip64ExtraFieldComplete = zip64 && (options.bufferedWrite || ((!zip64UncompressedSize && !zip64CompressedSize) || uncompressedFile));
5200
5201
  if (zip64) {
5201
5202
  let rawExtraFieldZip64Length = 4;
5203
+ let rawLocalExtraFieldZip64Length = 4;
5202
5204
  if (zip64UncompressedSize) {
5203
5205
  rawExtraFieldZip64Length += 8;
5206
+ rawLocalExtraFieldZip64Length += 8;
5204
5207
  }
5205
5208
  if (zip64CompressedSize) {
5206
5209
  rawExtraFieldZip64Length += 8;
5210
+ rawLocalExtraFieldZip64Length += 8;
5207
5211
  }
5208
5212
  if (zip64Offset) {
5209
5213
  rawExtraFieldZip64Length += 8;
@@ -5213,18 +5217,28 @@
5213
5217
  }
5214
5218
  rawExtraFieldZip64 = new Uint8Array(rawExtraFieldZip64Length);
5215
5219
  const rawExtraFieldZip64View = getDataView(rawExtraFieldZip64);
5220
+ rawLocalExtraFieldZip64 = new Uint8Array(rawLocalExtraFieldZip64Length);
5221
+ const rawLocalExtraFieldZip64View = getDataView(rawLocalExtraFieldZip64);
5216
5222
  setUint16(rawExtraFieldZip64View, 0, EXTRAFIELD_TYPE_ZIP64);
5217
5223
  setUint16(rawExtraFieldZip64View, 2, getLength(rawExtraFieldZip64) - 4);
5224
+ setUint16(rawLocalExtraFieldZip64View, 0, EXTRAFIELD_TYPE_ZIP64);
5225
+ setUint16(rawLocalExtraFieldZip64View, 2, getLength(rawLocalExtraFieldZip64) - 4);
5218
5226
  if (zip64ExtraFieldComplete) {
5219
5227
  const rawExtraFieldZip64View = getDataView(rawExtraFieldZip64);
5228
+ const rawLocalExtraFieldZip64View = getDataView(rawLocalExtraFieldZip64);
5220
5229
  let rawExtraFieldZip64Offset = 4;
5230
+ let rawLocalExtraFieldZip64Offset = 4;
5221
5231
  if (zip64UncompressedSize) {
5222
5232
  setBigUint64(rawExtraFieldZip64View, rawExtraFieldZip64Offset, BigInt(uncompressedSize));
5223
5233
  rawExtraFieldZip64Offset += 8;
5234
+ setBigUint64(rawLocalExtraFieldZip64View, rawLocalExtraFieldZip64Offset, BigInt(uncompressedSize));
5235
+ rawLocalExtraFieldZip64Offset += 8;
5224
5236
  }
5225
5237
  if (zip64CompressedSize && uncompressedFile) {
5226
5238
  setBigUint64(rawExtraFieldZip64View, rawExtraFieldZip64Offset, BigInt(uncompressedSize));
5227
5239
  rawExtraFieldZip64Offset += 8;
5240
+ setBigUint64(rawLocalExtraFieldZip64View, rawLocalExtraFieldZip64Offset, BigInt(uncompressedSize));
5241
+ rawLocalExtraFieldZip64Offset += 8;
5228
5242
  }
5229
5243
  if (zip64Offset) {
5230
5244
  setBigUint64(rawExtraFieldZip64View, rawExtraFieldZip64Offset, BigInt(offset));
@@ -5237,6 +5251,7 @@
5237
5251
  }
5238
5252
  } else {
5239
5253
  rawExtraFieldZip64 = new Uint8Array();
5254
+ rawLocalExtraFieldZip64 = new Uint8Array();
5240
5255
  }
5241
5256
  let rawExtraFieldAES;
5242
5257
  if (encrypted && !zipCrypto) {
@@ -5339,7 +5354,7 @@
5339
5354
  rawExtraFieldAES[9] = compressionMethod;
5340
5355
  compressionMethod = COMPRESSION_METHOD_AES;
5341
5356
  }
5342
- const localExtraFieldZip64Length = zip64ExtraFieldComplete ? getLength(rawExtraFieldZip64) : 0;
5357
+ const localExtraFieldZip64Length = zip64ExtraFieldComplete ? getLength(rawLocalExtraFieldZip64) : 0;
5343
5358
  const extraFieldLength = localExtraFieldZip64Length + getLength(rawExtraFieldAES, rawExtraFieldExtendedTimestamp, rawExtraFieldNTFS, rawExtraFieldUnix, rawExtraField);
5344
5359
  const {
5345
5360
  headerArray,
@@ -5364,7 +5379,7 @@
5364
5379
  arraySet(localHeaderArray, rawFilename, localHeaderOffset);
5365
5380
  localHeaderOffset += getLength(rawFilename);
5366
5381
  if (zip64ExtraFieldComplete) {
5367
- arraySet(localHeaderArray, rawExtraFieldZip64, localHeaderOffset);
5382
+ arraySet(localHeaderArray, rawLocalExtraFieldZip64, localHeaderOffset);
5368
5383
  }
5369
5384
  localHeaderOffset += localExtraFieldZip64Length;
5370
5385
  arraySet(localHeaderArray, rawExtraFieldAES, localHeaderOffset);
@@ -5537,12 +5552,8 @@
5537
5552
  signature,
5538
5553
  compressedSize,
5539
5554
  uncompressedSize,
5540
- offset,
5541
- diskNumberStart,
5542
5555
  zip64UncompressedSize,
5543
- zip64CompressedSize,
5544
- zip64Offset,
5545
- zip64DiskNumberStart
5556
+ zip64CompressedSize
5546
5557
  }, localHeaderView, { dataDescriptor }) {
5547
5558
  if (!dataDescriptor) {
5548
5559
  if (!encrypted) {
@@ -5564,13 +5575,6 @@
5564
5575
  setBigUint64(localHeaderView, localHeaderOffset, BigInt(compressedSize));
5565
5576
  localHeaderOffset += 8;
5566
5577
  }
5567
- if (zip64Offset) {
5568
- setBigUint64(localHeaderView, localHeaderOffset, BigInt(offset));
5569
- localHeaderOffset += 8;
5570
- }
5571
- if (zip64DiskNumberStart) {
5572
- setUint32(localHeaderView, localHeaderOffset, diskNumberStart);
5573
- }
5574
5578
  }
5575
5579
  }
5576
5580
  }