@zip.js/zip.js 2.8.11 → 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/README.md +19 -7
- package/deno.json +1 -1
- package/dist/zip-core.js +33 -26
- package/dist/zip-core.min.js +1 -1
- package/dist/zip-fs-core.js +33 -26
- package/dist/zip-fs-core.min.js +1 -1
- package/dist/zip-fs-native.js +33 -26
- package/dist/zip-fs-native.min.js +1 -1
- package/dist/zip-fs.js +33 -26
- package/dist/zip-fs.min.js +1 -1
- package/dist/zip-legacy.js +33 -26
- package/dist/zip-legacy.min.js +1 -1
- package/dist/zip-native.js +33 -26
- package/dist/zip-native.min.js +1 -1
- package/dist/zip.js +33 -26
- package/dist/zip.min.js +1 -1
- package/index-native.cjs +33 -26
- package/index-native.min.js +1 -1
- package/index.cjs +33 -26
- package/index.d.ts +13 -2
- package/index.min.js +1 -1
- package/lib/core/zip-writer.js +33 -26
- package/package.json +4 -4
package/dist/zip-native.js
CHANGED
|
@@ -5191,15 +5191,19 @@
|
|
|
5191
5191
|
let { version, compressionMethod } = options;
|
|
5192
5192
|
const compressed = !directory && (level > 0 || (level === UNDEFINED_VALUE && compressionMethod !== 0));
|
|
5193
5193
|
let rawExtraFieldZip64;
|
|
5194
|
+
let rawLocalExtraFieldZip64;
|
|
5194
5195
|
const uncompressedFile = passThrough || !compressed;
|
|
5195
5196
|
const zip64ExtraFieldComplete = zip64 && (options.bufferedWrite || ((!zip64UncompressedSize && !zip64CompressedSize) || uncompressedFile));
|
|
5196
5197
|
if (zip64) {
|
|
5197
5198
|
let rawExtraFieldZip64Length = 4;
|
|
5199
|
+
let rawLocalExtraFieldZip64Length = 4;
|
|
5198
5200
|
if (zip64UncompressedSize) {
|
|
5199
5201
|
rawExtraFieldZip64Length += 8;
|
|
5202
|
+
rawLocalExtraFieldZip64Length += 8;
|
|
5200
5203
|
}
|
|
5201
5204
|
if (zip64CompressedSize) {
|
|
5202
5205
|
rawExtraFieldZip64Length += 8;
|
|
5206
|
+
rawLocalExtraFieldZip64Length += 8;
|
|
5203
5207
|
}
|
|
5204
5208
|
if (zip64Offset) {
|
|
5205
5209
|
rawExtraFieldZip64Length += 8;
|
|
@@ -5209,18 +5213,28 @@
|
|
|
5209
5213
|
}
|
|
5210
5214
|
rawExtraFieldZip64 = new Uint8Array(rawExtraFieldZip64Length);
|
|
5211
5215
|
const rawExtraFieldZip64View = getDataView(rawExtraFieldZip64);
|
|
5216
|
+
rawLocalExtraFieldZip64 = new Uint8Array(rawLocalExtraFieldZip64Length);
|
|
5217
|
+
const rawLocalExtraFieldZip64View = getDataView(rawLocalExtraFieldZip64);
|
|
5212
5218
|
setUint16(rawExtraFieldZip64View, 0, EXTRAFIELD_TYPE_ZIP64);
|
|
5213
5219
|
setUint16(rawExtraFieldZip64View, 2, getLength(rawExtraFieldZip64) - 4);
|
|
5220
|
+
setUint16(rawLocalExtraFieldZip64View, 0, EXTRAFIELD_TYPE_ZIP64);
|
|
5221
|
+
setUint16(rawLocalExtraFieldZip64View, 2, getLength(rawLocalExtraFieldZip64) - 4);
|
|
5214
5222
|
if (zip64ExtraFieldComplete) {
|
|
5215
5223
|
const rawExtraFieldZip64View = getDataView(rawExtraFieldZip64);
|
|
5224
|
+
const rawLocalExtraFieldZip64View = getDataView(rawLocalExtraFieldZip64);
|
|
5216
5225
|
let rawExtraFieldZip64Offset = 4;
|
|
5226
|
+
let rawLocalExtraFieldZip64Offset = 4;
|
|
5217
5227
|
if (zip64UncompressedSize) {
|
|
5218
5228
|
setBigUint64(rawExtraFieldZip64View, rawExtraFieldZip64Offset, BigInt(uncompressedSize));
|
|
5219
5229
|
rawExtraFieldZip64Offset += 8;
|
|
5230
|
+
setBigUint64(rawLocalExtraFieldZip64View, rawLocalExtraFieldZip64Offset, BigInt(uncompressedSize));
|
|
5231
|
+
rawLocalExtraFieldZip64Offset += 8;
|
|
5220
5232
|
}
|
|
5221
5233
|
if (zip64CompressedSize && uncompressedFile) {
|
|
5222
5234
|
setBigUint64(rawExtraFieldZip64View, rawExtraFieldZip64Offset, BigInt(uncompressedSize));
|
|
5223
5235
|
rawExtraFieldZip64Offset += 8;
|
|
5236
|
+
setBigUint64(rawLocalExtraFieldZip64View, rawLocalExtraFieldZip64Offset, BigInt(uncompressedSize));
|
|
5237
|
+
rawLocalExtraFieldZip64Offset += 8;
|
|
5224
5238
|
}
|
|
5225
5239
|
if (zip64Offset) {
|
|
5226
5240
|
setBigUint64(rawExtraFieldZip64View, rawExtraFieldZip64Offset, BigInt(offset));
|
|
@@ -5230,9 +5244,13 @@
|
|
|
5230
5244
|
setUint32(rawExtraFieldZip64View, rawExtraFieldZip64Offset, diskNumberStart);
|
|
5231
5245
|
rawExtraFieldZip64Offset += 4;
|
|
5232
5246
|
}
|
|
5247
|
+
if (rawLocalExtraFieldZip64Offset == 4) {
|
|
5248
|
+
rawLocalExtraFieldZip64 = new Uint8Array();
|
|
5249
|
+
}
|
|
5233
5250
|
}
|
|
5234
5251
|
} else {
|
|
5235
5252
|
rawExtraFieldZip64 = new Uint8Array();
|
|
5253
|
+
rawLocalExtraFieldZip64 = new Uint8Array();
|
|
5236
5254
|
}
|
|
5237
5255
|
let rawExtraFieldAES;
|
|
5238
5256
|
if (encrypted && !zipCrypto) {
|
|
@@ -5335,7 +5353,7 @@
|
|
|
5335
5353
|
rawExtraFieldAES[9] = compressionMethod;
|
|
5336
5354
|
compressionMethod = COMPRESSION_METHOD_AES;
|
|
5337
5355
|
}
|
|
5338
|
-
const localExtraFieldZip64Length = zip64ExtraFieldComplete ? getLength(
|
|
5356
|
+
const localExtraFieldZip64Length = zip64ExtraFieldComplete ? getLength(rawLocalExtraFieldZip64) : 0;
|
|
5339
5357
|
const extraFieldLength = localExtraFieldZip64Length + getLength(rawExtraFieldAES, rawExtraFieldExtendedTimestamp, rawExtraFieldNTFS, rawExtraFieldUnix, rawExtraField);
|
|
5340
5358
|
const {
|
|
5341
5359
|
headerArray,
|
|
@@ -5360,7 +5378,7 @@
|
|
|
5360
5378
|
arraySet(localHeaderArray, rawFilename, localHeaderOffset);
|
|
5361
5379
|
localHeaderOffset += getLength(rawFilename);
|
|
5362
5380
|
if (zip64ExtraFieldComplete) {
|
|
5363
|
-
arraySet(localHeaderArray,
|
|
5381
|
+
arraySet(localHeaderArray, rawLocalExtraFieldZip64, localHeaderOffset);
|
|
5364
5382
|
}
|
|
5365
5383
|
localHeaderOffset += localExtraFieldZip64Length;
|
|
5366
5384
|
arraySet(localHeaderArray, rawExtraFieldAES, localHeaderOffset);
|
|
@@ -5533,40 +5551,29 @@
|
|
|
5533
5551
|
signature,
|
|
5534
5552
|
compressedSize,
|
|
5535
5553
|
uncompressedSize,
|
|
5536
|
-
offset,
|
|
5537
|
-
diskNumberStart,
|
|
5538
5554
|
zip64UncompressedSize,
|
|
5539
|
-
zip64CompressedSize
|
|
5540
|
-
zip64Offset,
|
|
5541
|
-
zip64DiskNumberStart
|
|
5555
|
+
zip64CompressedSize
|
|
5542
5556
|
}, localHeaderView, { dataDescriptor }) {
|
|
5543
5557
|
if (!dataDescriptor) {
|
|
5544
5558
|
if (!encrypted) {
|
|
5545
5559
|
setUint32(localHeaderView, HEADER_OFFSET_SIGNATURE + 4, signature);
|
|
5546
5560
|
}
|
|
5547
|
-
if (!
|
|
5561
|
+
if (!zip64CompressedSize) {
|
|
5548
5562
|
setUint32(localHeaderView, HEADER_OFFSET_COMPRESSED_SIZE + 4, compressedSize);
|
|
5563
|
+
}
|
|
5564
|
+
if (!zip64UncompressedSize) {
|
|
5549
5565
|
setUint32(localHeaderView, HEADER_OFFSET_UNCOMPRESSED_SIZE + 4, uncompressedSize);
|
|
5550
5566
|
}
|
|
5551
5567
|
}
|
|
5552
|
-
if (zip64) {
|
|
5553
|
-
|
|
5554
|
-
|
|
5555
|
-
|
|
5556
|
-
|
|
5557
|
-
|
|
5558
|
-
|
|
5559
|
-
|
|
5560
|
-
|
|
5561
|
-
localHeaderOffset += 8;
|
|
5562
|
-
}
|
|
5563
|
-
if (zip64Offset) {
|
|
5564
|
-
setBigUint64(localHeaderView, localHeaderOffset, BigInt(offset));
|
|
5565
|
-
localHeaderOffset += 8;
|
|
5566
|
-
}
|
|
5567
|
-
if (zip64DiskNumberStart) {
|
|
5568
|
-
setUint32(localHeaderView, localHeaderOffset, diskNumberStart);
|
|
5569
|
-
}
|
|
5568
|
+
if (zip64 && localExtraFieldZip64Length) {
|
|
5569
|
+
let localHeaderOffset = HEADER_SIZE + getLength(rawFilename) + 4;
|
|
5570
|
+
if (zip64UncompressedSize) {
|
|
5571
|
+
setBigUint64(localHeaderView, localHeaderOffset, BigInt(uncompressedSize));
|
|
5572
|
+
localHeaderOffset += 8;
|
|
5573
|
+
}
|
|
5574
|
+
if (zip64CompressedSize) {
|
|
5575
|
+
setBigUint64(localHeaderView, localHeaderOffset, BigInt(compressedSize));
|
|
5576
|
+
localHeaderOffset += 8;
|
|
5570
5577
|
}
|
|
5571
5578
|
}
|
|
5572
5579
|
}
|