@zip.js/zip.js 2.11.1 → 2.11.3
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/BENCHMARKS.md +268 -93
- package/deno.json +1 -1
- package/dist/zip-core-external.js +56 -19
- package/dist/zip-core-external.min.js +1 -1
- package/dist/zip-core.js +58 -19
- package/dist/zip-core.min.js +1 -1
- package/dist/zip-fs-core-external.js +63 -22
- package/dist/zip-fs-core-external.min.js +1 -1
- package/dist/zip-fs-core.js +65 -22
- package/dist/zip-fs-core.min.js +1 -1
- package/dist/zip-fs-external.js +63 -22
- package/dist/zip-fs-external.min.js +1 -1
- package/dist/zip-fs-native.js +65 -22
- package/dist/zip-fs-native.min.js +1 -1
- package/dist/zip-fs.js +65 -22
- package/dist/zip-fs.min.js +1 -1
- package/dist/zip-legacy.js +58 -19
- package/dist/zip-legacy.min.js +1 -1
- package/dist/zip-native.js +58 -19
- package/dist/zip-native.min.js +1 -1
- package/dist/zip.js +58 -19
- package/dist/zip.min.js +1 -1
- package/index-native.cjs +64 -21
- package/index-native.min.js +1 -1
- package/index.cjs +64 -21
- package/index.d.cts +30 -6
- package/index.d.ts +30 -6
- package/index.min.js +1 -1
- package/lib/core/io.js +2 -3
- package/lib/core/version.js +1 -1
- package/lib/core/zip-fs.js +4 -2
- package/lib/core/zip-writer.js +61 -15
- package/lib/zip-core-writer.js +2 -0
- package/package.json +1 -1
|
@@ -3639,11 +3639,10 @@ class Reader extends Stream {
|
|
|
3639
3639
|
const data = await readUint8Array(reader, offset + chunkOffset, dataSize);
|
|
3640
3640
|
if (data.length) {
|
|
3641
3641
|
controller.enqueue(data);
|
|
3642
|
+
chunkOffset += data.length;
|
|
3642
3643
|
}
|
|
3643
|
-
if ((
|
|
3644
|
+
if ((size !== UNDEFINED_VALUE && chunkOffset >= size) || (!data.length && dataSize)) {
|
|
3644
3645
|
controller.close();
|
|
3645
|
-
} else {
|
|
3646
|
-
chunkOffset += chunkSize;
|
|
3647
3646
|
}
|
|
3648
3647
|
}
|
|
3649
3648
|
});
|
|
@@ -6298,6 +6297,7 @@ const ERR_INVALID_ENTRY_NAME = "File entry name exceeds 64KB";
|
|
|
6298
6297
|
const ERR_INVALID_VERSION = "Version exceeds 65535";
|
|
6299
6298
|
const ERR_INVALID_ENCRYPTION_STRENGTH = "The strength must equal 1, 2, or 3";
|
|
6300
6299
|
const ERR_UNSUPPORTED_ENCRYPTION_USDZ = "Encryption is not supported in USDZ files";
|
|
6300
|
+
const ERR_UNSUPPORTED_SPLIT_USDZ = "Split zip files are not supported in USDZ files";
|
|
6301
6301
|
const ERR_UNSUPPORTED_ENCRYPTION_PASS_THROUGH = "Encryption is not supported when the 'passThrough' option is set";
|
|
6302
6302
|
const ERR_INVALID_EXTRAFIELD = "Invalid extra field (must be a Map)";
|
|
6303
6303
|
const ERR_INVALID_EXTRAFIELD_TYPE = "Invalid extra field type (must be integer 0..65535)";
|
|
@@ -6312,6 +6312,7 @@ const ERR_UNDEFINED_UNCOMPRESSED_SIZE = "Undefined uncompressed size";
|
|
|
6312
6312
|
const ERR_UNDEFINED_COMPRESSION_METHOD = "Undefined compression method";
|
|
6313
6313
|
const ERR_UNDETERMINED_SIZE = "Undetermined size";
|
|
6314
6314
|
const ERR_UNDEFINED_READER = "Undefined reader";
|
|
6315
|
+
const ERR_INVALID_READER = "Invalid reader (must be a Reader instance, a ReadableStream instance, or an object with a 'readable' property)";
|
|
6315
6316
|
const ERR_ZIP_NOT_EMPTY = "Zip file not empty";
|
|
6316
6317
|
const ERR_INVALID_UID = "Invalid uid (must be integer 0..2^32-1)";
|
|
6317
6318
|
const ERR_INVALID_GID = "Invalid gid (must be integer 0..2^32-1)";
|
|
@@ -6343,6 +6344,9 @@ class ZipWriter {
|
|
|
6343
6344
|
const addSplitZipSignature =
|
|
6344
6345
|
availableSize > 0 && availableSize !== INFINITY_VALUE &&
|
|
6345
6346
|
maxSize > 0 && maxSize !== INFINITY_VALUE;
|
|
6347
|
+
if (addSplitZipSignature && options[OPTION_USDZ]) {
|
|
6348
|
+
throw new Error(ERR_UNSUPPORTED_SPLIT_USDZ);
|
|
6349
|
+
}
|
|
6346
6350
|
Object.assign(this, {
|
|
6347
6351
|
writer,
|
|
6348
6352
|
addSplitZipSignature,
|
|
@@ -6354,6 +6358,7 @@ class ZipWriter {
|
|
|
6354
6358
|
pendingAddFileCalls: new Set(),
|
|
6355
6359
|
pendingErrors: [],
|
|
6356
6360
|
bufferedWrites: 0,
|
|
6361
|
+
directWrites: 0,
|
|
6357
6362
|
lastFileEntry: UNDEFINED_VALUE
|
|
6358
6363
|
});
|
|
6359
6364
|
}
|
|
@@ -6457,6 +6462,7 @@ class ZipWriter {
|
|
|
6457
6462
|
}
|
|
6458
6463
|
const { offset, diskNumberStart } = entryPositions.get(entry);
|
|
6459
6464
|
Object.assign(entry, {
|
|
6465
|
+
zip64Enabled: true,
|
|
6460
6466
|
zip64UncompressedSize,
|
|
6461
6467
|
zip64CompressedSize,
|
|
6462
6468
|
offset,
|
|
@@ -7032,6 +7038,9 @@ async function resolveSizes(zipWriter, reader, { resolvedOptions: metadata }, op
|
|
|
7032
7038
|
if (reader) {
|
|
7033
7039
|
reader = new GenericReader(reader);
|
|
7034
7040
|
await initStream(reader);
|
|
7041
|
+
if (!reader.readable && !reader.readUint8Array) {
|
|
7042
|
+
throw new Error(ERR_INVALID_READER);
|
|
7043
|
+
}
|
|
7035
7044
|
({ size: contentSize } = reader);
|
|
7036
7045
|
}
|
|
7037
7046
|
return Object.assign({ reader }, resolveEntrySizes(zipWriter, Boolean(reader), contentSize, metadata, options));
|
|
@@ -7042,6 +7051,7 @@ function resolveEntrySizes(zipWriter, hasContent, contentSize, metadata, options
|
|
|
7042
7051
|
let { dataDescriptor, zip64, level, compressionMethod } = metadata;
|
|
7043
7052
|
let maximumCompressedSize = 0;
|
|
7044
7053
|
let uncompressedSize = 0;
|
|
7054
|
+
let unknownSize = false;
|
|
7045
7055
|
if (passThrough && hasContent) {
|
|
7046
7056
|
uncompressedSize = options[PROPERTY_NAME_UNCOMPRESSED_SIZE];
|
|
7047
7057
|
if (uncompressedSize === UNDEFINED_VALUE) {
|
|
@@ -7067,8 +7077,8 @@ function resolveEntrySizes(zipWriter, hasContent, contentSize, metadata, options
|
|
|
7067
7077
|
if (contentSize === UNDEFINED_VALUE) {
|
|
7068
7078
|
dataDescriptor = true;
|
|
7069
7079
|
if (zip64 || zip64 === UNDEFINED_VALUE) {
|
|
7070
|
-
zip64 = true;
|
|
7071
|
-
|
|
7080
|
+
zip64 = unknownSize = true;
|
|
7081
|
+
maximumCompressedSize = MAX_32_BITS + 1;
|
|
7072
7082
|
}
|
|
7073
7083
|
} else {
|
|
7074
7084
|
options.uncompressedSize = uncompressedSize = contentSize;
|
|
@@ -7083,7 +7093,7 @@ function resolveEntrySizes(zipWriter, hasContent, contentSize, metadata, options
|
|
|
7083
7093
|
if (emptyEntry && !zipCrypto && getOptionValue(zipWriter, options, OPTION_DATA_DESCRIPTOR) === UNDEFINED_VALUE) {
|
|
7084
7094
|
dataDescriptor = false;
|
|
7085
7095
|
}
|
|
7086
|
-
const zip64UncompressedSize = zip64Enabled || uncompressedSize >= MAX_32_BITS;
|
|
7096
|
+
const zip64UncompressedSize = zip64Enabled || unknownSize || uncompressedSize >= MAX_32_BITS;
|
|
7087
7097
|
const zip64CompressedSize = zip64Enabled || maximumCompressedSize >= MAX_32_BITS;
|
|
7088
7098
|
if (zip64UncompressedSize || zip64CompressedSize) {
|
|
7089
7099
|
if (zip64 === false) {
|
|
@@ -7099,6 +7109,8 @@ function resolveEntrySizes(zipWriter, hasContent, contentSize, metadata, options
|
|
|
7099
7109
|
dataDescriptor,
|
|
7100
7110
|
emptyEntry,
|
|
7101
7111
|
zip64,
|
|
7112
|
+
zip64Enabled,
|
|
7113
|
+
unknownSize,
|
|
7102
7114
|
zip64UncompressedSize,
|
|
7103
7115
|
zip64CompressedSize,
|
|
7104
7116
|
uncompressedSize,
|
|
@@ -7172,7 +7184,7 @@ async function getEntriesSize(writerOptions, entries, writeOrderGuaranteed, comm
|
|
|
7172
7184
|
if (layoutDependsOnWriteOrder && !writeOrderGuaranteed) {
|
|
7173
7185
|
throw new Error(ERR_UNDETERMINED_SIZE);
|
|
7174
7186
|
}
|
|
7175
|
-
const directoryDataLength = createDirectoryRecords(files);
|
|
7187
|
+
const { directoryDataLength, zip64Entries } = createDirectoryRecords(files);
|
|
7176
7188
|
let zip64 = getOptionValue(zipWriter, writerOptions, PROPERTY_NAME_ZIP64);
|
|
7177
7189
|
if (offset >= MAX_32_BITS || directoryDataLength >= MAX_32_BITS || files.size >= MAX_16_BITS) {
|
|
7178
7190
|
if (zip64 === false) {
|
|
@@ -7180,6 +7192,8 @@ async function getEntriesSize(writerOptions, entries, writeOrderGuaranteed, comm
|
|
|
7180
7192
|
} else {
|
|
7181
7193
|
zip64 = true;
|
|
7182
7194
|
}
|
|
7195
|
+
} else if (zip64 === UNDEFINED_VALUE && zip64Entries) {
|
|
7196
|
+
zip64 = true;
|
|
7183
7197
|
}
|
|
7184
7198
|
return offset - initialOffset + directoryDataLength + commentLength + (zip64 ? ZIP64_END_OF_CENTRAL_DIR_TOTAL_LENGTH : END_OF_CENTRAL_DIR_LENGTH);
|
|
7185
7199
|
}
|
|
@@ -7204,6 +7218,7 @@ async function getFileEntry(zipWriter, name, reader, entryInfo, options) {
|
|
|
7204
7218
|
const usdz = zipWriter.options[OPTION_USDZ];
|
|
7205
7219
|
let fileEntry = pendingFileEntry;
|
|
7206
7220
|
let bufferedWrite;
|
|
7221
|
+
let directWrite;
|
|
7207
7222
|
let releaseLockWriter;
|
|
7208
7223
|
let writingBufferedEntryData;
|
|
7209
7224
|
let writingEntryData;
|
|
@@ -7213,7 +7228,7 @@ async function getFileEntry(zipWriter, name, reader, entryInfo, options) {
|
|
|
7213
7228
|
const lockPreviousFileEntry = keepOrder && previousFileEntry ? previousFileEntry.lockFileEntry : UNDEFINED_VALUE;
|
|
7214
7229
|
fileEntries.set(name, fileEntry);
|
|
7215
7230
|
try {
|
|
7216
|
-
if (options.bufferedWrite || !keepOrder || zipWriter.writerLocked || zipWriter.bufferedWrites || (!dataDescriptor && !emptyEntry)) {
|
|
7231
|
+
if (options.bufferedWrite || !keepOrder || zipWriter.writerLocked || zipWriter.bufferedWrites || zipWriter.directWrites || (!dataDescriptor && !emptyEntry)) {
|
|
7217
7232
|
bufferedWrite = true;
|
|
7218
7233
|
zipWriter.bufferedWrites++;
|
|
7219
7234
|
if (options.createTempStream) {
|
|
@@ -7224,6 +7239,8 @@ async function getFileEntry(zipWriter, name, reader, entryInfo, options) {
|
|
|
7224
7239
|
fileWriter.size = 0;
|
|
7225
7240
|
await initStream(writer);
|
|
7226
7241
|
} else {
|
|
7242
|
+
directWrite = true;
|
|
7243
|
+
zipWriter.directWrites++;
|
|
7227
7244
|
fileWriter = writer;
|
|
7228
7245
|
await lockPreviousFileEntry;
|
|
7229
7246
|
await requestLockWriter();
|
|
@@ -7302,6 +7319,9 @@ async function getFileEntry(zipWriter, name, reader, entryInfo, options) {
|
|
|
7302
7319
|
if (bufferedWrite) {
|
|
7303
7320
|
zipWriter.bufferedWrites--;
|
|
7304
7321
|
}
|
|
7322
|
+
if (directWrite) {
|
|
7323
|
+
zipWriter.directWrites--;
|
|
7324
|
+
}
|
|
7305
7325
|
if (releaseLockFileEntry) {
|
|
7306
7326
|
releaseLockFileEntry(lockPreviousFileEntry);
|
|
7307
7327
|
}
|
|
@@ -7366,6 +7386,7 @@ async function createFileEntry(reader, writer, { diskNumberStart, lockFileEntry
|
|
|
7366
7386
|
rawPassword,
|
|
7367
7387
|
level,
|
|
7368
7388
|
zip64,
|
|
7389
|
+
zip64Enabled,
|
|
7369
7390
|
zip64UncompressedSize,
|
|
7370
7391
|
zip64CompressedSize,
|
|
7371
7392
|
zipCrypto,
|
|
@@ -7406,6 +7427,7 @@ async function createFileEntry(reader, writer, { diskNumberStart, lockFileEntry
|
|
|
7406
7427
|
lockFileEntry,
|
|
7407
7428
|
versionMadeBy,
|
|
7408
7429
|
zip64,
|
|
7430
|
+
zip64Enabled,
|
|
7409
7431
|
directory: Boolean(directory),
|
|
7410
7432
|
executable: Boolean(executable),
|
|
7411
7433
|
filenameUTF8: true,
|
|
@@ -7446,8 +7468,8 @@ async function createFileEntry(reader, writer, { diskNumberStart, lockFileEntry
|
|
|
7446
7468
|
}
|
|
7447
7469
|
const { writable } = writer;
|
|
7448
7470
|
if (reader) {
|
|
7449
|
-
const readable = toCompatibleReadable(createReadable(reader));
|
|
7450
7471
|
const size = reader.size;
|
|
7472
|
+
const readable = toCompatibleReadable(createReadable(reader, { size }));
|
|
7451
7473
|
const workerOptions = {
|
|
7452
7474
|
options: {
|
|
7453
7475
|
codecType: CODEC_DEFLATE,
|
|
@@ -7549,13 +7571,14 @@ function getHeaderInfo(options) {
|
|
|
7549
7571
|
zip64UncompressedSize,
|
|
7550
7572
|
zip64CompressedSize,
|
|
7551
7573
|
uncompressedSize,
|
|
7574
|
+
unknownSize,
|
|
7552
7575
|
crc32
|
|
7553
7576
|
} = options;
|
|
7554
7577
|
let { version, compressionMethod } = options;
|
|
7555
7578
|
const compressed = !directory && isCompressed(compressionMethod, level);
|
|
7556
7579
|
let rawLocalExtraFieldZip64;
|
|
7557
7580
|
const uncompressedFile = passThrough || !compressed;
|
|
7558
|
-
const zip64ExtraFieldComplete = zip64 && (options.bufferedWrite || !dataDescriptor || ((!zip64UncompressedSize && !zip64CompressedSize) || uncompressedFile));
|
|
7581
|
+
const zip64ExtraFieldComplete = zip64 && (options.bufferedWrite || !dataDescriptor || ((!zip64UncompressedSize && !zip64CompressedSize) || (uncompressedFile && !unknownSize)));
|
|
7559
7582
|
const writeLocalExtraFieldZip64 = zip64ExtraFieldComplete || (zip64 && dataDescriptor && (zip64UncompressedSize || zip64CompressedSize));
|
|
7560
7583
|
if (zip64 && (zip64UncompressedSize || zip64CompressedSize)) {
|
|
7561
7584
|
const length = 4 + 16;
|
|
@@ -7689,6 +7712,10 @@ function getHeaderInfo(options) {
|
|
|
7689
7712
|
throw new Error(ERR_INVALID_EXTRAFIELD_DATA);
|
|
7690
7713
|
}
|
|
7691
7714
|
const dosLastModDate = new Date(Math.ceil(Math.floor(lastModDate.getTime() / 1000) / 2) * 2000);
|
|
7715
|
+
const clampedLastModDate = dosLastModDate < MIN_DATE ? MIN_DATE : dosLastModDate > MAX_DATE ? MAX_DATE : dosLastModDate;
|
|
7716
|
+
const storedLastModDate = getLength(rawExtraFieldExtendedTimestamp) ?
|
|
7717
|
+
new Date(getTimeUnix(lastModDate) * 1000) :
|
|
7718
|
+
getLength(rawExtraFieldNTFS) ? lastModDate : clampedLastModDate;
|
|
7692
7719
|
const {
|
|
7693
7720
|
headerArray,
|
|
7694
7721
|
headerView,
|
|
@@ -7698,7 +7725,7 @@ function getHeaderInfo(options) {
|
|
|
7698
7725
|
bitFlag: getBitFlag(level, useUnicodeFileNames, dataDescriptor, encrypted, compressionMethod),
|
|
7699
7726
|
compressionMethod,
|
|
7700
7727
|
uncompressedSize,
|
|
7701
|
-
lastModDate:
|
|
7728
|
+
lastModDate: clampedLastModDate,
|
|
7702
7729
|
rawLastModDate: rawLastModDateOption,
|
|
7703
7730
|
rawFilename,
|
|
7704
7731
|
zip64CompressedSize,
|
|
@@ -7733,7 +7760,7 @@ function getHeaderInfo(options) {
|
|
|
7733
7760
|
localHeaderView,
|
|
7734
7761
|
headerArray,
|
|
7735
7762
|
headerView,
|
|
7736
|
-
lastModDate,
|
|
7763
|
+
lastModDate: storedLastModDate,
|
|
7737
7764
|
rawLastModDate,
|
|
7738
7765
|
encrypted,
|
|
7739
7766
|
compressed,
|
|
@@ -7905,14 +7932,15 @@ function updateLocalHeader({
|
|
|
7905
7932
|
|
|
7906
7933
|
|
|
7907
7934
|
async function closeFile(zipWriter, comment, options) {
|
|
7908
|
-
const directoryDataLength = createDirectoryRecords(zipWriter.fileEntries);
|
|
7935
|
+
const { directoryDataLength, zip64Entries } = createDirectoryRecords(zipWriter.fileEntries);
|
|
7909
7936
|
const { directoryStart, directoryEnd, directoryArray } = await writeDirectoryRecords(zipWriter, directoryDataLength, options);
|
|
7910
7937
|
const signatureLength = await writeDigitalSignatureRecord(zipWriter, directoryArray, options);
|
|
7911
|
-
await writeEndOfDirectoryRecord(zipWriter, comment, options, { directoryStart, directoryEnd, directoryDataLength, signatureLength });
|
|
7938
|
+
await writeEndOfDirectoryRecord(zipWriter, comment, options, { directoryStart, directoryEnd, directoryDataLength, signatureLength, zip64Entries });
|
|
7912
7939
|
}
|
|
7913
7940
|
|
|
7914
7941
|
function createDirectoryRecords(files) {
|
|
7915
7942
|
let directoryDataLength = 0;
|
|
7943
|
+
let zip64Entries = false;
|
|
7916
7944
|
for (const [, fileEntry] of files) {
|
|
7917
7945
|
const {
|
|
7918
7946
|
rawFilename,
|
|
@@ -7925,11 +7953,20 @@ function createDirectoryRecords(files) {
|
|
|
7925
7953
|
extendedTimestamp,
|
|
7926
7954
|
extraFieldExtendedTimestampFlag,
|
|
7927
7955
|
lastModDate,
|
|
7928
|
-
|
|
7929
|
-
zip64CompressedSize,
|
|
7956
|
+
zip64Enabled,
|
|
7930
7957
|
uncompressedSize,
|
|
7931
7958
|
compressedSize
|
|
7932
7959
|
} = fileEntry;
|
|
7960
|
+
let { zip64UncompressedSize, zip64CompressedSize } = fileEntry;
|
|
7961
|
+
if (!zip64Enabled) {
|
|
7962
|
+
if (zip64UncompressedSize && uncompressedSize < MAX_32_BITS) {
|
|
7963
|
+
zip64UncompressedSize = fileEntry.zip64UncompressedSize = false;
|
|
7964
|
+
}
|
|
7965
|
+
if (zip64CompressedSize && compressedSize < MAX_32_BITS) {
|
|
7966
|
+
zip64CompressedSize = fileEntry.zip64CompressedSize = false;
|
|
7967
|
+
}
|
|
7968
|
+
}
|
|
7969
|
+
zip64Entries = zip64Entries || zip64UncompressedSize || zip64CompressedSize;
|
|
7933
7970
|
const zip64Offset = fileEntry.offset >= MAX_32_BITS;
|
|
7934
7971
|
const zip64DiskNumberStart = fileEntry.diskNumberStart >= MAX_16_BITS;
|
|
7935
7972
|
let rawExtraFieldZip64;
|
|
@@ -7983,7 +8020,7 @@ function createDirectoryRecords(files) {
|
|
|
7983
8020
|
}
|
|
7984
8021
|
directoryDataLength += CENTRAL_FILE_HEADER_LENGTH + getLength(rawFilename, rawComment) + extraFieldLength;
|
|
7985
8022
|
}
|
|
7986
|
-
return directoryDataLength;
|
|
8023
|
+
return { directoryDataLength, zip64Entries };
|
|
7987
8024
|
}
|
|
7988
8025
|
|
|
7989
8026
|
async function writeDirectoryRecords(zipWriter, directoryDataLength, options) {
|
|
@@ -8103,7 +8140,7 @@ async function writeDigitalSignatureRecord(zipWriter, directoryArray, options) {
|
|
|
8103
8140
|
|
|
8104
8141
|
async function writeEndOfDirectoryRecord(zipWriter, comment, options, cdInfo) {
|
|
8105
8142
|
const { writer } = zipWriter;
|
|
8106
|
-
const { directoryStart, directoryEnd, signatureLength } = cdInfo;
|
|
8143
|
+
const { directoryStart, directoryEnd, signatureLength, zip64Entries } = cdInfo;
|
|
8107
8144
|
let { directoryDataLength } = cdInfo;
|
|
8108
8145
|
let fileEntriesLength = zipWriter.fileEntries.size;
|
|
8109
8146
|
let diskNumber = directoryStart.diskNumber;
|
|
@@ -8123,6 +8160,8 @@ async function writeEndOfDirectoryRecord(zipWriter, comment, options, cdInfo) {
|
|
|
8123
8160
|
} else {
|
|
8124
8161
|
zip64 = true;
|
|
8125
8162
|
}
|
|
8163
|
+
} else if (zip64 === UNDEFINED_VALUE && zip64Entries) {
|
|
8164
|
+
zip64 = true;
|
|
8126
8165
|
}
|
|
8127
8166
|
const endOfdirectoryRecord = createRecordWriter(zip64 ? ZIP64_END_OF_CENTRAL_DIR_TOTAL_LENGTH : END_OF_CENTRAL_DIR_LENGTH);
|
|
8128
8167
|
if (exceedsAvailableSize(writer, getLength(endOfdirectoryRecord.array) + commentLength)) {
|
|
@@ -8626,7 +8665,7 @@ function formatSupported(StreamClass, format) {
|
|
|
8626
8665
|
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
8627
8666
|
*/
|
|
8628
8667
|
|
|
8629
|
-
const VERSION = "2.11.
|
|
8668
|
+
const VERSION = "2.11.3";
|
|
8630
8669
|
|
|
8631
8670
|
/*
|
|
8632
8671
|
Copyright (c) 2025 Gildas Lormeau. All rights reserved.
|
|
@@ -9994,12 +10033,14 @@ class ZipDirectoryEntry extends ZipEntry {
|
|
|
9994
10033
|
if (options.bufferedWrite === UNDEFINED_VALUE) {
|
|
9995
10034
|
options.bufferedWrite = true;
|
|
9996
10035
|
}
|
|
9997
|
-
const
|
|
10036
|
+
const children = zipEntry.getChildren({ recursive: true });
|
|
10037
|
+
const entries = children.filter(child => !isImplicitDirectory(child)).map(child => {
|
|
9998
10038
|
const { name, entryOptions } = getChildEntryOptions(child, zipEntry, options);
|
|
9999
10039
|
return { name, size: child.directory ? 0 : getDeterminedSize(child, isPassThrough(child, options)), options: entryOptions };
|
|
10000
10040
|
});
|
|
10001
10041
|
const writeOrderGuaranteed = !options.bufferedWrite ||
|
|
10002
|
-
(entries.every(entry => entry.options.keepOrder !== false) &&
|
|
10042
|
+
(entries.every(entry => entry.options.keepOrder !== false) &&
|
|
10043
|
+
children.every(child => isImplicitDirectory(child) || !child.children.length));
|
|
10003
10044
|
return getEntriesSize(options, entries, writeOrderGuaranteed, options.globalComment);
|
|
10004
10045
|
}
|
|
10005
10046
|
|
|
@@ -10886,4 +10927,4 @@ function getPathParent(parent, path, movedEntry) {
|
|
|
10886
10927
|
return parent;
|
|
10887
10928
|
}
|
|
10888
10929
|
|
|
10889
|
-
export { BlobReader, BlobWriter, Data64URIReader, Data64URIWriter, ERR_ABORTED, ERR_AMBIGUOUS_ARCHIVE, ERR_BAD_FORMAT, ERR_CENTRAL_DIRECTORY_NOT_FOUND, ERR_DUPLICATED_NAME, ERR_DUPLICATE_IMPORTED_ENTRY, ERR_ENCRYPTED, ERR_ENCRYPTED_CENTRAL_DIRECTORY, ERR_ENTRY_DATA_OUT_OF_BOUNDS, ERR_ENTRY_EXISTS, ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND, ERR_EOCDR_NOT_FOUND, ERR_EXTRAFIELD_ZIP64_NOT_FOUND, ERR_HTTP_RANGE, ERR_HTTP_RESOURCE_CHANGED, ERR_INVALID_AUTHENTICATION_CODE, ERR_INVALID_CODEC_DEFINITION, ERR_INVALID_CODEC_MODULE, ERR_INVALID_COMMENT, ERR_INVALID_COMMENT_TYPE, ERR_INVALID_COMPRESSED_DATA, ERR_INVALID_CRC32, ERR_INVALID_DATE, ERR_INVALID_DUPLICATES, ERR_INVALID_ENCRYPTION_STRENGTH, ERR_INVALID_ENTRY_COMMENT, ERR_INVALID_ENTRY_COMMENT_TYPE, ERR_INVALID_ENTRY_NAME, ERR_INVALID_EXTRAFIELD, ERR_INVALID_EXTRAFIELD_DATA, ERR_INVALID_EXTRAFIELD_DATA_TYPE, ERR_INVALID_EXTRAFIELD_TYPE, ERR_INVALID_FILENAME_VALIDATION, ERR_INVALID_FUNCTION_OPTION, ERR_INVALID_GID, ERR_INVALID_LEVEL, ERR_INVALID_MAX_APPENDED_DATA_SIZE, ERR_INVALID_MAX_WORKERS, ERR_INVALID_MSDOS_ATTRIBUTES, ERR_INVALID_MSDOS_DATA, ERR_INVALID_PASSWORD, ERR_INVALID_PASSWORD_TYPE, ERR_INVALID_PASS_THROUGH, ERR_INVALID_READER_OPTIONS, ERR_INVALID_SIGNAL, ERR_INVALID_SIGNATURE_DATA, ERR_INVALID_STRICTNESS, ERR_INVALID_UID, ERR_INVALID_UNCOMPRESSED_SIZE, ERR_INVALID_UNIX_EXTRA_FIELD_TYPE, ERR_INVALID_UNIX_ID_SIZE, ERR_INVALID_UNIX_MODE, ERR_INVALID_VERSION, ERR_ITERATOR_COMPLETED_TOO_SOON, ERR_LOCAL_FILE_HEADER_NOT_FOUND, ERR_OVERLAPPING_ENTRY, ERR_READABLE_CONSUMED, ERR_RESERVED_COMPRESSION_METHOD, ERR_SPLIT_ZIP_FILE, ERR_UNDEFINED_COMPRESSION_METHOD, ERR_UNDEFINED_READER, ERR_UNDEFINED_UNCOMPRESSED_SIZE, ERR_UNDETERMINED_SIZE, ERR_UNSAFE_FILENAME, ERR_UNSUPPORTED_COMPRESSION, ERR_UNSUPPORTED_CONTEXT, ERR_UNSUPPORTED_CRYPTO_API, ERR_UNSUPPORTED_ENCRYPTION, ERR_UNSUPPORTED_ENCRYPTION_PASS_THROUGH, ERR_UNSUPPORTED_ENCRYPTION_USDZ, ERR_UNSUPPORTED_FORMAT, ERR_UNSUPPORTED_UINT64, ERR_WORKER_STARTUP_TIMEOUT, ERR_WRITER_NOT_INITIALIZED, ERR_ZIP_CRYPTO_LAST_MOD_DATE, ERR_ZIP_NOT_EMPTY, HttpRangeReader, HttpReader, Reader, SplitDataReader, SplitDataWriter, TextReader, TextWriter, Uint8ArrayReader, Uint8ArrayWriter, VERSION, WARNING_APPENDED_DATA, WARNING_COMPRESSED_PATCHED_DATA, WARNING_DUPLICATE_FILENAME, WARNING_MALFORMED_EXTRA_FIELD, WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG, WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD, WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES, WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY, WARNING_PREPENDED_CENTRAL_DIRECTORY, WARNING_PREPENDED_DATA, WARNING_TRAILING_CENTRAL_DIRECTORY_DATA, WARNING_UNKNOWN_VERSION, WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA, WARNING_UNSORTED_CENTRAL_DIRECTORY, WARNING_WRAPPED_ENTRIES_COUNT, Writer, ZipDirectoryEntry, ZipEntry, ZipFS, ZipFileEntry, ZipReader, ZipReaderStream, ZipWriter, ZipWriterStream, configure, createBlobTempStream, createOPFSTempStream, createSyncAccessHandleTempStream, fs, getMimeType, getRegisteredCodecs, getSupportedCompressionMethods, isZipFile, registerCodec, resetConfiguration, terminateWorkersAndModule as terminateWorkers, unregisterCodec };
|
|
10930
|
+
export { BlobReader, BlobWriter, Data64URIReader, Data64URIWriter, ERR_ABORTED, ERR_AMBIGUOUS_ARCHIVE, ERR_BAD_FORMAT, ERR_CENTRAL_DIRECTORY_NOT_FOUND, ERR_DUPLICATED_NAME, ERR_DUPLICATE_IMPORTED_ENTRY, ERR_ENCRYPTED, ERR_ENCRYPTED_CENTRAL_DIRECTORY, ERR_ENTRY_DATA_OUT_OF_BOUNDS, ERR_ENTRY_EXISTS, ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND, ERR_EOCDR_NOT_FOUND, ERR_EXTRAFIELD_ZIP64_NOT_FOUND, ERR_HTTP_RANGE, ERR_HTTP_RESOURCE_CHANGED, ERR_INVALID_AUTHENTICATION_CODE, ERR_INVALID_CODEC_DEFINITION, ERR_INVALID_CODEC_MODULE, ERR_INVALID_COMMENT, ERR_INVALID_COMMENT_TYPE, ERR_INVALID_COMPRESSED_DATA, ERR_INVALID_CRC32, ERR_INVALID_DATE, ERR_INVALID_DUPLICATES, ERR_INVALID_ENCRYPTION_STRENGTH, ERR_INVALID_ENTRY_COMMENT, ERR_INVALID_ENTRY_COMMENT_TYPE, ERR_INVALID_ENTRY_NAME, ERR_INVALID_EXTRAFIELD, ERR_INVALID_EXTRAFIELD_DATA, ERR_INVALID_EXTRAFIELD_DATA_TYPE, ERR_INVALID_EXTRAFIELD_TYPE, ERR_INVALID_FILENAME_VALIDATION, ERR_INVALID_FUNCTION_OPTION, ERR_INVALID_GID, ERR_INVALID_LEVEL, ERR_INVALID_MAX_APPENDED_DATA_SIZE, ERR_INVALID_MAX_WORKERS, ERR_INVALID_MSDOS_ATTRIBUTES, ERR_INVALID_MSDOS_DATA, ERR_INVALID_PASSWORD, ERR_INVALID_PASSWORD_TYPE, ERR_INVALID_PASS_THROUGH, ERR_INVALID_READER, ERR_INVALID_READER_OPTIONS, ERR_INVALID_SIGNAL, ERR_INVALID_SIGNATURE_DATA, ERR_INVALID_STRICTNESS, ERR_INVALID_UID, ERR_INVALID_UNCOMPRESSED_SIZE, ERR_INVALID_UNIX_EXTRA_FIELD_TYPE, ERR_INVALID_UNIX_ID_SIZE, ERR_INVALID_UNIX_MODE, ERR_INVALID_VERSION, ERR_ITERATOR_COMPLETED_TOO_SOON, ERR_LOCAL_FILE_HEADER_NOT_FOUND, ERR_OVERLAPPING_ENTRY, ERR_READABLE_CONSUMED, ERR_RESERVED_COMPRESSION_METHOD, ERR_SPLIT_ZIP_FILE, ERR_UNDEFINED_COMPRESSION_METHOD, ERR_UNDEFINED_READER, ERR_UNDEFINED_UNCOMPRESSED_SIZE, ERR_UNDETERMINED_SIZE, ERR_UNSAFE_FILENAME, ERR_UNSUPPORTED_COMPRESSION, ERR_UNSUPPORTED_CONTEXT, ERR_UNSUPPORTED_CRYPTO_API, ERR_UNSUPPORTED_ENCRYPTION, ERR_UNSUPPORTED_ENCRYPTION_PASS_THROUGH, ERR_UNSUPPORTED_ENCRYPTION_USDZ, ERR_UNSUPPORTED_FORMAT, ERR_UNSUPPORTED_SPLIT_USDZ, ERR_UNSUPPORTED_UINT64, ERR_WORKER_STARTUP_TIMEOUT, ERR_WRITER_NOT_INITIALIZED, ERR_ZIP_CRYPTO_LAST_MOD_DATE, ERR_ZIP_NOT_EMPTY, HttpRangeReader, HttpReader, Reader, SplitDataReader, SplitDataWriter, TextReader, TextWriter, Uint8ArrayReader, Uint8ArrayWriter, VERSION, WARNING_APPENDED_DATA, WARNING_COMPRESSED_PATCHED_DATA, WARNING_DUPLICATE_FILENAME, WARNING_MALFORMED_EXTRA_FIELD, WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG, WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD, WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES, WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY, WARNING_PREPENDED_CENTRAL_DIRECTORY, WARNING_PREPENDED_DATA, WARNING_TRAILING_CENTRAL_DIRECTORY_DATA, WARNING_UNKNOWN_VERSION, WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA, WARNING_UNSORTED_CENTRAL_DIRECTORY, WARNING_WRAPPED_ENTRIES_COUNT, Writer, ZipDirectoryEntry, ZipEntry, ZipFS, ZipFileEntry, ZipReader, ZipReaderStream, ZipWriter, ZipWriterStream, configure, createBlobTempStream, createOPFSTempStream, createSyncAccessHandleTempStream, fs, getMimeType, getRegisteredCodecs, getSupportedCompressionMethods, isZipFile, registerCodec, resetConfiguration, terminateWorkersAndModule as terminateWorkers, unregisterCodec };
|