@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.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));
|
|
@@ -5234,9 +5248,13 @@
|
|
|
5234
5248
|
setUint32(rawExtraFieldZip64View, rawExtraFieldZip64Offset, diskNumberStart);
|
|
5235
5249
|
rawExtraFieldZip64Offset += 4;
|
|
5236
5250
|
}
|
|
5251
|
+
if (rawLocalExtraFieldZip64Offset == 4) {
|
|
5252
|
+
rawLocalExtraFieldZip64 = new Uint8Array();
|
|
5253
|
+
}
|
|
5237
5254
|
}
|
|
5238
5255
|
} else {
|
|
5239
5256
|
rawExtraFieldZip64 = new Uint8Array();
|
|
5257
|
+
rawLocalExtraFieldZip64 = new Uint8Array();
|
|
5240
5258
|
}
|
|
5241
5259
|
let rawExtraFieldAES;
|
|
5242
5260
|
if (encrypted && !zipCrypto) {
|
|
@@ -5339,7 +5357,7 @@
|
|
|
5339
5357
|
rawExtraFieldAES[9] = compressionMethod;
|
|
5340
5358
|
compressionMethod = COMPRESSION_METHOD_AES;
|
|
5341
5359
|
}
|
|
5342
|
-
const localExtraFieldZip64Length = zip64ExtraFieldComplete ? getLength(
|
|
5360
|
+
const localExtraFieldZip64Length = zip64ExtraFieldComplete ? getLength(rawLocalExtraFieldZip64) : 0;
|
|
5343
5361
|
const extraFieldLength = localExtraFieldZip64Length + getLength(rawExtraFieldAES, rawExtraFieldExtendedTimestamp, rawExtraFieldNTFS, rawExtraFieldUnix, rawExtraField);
|
|
5344
5362
|
const {
|
|
5345
5363
|
headerArray,
|
|
@@ -5364,7 +5382,7 @@
|
|
|
5364
5382
|
arraySet(localHeaderArray, rawFilename, localHeaderOffset);
|
|
5365
5383
|
localHeaderOffset += getLength(rawFilename);
|
|
5366
5384
|
if (zip64ExtraFieldComplete) {
|
|
5367
|
-
arraySet(localHeaderArray,
|
|
5385
|
+
arraySet(localHeaderArray, rawLocalExtraFieldZip64, localHeaderOffset);
|
|
5368
5386
|
}
|
|
5369
5387
|
localHeaderOffset += localExtraFieldZip64Length;
|
|
5370
5388
|
arraySet(localHeaderArray, rawExtraFieldAES, localHeaderOffset);
|
|
@@ -5537,40 +5555,29 @@
|
|
|
5537
5555
|
signature,
|
|
5538
5556
|
compressedSize,
|
|
5539
5557
|
uncompressedSize,
|
|
5540
|
-
offset,
|
|
5541
|
-
diskNumberStart,
|
|
5542
5558
|
zip64UncompressedSize,
|
|
5543
|
-
zip64CompressedSize
|
|
5544
|
-
zip64Offset,
|
|
5545
|
-
zip64DiskNumberStart
|
|
5559
|
+
zip64CompressedSize
|
|
5546
5560
|
}, localHeaderView, { dataDescriptor }) {
|
|
5547
5561
|
if (!dataDescriptor) {
|
|
5548
5562
|
if (!encrypted) {
|
|
5549
5563
|
setUint32(localHeaderView, HEADER_OFFSET_SIGNATURE + 4, signature);
|
|
5550
5564
|
}
|
|
5551
|
-
if (!
|
|
5565
|
+
if (!zip64CompressedSize) {
|
|
5552
5566
|
setUint32(localHeaderView, HEADER_OFFSET_COMPRESSED_SIZE + 4, compressedSize);
|
|
5567
|
+
}
|
|
5568
|
+
if (!zip64UncompressedSize) {
|
|
5553
5569
|
setUint32(localHeaderView, HEADER_OFFSET_UNCOMPRESSED_SIZE + 4, uncompressedSize);
|
|
5554
5570
|
}
|
|
5555
5571
|
}
|
|
5556
|
-
if (zip64) {
|
|
5557
|
-
|
|
5558
|
-
|
|
5559
|
-
|
|
5560
|
-
|
|
5561
|
-
|
|
5562
|
-
|
|
5563
|
-
|
|
5564
|
-
|
|
5565
|
-
localHeaderOffset += 8;
|
|
5566
|
-
}
|
|
5567
|
-
if (zip64Offset) {
|
|
5568
|
-
setBigUint64(localHeaderView, localHeaderOffset, BigInt(offset));
|
|
5569
|
-
localHeaderOffset += 8;
|
|
5570
|
-
}
|
|
5571
|
-
if (zip64DiskNumberStart) {
|
|
5572
|
-
setUint32(localHeaderView, localHeaderOffset, diskNumberStart);
|
|
5573
|
-
}
|
|
5572
|
+
if (zip64 && localExtraFieldZip64Length) {
|
|
5573
|
+
let localHeaderOffset = HEADER_SIZE + getLength(rawFilename) + 4;
|
|
5574
|
+
if (zip64UncompressedSize) {
|
|
5575
|
+
setBigUint64(localHeaderView, localHeaderOffset, BigInt(uncompressedSize));
|
|
5576
|
+
localHeaderOffset += 8;
|
|
5577
|
+
}
|
|
5578
|
+
if (zip64CompressedSize) {
|
|
5579
|
+
setBigUint64(localHeaderView, localHeaderOffset, BigInt(compressedSize));
|
|
5580
|
+
localHeaderOffset += 8;
|
|
5574
5581
|
}
|
|
5575
5582
|
}
|
|
5576
5583
|
}
|