@zip.js/zip.js 2.8.10 → 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/README.md +10 -7
- package/dist/zip-core.js +18 -14
- package/dist/zip-core.min.js +1 -1
- package/dist/zip-fs-core.js +18 -14
- package/dist/zip-fs-core.min.js +1 -1
- package/dist/zip-fs-native.js +18 -14
- package/dist/zip-fs-native.min.js +1 -1
- package/dist/zip-fs.js +18 -14
- package/dist/zip-fs.min.js +1 -1
- package/dist/zip-legacy.js +18 -14
- package/dist/zip-legacy.min.js +1 -1
- package/dist/zip-native.js +18 -14
- package/dist/zip-native.min.js +1 -1
- package/dist/zip.js +18 -14
- package/dist/zip.min.js +1 -1
- package/index-native.cjs +18 -14
- package/index-native.min.js +1 -1
- package/index.cjs +18 -14
- package/index.d.ts +14 -3
- package/index.min.js +1 -1
- package/lib/core/zip-writer.js +18 -14
- package/package.json +5 -5
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));
|
|
@@ -5233,6 +5247,7 @@
|
|
|
5233
5247
|
}
|
|
5234
5248
|
} else {
|
|
5235
5249
|
rawExtraFieldZip64 = new Uint8Array();
|
|
5250
|
+
rawLocalExtraFieldZip64 = new Uint8Array();
|
|
5236
5251
|
}
|
|
5237
5252
|
let rawExtraFieldAES;
|
|
5238
5253
|
if (encrypted && !zipCrypto) {
|
|
@@ -5335,7 +5350,7 @@
|
|
|
5335
5350
|
rawExtraFieldAES[9] = compressionMethod;
|
|
5336
5351
|
compressionMethod = COMPRESSION_METHOD_AES;
|
|
5337
5352
|
}
|
|
5338
|
-
const localExtraFieldZip64Length = zip64ExtraFieldComplete ? getLength(
|
|
5353
|
+
const localExtraFieldZip64Length = zip64ExtraFieldComplete ? getLength(rawLocalExtraFieldZip64) : 0;
|
|
5339
5354
|
const extraFieldLength = localExtraFieldZip64Length + getLength(rawExtraFieldAES, rawExtraFieldExtendedTimestamp, rawExtraFieldNTFS, rawExtraFieldUnix, rawExtraField);
|
|
5340
5355
|
const {
|
|
5341
5356
|
headerArray,
|
|
@@ -5360,7 +5375,7 @@
|
|
|
5360
5375
|
arraySet(localHeaderArray, rawFilename, localHeaderOffset);
|
|
5361
5376
|
localHeaderOffset += getLength(rawFilename);
|
|
5362
5377
|
if (zip64ExtraFieldComplete) {
|
|
5363
|
-
arraySet(localHeaderArray,
|
|
5378
|
+
arraySet(localHeaderArray, rawLocalExtraFieldZip64, localHeaderOffset);
|
|
5364
5379
|
}
|
|
5365
5380
|
localHeaderOffset += localExtraFieldZip64Length;
|
|
5366
5381
|
arraySet(localHeaderArray, rawExtraFieldAES, localHeaderOffset);
|
|
@@ -5533,12 +5548,8 @@
|
|
|
5533
5548
|
signature,
|
|
5534
5549
|
compressedSize,
|
|
5535
5550
|
uncompressedSize,
|
|
5536
|
-
offset,
|
|
5537
|
-
diskNumberStart,
|
|
5538
5551
|
zip64UncompressedSize,
|
|
5539
|
-
zip64CompressedSize
|
|
5540
|
-
zip64Offset,
|
|
5541
|
-
zip64DiskNumberStart
|
|
5552
|
+
zip64CompressedSize
|
|
5542
5553
|
}, localHeaderView, { dataDescriptor }) {
|
|
5543
5554
|
if (!dataDescriptor) {
|
|
5544
5555
|
if (!encrypted) {
|
|
@@ -5560,13 +5571,6 @@
|
|
|
5560
5571
|
setBigUint64(localHeaderView, localHeaderOffset, BigInt(compressedSize));
|
|
5561
5572
|
localHeaderOffset += 8;
|
|
5562
5573
|
}
|
|
5563
|
-
if (zip64Offset) {
|
|
5564
|
-
setBigUint64(localHeaderView, localHeaderOffset, BigInt(offset));
|
|
5565
|
-
localHeaderOffset += 8;
|
|
5566
|
-
}
|
|
5567
|
-
if (zip64DiskNumberStart) {
|
|
5568
|
-
setUint32(localHeaderView, localHeaderOffset, diskNumberStart);
|
|
5569
|
-
}
|
|
5570
5574
|
}
|
|
5571
5575
|
}
|
|
5572
5576
|
}
|