@zip.js/zip.js 2.11.2 → 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 +146 -38
- package/deno.json +1 -1
- package/dist/zip-core-external.js +45 -14
- package/dist/zip-core-external.min.js +1 -1
- package/dist/zip-core.js +47 -14
- package/dist/zip-core.min.js +1 -1
- package/dist/zip-fs-core-external.js +52 -17
- package/dist/zip-fs-core-external.min.js +1 -1
- package/dist/zip-fs-core.js +54 -17
- package/dist/zip-fs-core.min.js +1 -1
- package/dist/zip-fs-external.js +52 -17
- package/dist/zip-fs-external.min.js +1 -1
- package/dist/zip-fs-native.js +54 -17
- package/dist/zip-fs-native.min.js +1 -1
- package/dist/zip-fs.js +54 -17
- package/dist/zip-fs.min.js +1 -1
- package/dist/zip-legacy.js +47 -14
- package/dist/zip-legacy.min.js +1 -1
- package/dist/zip-native.js +47 -14
- package/dist/zip-native.min.js +1 -1
- package/dist/zip.js +47 -14
- package/dist/zip.min.js +1 -1
- package/index-native.cjs +53 -16
- package/index-native.min.js +1 -1
- package/index.cjs +53 -16
- package/index.d.cts +27 -2
- package/index.d.ts +27 -2
- package/index.min.js +1 -1
- package/lib/core/version.js +1 -1
- package/lib/core/zip-fs.js +4 -2
- package/lib/core/zip-writer.js +48 -13
- package/lib/zip-core-writer.js +2 -0
- package/package.json +1 -1
package/index.cjs
CHANGED
|
@@ -6266,6 +6266,7 @@ const ERR_INVALID_ENTRY_NAME = "File entry name exceeds 64KB";
|
|
|
6266
6266
|
const ERR_INVALID_VERSION = "Version exceeds 65535";
|
|
6267
6267
|
const ERR_INVALID_ENCRYPTION_STRENGTH = "The strength must equal 1, 2, or 3";
|
|
6268
6268
|
const ERR_UNSUPPORTED_ENCRYPTION_USDZ = "Encryption is not supported in USDZ files";
|
|
6269
|
+
const ERR_UNSUPPORTED_SPLIT_USDZ = "Split zip files are not supported in USDZ files";
|
|
6269
6270
|
const ERR_UNSUPPORTED_ENCRYPTION_PASS_THROUGH = "Encryption is not supported when the 'passThrough' option is set";
|
|
6270
6271
|
const ERR_INVALID_EXTRAFIELD = "Invalid extra field (must be a Map)";
|
|
6271
6272
|
const ERR_INVALID_EXTRAFIELD_TYPE = "Invalid extra field type (must be integer 0..65535)";
|
|
@@ -6280,6 +6281,7 @@ const ERR_UNDEFINED_UNCOMPRESSED_SIZE = "Undefined uncompressed size";
|
|
|
6280
6281
|
const ERR_UNDEFINED_COMPRESSION_METHOD = "Undefined compression method";
|
|
6281
6282
|
const ERR_UNDETERMINED_SIZE = "Undetermined size";
|
|
6282
6283
|
const ERR_UNDEFINED_READER = "Undefined reader";
|
|
6284
|
+
const ERR_INVALID_READER = "Invalid reader (must be a Reader instance, a ReadableStream instance, or an object with a 'readable' property)";
|
|
6283
6285
|
const ERR_ZIP_NOT_EMPTY = "Zip file not empty";
|
|
6284
6286
|
const ERR_INVALID_UID = "Invalid uid (must be integer 0..2^32-1)";
|
|
6285
6287
|
const ERR_INVALID_GID = "Invalid gid (must be integer 0..2^32-1)";
|
|
@@ -6311,6 +6313,9 @@ class ZipWriter {
|
|
|
6311
6313
|
const addSplitZipSignature =
|
|
6312
6314
|
availableSize > 0 && availableSize !== INFINITY_VALUE &&
|
|
6313
6315
|
maxSize > 0 && maxSize !== INFINITY_VALUE;
|
|
6316
|
+
if (addSplitZipSignature && options[OPTION_USDZ]) {
|
|
6317
|
+
throw new Error(ERR_UNSUPPORTED_SPLIT_USDZ);
|
|
6318
|
+
}
|
|
6314
6319
|
Object.assign(this, {
|
|
6315
6320
|
writer,
|
|
6316
6321
|
addSplitZipSignature,
|
|
@@ -6426,6 +6431,7 @@ class ZipWriter {
|
|
|
6426
6431
|
}
|
|
6427
6432
|
const { offset, diskNumberStart } = entryPositions.get(entry);
|
|
6428
6433
|
Object.assign(entry, {
|
|
6434
|
+
zip64Enabled: true,
|
|
6429
6435
|
zip64UncompressedSize,
|
|
6430
6436
|
zip64CompressedSize,
|
|
6431
6437
|
offset,
|
|
@@ -7001,6 +7007,9 @@ async function resolveSizes(zipWriter, reader, { resolvedOptions: metadata }, op
|
|
|
7001
7007
|
if (reader) {
|
|
7002
7008
|
reader = new GenericReader(reader);
|
|
7003
7009
|
await initStream(reader);
|
|
7010
|
+
if (!reader.readable && !reader.readUint8Array) {
|
|
7011
|
+
throw new Error(ERR_INVALID_READER);
|
|
7012
|
+
}
|
|
7004
7013
|
({ size: contentSize } = reader);
|
|
7005
7014
|
}
|
|
7006
7015
|
return Object.assign({ reader }, resolveEntrySizes(zipWriter, Boolean(reader), contentSize, metadata, options));
|
|
@@ -7011,6 +7020,7 @@ function resolveEntrySizes(zipWriter, hasContent, contentSize, metadata, options
|
|
|
7011
7020
|
let { dataDescriptor, zip64, level, compressionMethod } = metadata;
|
|
7012
7021
|
let maximumCompressedSize = 0;
|
|
7013
7022
|
let uncompressedSize = 0;
|
|
7023
|
+
let unknownSize = false;
|
|
7014
7024
|
if (passThrough && hasContent) {
|
|
7015
7025
|
uncompressedSize = options[PROPERTY_NAME_UNCOMPRESSED_SIZE];
|
|
7016
7026
|
if (uncompressedSize === UNDEFINED_VALUE) {
|
|
@@ -7036,8 +7046,8 @@ function resolveEntrySizes(zipWriter, hasContent, contentSize, metadata, options
|
|
|
7036
7046
|
if (contentSize === UNDEFINED_VALUE) {
|
|
7037
7047
|
dataDescriptor = true;
|
|
7038
7048
|
if (zip64 || zip64 === UNDEFINED_VALUE) {
|
|
7039
|
-
zip64 = true;
|
|
7040
|
-
|
|
7049
|
+
zip64 = unknownSize = true;
|
|
7050
|
+
maximumCompressedSize = MAX_32_BITS + 1;
|
|
7041
7051
|
}
|
|
7042
7052
|
} else {
|
|
7043
7053
|
options.uncompressedSize = uncompressedSize = contentSize;
|
|
@@ -7052,7 +7062,7 @@ function resolveEntrySizes(zipWriter, hasContent, contentSize, metadata, options
|
|
|
7052
7062
|
if (emptyEntry && !zipCrypto && getOptionValue(zipWriter, options, OPTION_DATA_DESCRIPTOR) === UNDEFINED_VALUE) {
|
|
7053
7063
|
dataDescriptor = false;
|
|
7054
7064
|
}
|
|
7055
|
-
const zip64UncompressedSize = zip64Enabled || uncompressedSize >= MAX_32_BITS;
|
|
7065
|
+
const zip64UncompressedSize = zip64Enabled || unknownSize || uncompressedSize >= MAX_32_BITS;
|
|
7056
7066
|
const zip64CompressedSize = zip64Enabled || maximumCompressedSize >= MAX_32_BITS;
|
|
7057
7067
|
if (zip64UncompressedSize || zip64CompressedSize) {
|
|
7058
7068
|
if (zip64 === false) {
|
|
@@ -7068,6 +7078,8 @@ function resolveEntrySizes(zipWriter, hasContent, contentSize, metadata, options
|
|
|
7068
7078
|
dataDescriptor,
|
|
7069
7079
|
emptyEntry,
|
|
7070
7080
|
zip64,
|
|
7081
|
+
zip64Enabled,
|
|
7082
|
+
unknownSize,
|
|
7071
7083
|
zip64UncompressedSize,
|
|
7072
7084
|
zip64CompressedSize,
|
|
7073
7085
|
uncompressedSize,
|
|
@@ -7141,7 +7153,7 @@ async function getEntriesSize(writerOptions, entries, writeOrderGuaranteed, comm
|
|
|
7141
7153
|
if (layoutDependsOnWriteOrder && !writeOrderGuaranteed) {
|
|
7142
7154
|
throw new Error(ERR_UNDETERMINED_SIZE);
|
|
7143
7155
|
}
|
|
7144
|
-
const directoryDataLength = createDirectoryRecords(files);
|
|
7156
|
+
const { directoryDataLength, zip64Entries } = createDirectoryRecords(files);
|
|
7145
7157
|
let zip64 = getOptionValue(zipWriter, writerOptions, PROPERTY_NAME_ZIP64);
|
|
7146
7158
|
if (offset >= MAX_32_BITS || directoryDataLength >= MAX_32_BITS || files.size >= MAX_16_BITS) {
|
|
7147
7159
|
if (zip64 === false) {
|
|
@@ -7149,6 +7161,8 @@ async function getEntriesSize(writerOptions, entries, writeOrderGuaranteed, comm
|
|
|
7149
7161
|
} else {
|
|
7150
7162
|
zip64 = true;
|
|
7151
7163
|
}
|
|
7164
|
+
} else if (zip64 === UNDEFINED_VALUE && zip64Entries) {
|
|
7165
|
+
zip64 = true;
|
|
7152
7166
|
}
|
|
7153
7167
|
return offset - initialOffset + directoryDataLength + commentLength + (zip64 ? ZIP64_END_OF_CENTRAL_DIR_TOTAL_LENGTH : END_OF_CENTRAL_DIR_LENGTH);
|
|
7154
7168
|
}
|
|
@@ -7341,6 +7355,7 @@ async function createFileEntry(reader, writer, { diskNumberStart, lockFileEntry
|
|
|
7341
7355
|
rawPassword,
|
|
7342
7356
|
level,
|
|
7343
7357
|
zip64,
|
|
7358
|
+
zip64Enabled,
|
|
7344
7359
|
zip64UncompressedSize,
|
|
7345
7360
|
zip64CompressedSize,
|
|
7346
7361
|
zipCrypto,
|
|
@@ -7381,6 +7396,7 @@ async function createFileEntry(reader, writer, { diskNumberStart, lockFileEntry
|
|
|
7381
7396
|
lockFileEntry,
|
|
7382
7397
|
versionMadeBy,
|
|
7383
7398
|
zip64,
|
|
7399
|
+
zip64Enabled,
|
|
7384
7400
|
directory: Boolean(directory),
|
|
7385
7401
|
executable: Boolean(executable),
|
|
7386
7402
|
filenameUTF8: true,
|
|
@@ -7524,13 +7540,14 @@ function getHeaderInfo(options) {
|
|
|
7524
7540
|
zip64UncompressedSize,
|
|
7525
7541
|
zip64CompressedSize,
|
|
7526
7542
|
uncompressedSize,
|
|
7543
|
+
unknownSize,
|
|
7527
7544
|
crc32
|
|
7528
7545
|
} = options;
|
|
7529
7546
|
let { version, compressionMethod } = options;
|
|
7530
7547
|
const compressed = !directory && isCompressed(compressionMethod, level);
|
|
7531
7548
|
let rawLocalExtraFieldZip64;
|
|
7532
7549
|
const uncompressedFile = passThrough || !compressed;
|
|
7533
|
-
const zip64ExtraFieldComplete = zip64 && (options.bufferedWrite || !dataDescriptor || ((!zip64UncompressedSize && !zip64CompressedSize) || uncompressedFile));
|
|
7550
|
+
const zip64ExtraFieldComplete = zip64 && (options.bufferedWrite || !dataDescriptor || ((!zip64UncompressedSize && !zip64CompressedSize) || (uncompressedFile && !unknownSize)));
|
|
7534
7551
|
const writeLocalExtraFieldZip64 = zip64ExtraFieldComplete || (zip64 && dataDescriptor && (zip64UncompressedSize || zip64CompressedSize));
|
|
7535
7552
|
if (zip64 && (zip64UncompressedSize || zip64CompressedSize)) {
|
|
7536
7553
|
const length = 4 + 16;
|
|
@@ -7664,6 +7681,10 @@ function getHeaderInfo(options) {
|
|
|
7664
7681
|
throw new Error(ERR_INVALID_EXTRAFIELD_DATA);
|
|
7665
7682
|
}
|
|
7666
7683
|
const dosLastModDate = new Date(Math.ceil(Math.floor(lastModDate.getTime() / 1000) / 2) * 2000);
|
|
7684
|
+
const clampedLastModDate = dosLastModDate < MIN_DATE ? MIN_DATE : dosLastModDate > MAX_DATE ? MAX_DATE : dosLastModDate;
|
|
7685
|
+
const storedLastModDate = getLength(rawExtraFieldExtendedTimestamp) ?
|
|
7686
|
+
new Date(getTimeUnix(lastModDate) * 1000) :
|
|
7687
|
+
getLength(rawExtraFieldNTFS) ? lastModDate : clampedLastModDate;
|
|
7667
7688
|
const {
|
|
7668
7689
|
headerArray,
|
|
7669
7690
|
headerView,
|
|
@@ -7673,7 +7694,7 @@ function getHeaderInfo(options) {
|
|
|
7673
7694
|
bitFlag: getBitFlag(level, useUnicodeFileNames, dataDescriptor, encrypted, compressionMethod),
|
|
7674
7695
|
compressionMethod,
|
|
7675
7696
|
uncompressedSize,
|
|
7676
|
-
lastModDate:
|
|
7697
|
+
lastModDate: clampedLastModDate,
|
|
7677
7698
|
rawLastModDate: rawLastModDateOption,
|
|
7678
7699
|
rawFilename,
|
|
7679
7700
|
zip64CompressedSize,
|
|
@@ -7708,7 +7729,7 @@ function getHeaderInfo(options) {
|
|
|
7708
7729
|
localHeaderView,
|
|
7709
7730
|
headerArray,
|
|
7710
7731
|
headerView,
|
|
7711
|
-
lastModDate,
|
|
7732
|
+
lastModDate: storedLastModDate,
|
|
7712
7733
|
rawLastModDate,
|
|
7713
7734
|
encrypted,
|
|
7714
7735
|
compressed,
|
|
@@ -7880,14 +7901,15 @@ function updateLocalHeader({
|
|
|
7880
7901
|
|
|
7881
7902
|
|
|
7882
7903
|
async function closeFile(zipWriter, comment, options) {
|
|
7883
|
-
const directoryDataLength = createDirectoryRecords(zipWriter.fileEntries);
|
|
7904
|
+
const { directoryDataLength, zip64Entries } = createDirectoryRecords(zipWriter.fileEntries);
|
|
7884
7905
|
const { directoryStart, directoryEnd, directoryArray } = await writeDirectoryRecords(zipWriter, directoryDataLength, options);
|
|
7885
7906
|
const signatureLength = await writeDigitalSignatureRecord(zipWriter, directoryArray, options);
|
|
7886
|
-
await writeEndOfDirectoryRecord(zipWriter, comment, options, { directoryStart, directoryEnd, directoryDataLength, signatureLength });
|
|
7907
|
+
await writeEndOfDirectoryRecord(zipWriter, comment, options, { directoryStart, directoryEnd, directoryDataLength, signatureLength, zip64Entries });
|
|
7887
7908
|
}
|
|
7888
7909
|
|
|
7889
7910
|
function createDirectoryRecords(files) {
|
|
7890
7911
|
let directoryDataLength = 0;
|
|
7912
|
+
let zip64Entries = false;
|
|
7891
7913
|
for (const [, fileEntry] of files) {
|
|
7892
7914
|
const {
|
|
7893
7915
|
rawFilename,
|
|
@@ -7900,11 +7922,20 @@ function createDirectoryRecords(files) {
|
|
|
7900
7922
|
extendedTimestamp,
|
|
7901
7923
|
extraFieldExtendedTimestampFlag,
|
|
7902
7924
|
lastModDate,
|
|
7903
|
-
|
|
7904
|
-
zip64CompressedSize,
|
|
7925
|
+
zip64Enabled,
|
|
7905
7926
|
uncompressedSize,
|
|
7906
7927
|
compressedSize
|
|
7907
7928
|
} = fileEntry;
|
|
7929
|
+
let { zip64UncompressedSize, zip64CompressedSize } = fileEntry;
|
|
7930
|
+
if (!zip64Enabled) {
|
|
7931
|
+
if (zip64UncompressedSize && uncompressedSize < MAX_32_BITS) {
|
|
7932
|
+
zip64UncompressedSize = fileEntry.zip64UncompressedSize = false;
|
|
7933
|
+
}
|
|
7934
|
+
if (zip64CompressedSize && compressedSize < MAX_32_BITS) {
|
|
7935
|
+
zip64CompressedSize = fileEntry.zip64CompressedSize = false;
|
|
7936
|
+
}
|
|
7937
|
+
}
|
|
7938
|
+
zip64Entries = zip64Entries || zip64UncompressedSize || zip64CompressedSize;
|
|
7908
7939
|
const zip64Offset = fileEntry.offset >= MAX_32_BITS;
|
|
7909
7940
|
const zip64DiskNumberStart = fileEntry.diskNumberStart >= MAX_16_BITS;
|
|
7910
7941
|
let rawExtraFieldZip64;
|
|
@@ -7958,7 +7989,7 @@ function createDirectoryRecords(files) {
|
|
|
7958
7989
|
}
|
|
7959
7990
|
directoryDataLength += CENTRAL_FILE_HEADER_LENGTH + getLength(rawFilename, rawComment) + extraFieldLength;
|
|
7960
7991
|
}
|
|
7961
|
-
return directoryDataLength;
|
|
7992
|
+
return { directoryDataLength, zip64Entries };
|
|
7962
7993
|
}
|
|
7963
7994
|
|
|
7964
7995
|
async function writeDirectoryRecords(zipWriter, directoryDataLength, options) {
|
|
@@ -8078,7 +8109,7 @@ async function writeDigitalSignatureRecord(zipWriter, directoryArray, options) {
|
|
|
8078
8109
|
|
|
8079
8110
|
async function writeEndOfDirectoryRecord(zipWriter, comment, options, cdInfo) {
|
|
8080
8111
|
const { writer } = zipWriter;
|
|
8081
|
-
const { directoryStart, directoryEnd, signatureLength } = cdInfo;
|
|
8112
|
+
const { directoryStart, directoryEnd, signatureLength, zip64Entries } = cdInfo;
|
|
8082
8113
|
let { directoryDataLength } = cdInfo;
|
|
8083
8114
|
let fileEntriesLength = zipWriter.fileEntries.size;
|
|
8084
8115
|
let diskNumber = directoryStart.diskNumber;
|
|
@@ -8098,6 +8129,8 @@ async function writeEndOfDirectoryRecord(zipWriter, comment, options, cdInfo) {
|
|
|
8098
8129
|
} else {
|
|
8099
8130
|
zip64 = true;
|
|
8100
8131
|
}
|
|
8132
|
+
} else if (zip64 === UNDEFINED_VALUE && zip64Entries) {
|
|
8133
|
+
zip64 = true;
|
|
8101
8134
|
}
|
|
8102
8135
|
const endOfdirectoryRecord = createRecordWriter(zip64 ? ZIP64_END_OF_CENTRAL_DIR_TOTAL_LENGTH : END_OF_CENTRAL_DIR_LENGTH);
|
|
8103
8136
|
if (exceedsAvailableSize(writer, getLength(endOfdirectoryRecord.array) + commentLength)) {
|
|
@@ -8601,7 +8634,7 @@ function formatSupported(StreamClass, format) {
|
|
|
8601
8634
|
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
8602
8635
|
*/
|
|
8603
8636
|
|
|
8604
|
-
const VERSION = "2.11.
|
|
8637
|
+
const VERSION = "2.11.3";
|
|
8605
8638
|
|
|
8606
8639
|
/*
|
|
8607
8640
|
Copyright (c) 2025 Gildas Lormeau. All rights reserved.
|
|
@@ -9997,12 +10030,14 @@ class ZipDirectoryEntry extends ZipEntry {
|
|
|
9997
10030
|
if (options.bufferedWrite === UNDEFINED_VALUE) {
|
|
9998
10031
|
options.bufferedWrite = true;
|
|
9999
10032
|
}
|
|
10000
|
-
const
|
|
10033
|
+
const children = zipEntry.getChildren({ recursive: true });
|
|
10034
|
+
const entries = children.filter(child => !isImplicitDirectory(child)).map(child => {
|
|
10001
10035
|
const { name, entryOptions } = getChildEntryOptions(child, zipEntry, options);
|
|
10002
10036
|
return { name, size: child.directory ? 0 : getDeterminedSize(child, isPassThrough(child, options)), options: entryOptions };
|
|
10003
10037
|
});
|
|
10004
10038
|
const writeOrderGuaranteed = !options.bufferedWrite ||
|
|
10005
|
-
(entries.every(entry => entry.options.keepOrder !== false) &&
|
|
10039
|
+
(entries.every(entry => entry.options.keepOrder !== false) &&
|
|
10040
|
+
children.every(child => isImplicitDirectory(child) || !child.children.length));
|
|
10006
10041
|
return getEntriesSize(options, entries, writeOrderGuaranteed, options.globalComment);
|
|
10007
10042
|
}
|
|
10008
10043
|
|
|
@@ -11031,6 +11066,7 @@ exports.ERR_INVALID_MSDOS_DATA = ERR_INVALID_MSDOS_DATA;
|
|
|
11031
11066
|
exports.ERR_INVALID_PASSWORD = ERR_INVALID_PASSWORD;
|
|
11032
11067
|
exports.ERR_INVALID_PASSWORD_TYPE = ERR_INVALID_PASSWORD_TYPE;
|
|
11033
11068
|
exports.ERR_INVALID_PASS_THROUGH = ERR_INVALID_PASS_THROUGH;
|
|
11069
|
+
exports.ERR_INVALID_READER = ERR_INVALID_READER;
|
|
11034
11070
|
exports.ERR_INVALID_READER_OPTIONS = ERR_INVALID_READER_OPTIONS;
|
|
11035
11071
|
exports.ERR_INVALID_SIGNAL = ERR_INVALID_SIGNAL;
|
|
11036
11072
|
exports.ERR_INVALID_SIGNATURE_DATA = ERR_INVALID_SIGNATURE_DATA;
|
|
@@ -11059,6 +11095,7 @@ exports.ERR_UNSUPPORTED_ENCRYPTION = ERR_UNSUPPORTED_ENCRYPTION;
|
|
|
11059
11095
|
exports.ERR_UNSUPPORTED_ENCRYPTION_PASS_THROUGH = ERR_UNSUPPORTED_ENCRYPTION_PASS_THROUGH;
|
|
11060
11096
|
exports.ERR_UNSUPPORTED_ENCRYPTION_USDZ = ERR_UNSUPPORTED_ENCRYPTION_USDZ;
|
|
11061
11097
|
exports.ERR_UNSUPPORTED_FORMAT = ERR_UNSUPPORTED_FORMAT;
|
|
11098
|
+
exports.ERR_UNSUPPORTED_SPLIT_USDZ = ERR_UNSUPPORTED_SPLIT_USDZ;
|
|
11062
11099
|
exports.ERR_UNSUPPORTED_UINT64 = ERR_UNSUPPORTED_UINT64;
|
|
11063
11100
|
exports.ERR_WORKER_STARTUP_TIMEOUT = ERR_WORKER_STARTUP_TIMEOUT;
|
|
11064
11101
|
exports.ERR_WRITER_NOT_INITIALIZED = ERR_WRITER_NOT_INITIALIZED;
|
package/index.d.cts
CHANGED
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
/**
|
|
162
162
|
* Represents the `FileSystemEntry` class.
|
|
163
163
|
*
|
|
164
|
-
* @see {@link https://wicg.github.io/entries-api/#api-entry
|
|
164
|
+
* @see {@link https://wicg.github.io/entries-api/#api-entry}
|
|
165
165
|
*/
|
|
166
166
|
// deno-lint-ignore no-empty-interface
|
|
167
167
|
interface FileSystemEntryLike {}
|
|
@@ -177,7 +177,7 @@ interface FileSystemHandleLike {}
|
|
|
177
177
|
/**
|
|
178
178
|
* Represents a generic `TransformStream` class.
|
|
179
179
|
*
|
|
180
|
-
* @see {@link https://streams.spec.whatwg.org/#generictransformstream
|
|
180
|
+
* @see {@link https://streams.spec.whatwg.org/#generictransformstream}
|
|
181
181
|
*/
|
|
182
182
|
declare class TransformStreamLike {
|
|
183
183
|
/**
|
|
@@ -3027,6 +3027,8 @@ export interface ZipWriterCloseOptions extends EntryOnprogressOptions {
|
|
|
3027
3027
|
/**
|
|
3028
3028
|
* `true` to use Zip64 to write the entries directory.
|
|
3029
3029
|
*
|
|
3030
|
+
* Zip64 is also used when the directory does not fit in the standard record, or when an entry is stored with Zip64.
|
|
3031
|
+
*
|
|
3030
3032
|
* @defaultValue false
|
|
3031
3033
|
*/
|
|
3032
3034
|
zip64?: boolean;
|
|
@@ -3059,6 +3061,8 @@ export interface ZipWriterConstructorOptions extends WorkerConfiguration {
|
|
|
3059
3061
|
* `true` to use Zip64 to store the entry.
|
|
3060
3062
|
*
|
|
3061
3063
|
* `zip64` is automatically set to `true` when necessary (e.g. compressed data larger than 4GB or with unknown size).
|
|
3064
|
+
* An entry of unknown size is stored with Zip64 in its local header, because the size of the data descriptor must be
|
|
3065
|
+
* chosen before writing the data. Its central directory record drops Zip64 when the actual sizes fit in 32 bits.
|
|
3062
3066
|
*
|
|
3063
3067
|
* @defaultValue false
|
|
3064
3068
|
*/
|
|
@@ -3080,6 +3084,12 @@ export interface ZipWriterConstructorOptions extends WorkerConfiguration {
|
|
|
3080
3084
|
* between platforms. Set `useCompressionStream` to `false` to get deterministic output across
|
|
3081
3085
|
* platforms.
|
|
3082
3086
|
*
|
|
3087
|
+
* When no deflate implementation is available at all, i.e. the environment provides no usable
|
|
3088
|
+
* `CompressionStream` and the embedded implementation cannot be loaded, the entry is stored
|
|
3089
|
+
* instead of being compressed rather than failing. The {@link EntryMetaData#compressionMethod} of
|
|
3090
|
+
* the entry returned by {@link ZipWriter#add} is `0` in that case, which is how the fallback is
|
|
3091
|
+
* detected.
|
|
3092
|
+
*
|
|
3083
3093
|
* @defaultValue 6
|
|
3084
3094
|
*/
|
|
3085
3095
|
level?: number;
|
|
@@ -3389,6 +3399,8 @@ export interface ZipWriterConstructorOptions extends WorkerConfiguration {
|
|
|
3389
3399
|
* boundaries and stored uncompressed unless the {@link ZipWriterConstructorOptions#level} or
|
|
3390
3400
|
* {@link ZipWriterAddDataOptions#compressionMethod} options are set explicitly. Setting the
|
|
3391
3401
|
* {@link ZipWriterConstructorOptions#password} option throws an {@link ERR_UNSUPPORTED_ENCRYPTION_USDZ} error.
|
|
3402
|
+
* Writing into a split zip file throws an {@link ERR_UNSUPPORTED_SPLIT_USDZ} error, since the 64-byte alignment
|
|
3403
|
+
* of an entry is invalidated when the disk it is written into rolls over.
|
|
3392
3404
|
*
|
|
3393
3405
|
* These constraints apply to the entries written with {@link ZipWriter#add} only. The entries copied with
|
|
3394
3406
|
* {@link ZipWriter#appendZip} keep the layout of the source zip file and are not checked, so appending a
|
|
@@ -4634,6 +4646,10 @@ export const ERR_INVALID_ENCRYPTION_STRENGTH: string;
|
|
|
4634
4646
|
* Unsupported encryption in USDZ files error
|
|
4635
4647
|
*/
|
|
4636
4648
|
export const ERR_UNSUPPORTED_ENCRYPTION_USDZ: string;
|
|
4649
|
+
/**
|
|
4650
|
+
* Unsupported split zip file in USDZ files error
|
|
4651
|
+
*/
|
|
4652
|
+
export const ERR_UNSUPPORTED_SPLIT_USDZ: string;
|
|
4637
4653
|
/**
|
|
4638
4654
|
* Unsupported encryption in pass-through entries error
|
|
4639
4655
|
*/
|
|
@@ -4728,6 +4744,15 @@ export const ERR_UNDETERMINED_SIZE: string;
|
|
|
4728
4744
|
* is not there. Directory entries are exempt, they have no content to write as-is.
|
|
4729
4745
|
*/
|
|
4730
4746
|
export const ERR_UNDEFINED_READER: string;
|
|
4747
|
+
/**
|
|
4748
|
+
* Invalid reader error
|
|
4749
|
+
*
|
|
4750
|
+
* @remarks Thrown when the second argument of {@link ZipWriter#add} is neither a {@link Reader} instance, a
|
|
4751
|
+
* `ReadableStream` instance, nor an object exposing a `readable` property. A `Blob`, a string or a
|
|
4752
|
+
* `Uint8Array` must be wrapped in the matching Reader class, e.g. {@link BlobReader}, {@link TextReader}
|
|
4753
|
+
* or {@link Uint8ArrayReader}.
|
|
4754
|
+
*/
|
|
4755
|
+
export const ERR_INVALID_READER: string;
|
|
4731
4756
|
/**
|
|
4732
4757
|
* Writer not initialized error
|
|
4733
4758
|
*/
|
package/index.d.ts
CHANGED
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
/**
|
|
162
162
|
* Represents the `FileSystemEntry` class.
|
|
163
163
|
*
|
|
164
|
-
* @see {@link https://wicg.github.io/entries-api/#api-entry
|
|
164
|
+
* @see {@link https://wicg.github.io/entries-api/#api-entry}
|
|
165
165
|
*/
|
|
166
166
|
// deno-lint-ignore no-empty-interface
|
|
167
167
|
interface FileSystemEntryLike {}
|
|
@@ -177,7 +177,7 @@ interface FileSystemHandleLike {}
|
|
|
177
177
|
/**
|
|
178
178
|
* Represents a generic `TransformStream` class.
|
|
179
179
|
*
|
|
180
|
-
* @see {@link https://streams.spec.whatwg.org/#generictransformstream
|
|
180
|
+
* @see {@link https://streams.spec.whatwg.org/#generictransformstream}
|
|
181
181
|
*/
|
|
182
182
|
declare class TransformStreamLike {
|
|
183
183
|
/**
|
|
@@ -3027,6 +3027,8 @@ export interface ZipWriterCloseOptions extends EntryOnprogressOptions {
|
|
|
3027
3027
|
/**
|
|
3028
3028
|
* `true` to use Zip64 to write the entries directory.
|
|
3029
3029
|
*
|
|
3030
|
+
* Zip64 is also used when the directory does not fit in the standard record, or when an entry is stored with Zip64.
|
|
3031
|
+
*
|
|
3030
3032
|
* @defaultValue false
|
|
3031
3033
|
*/
|
|
3032
3034
|
zip64?: boolean;
|
|
@@ -3059,6 +3061,8 @@ export interface ZipWriterConstructorOptions extends WorkerConfiguration {
|
|
|
3059
3061
|
* `true` to use Zip64 to store the entry.
|
|
3060
3062
|
*
|
|
3061
3063
|
* `zip64` is automatically set to `true` when necessary (e.g. compressed data larger than 4GB or with unknown size).
|
|
3064
|
+
* An entry of unknown size is stored with Zip64 in its local header, because the size of the data descriptor must be
|
|
3065
|
+
* chosen before writing the data. Its central directory record drops Zip64 when the actual sizes fit in 32 bits.
|
|
3062
3066
|
*
|
|
3063
3067
|
* @defaultValue false
|
|
3064
3068
|
*/
|
|
@@ -3080,6 +3084,12 @@ export interface ZipWriterConstructorOptions extends WorkerConfiguration {
|
|
|
3080
3084
|
* between platforms. Set `useCompressionStream` to `false` to get deterministic output across
|
|
3081
3085
|
* platforms.
|
|
3082
3086
|
*
|
|
3087
|
+
* When no deflate implementation is available at all, i.e. the environment provides no usable
|
|
3088
|
+
* `CompressionStream` and the embedded implementation cannot be loaded, the entry is stored
|
|
3089
|
+
* instead of being compressed rather than failing. The {@link EntryMetaData#compressionMethod} of
|
|
3090
|
+
* the entry returned by {@link ZipWriter#add} is `0` in that case, which is how the fallback is
|
|
3091
|
+
* detected.
|
|
3092
|
+
*
|
|
3083
3093
|
* @defaultValue 6
|
|
3084
3094
|
*/
|
|
3085
3095
|
level?: number;
|
|
@@ -3389,6 +3399,8 @@ export interface ZipWriterConstructorOptions extends WorkerConfiguration {
|
|
|
3389
3399
|
* boundaries and stored uncompressed unless the {@link ZipWriterConstructorOptions#level} or
|
|
3390
3400
|
* {@link ZipWriterAddDataOptions#compressionMethod} options are set explicitly. Setting the
|
|
3391
3401
|
* {@link ZipWriterConstructorOptions#password} option throws an {@link ERR_UNSUPPORTED_ENCRYPTION_USDZ} error.
|
|
3402
|
+
* Writing into a split zip file throws an {@link ERR_UNSUPPORTED_SPLIT_USDZ} error, since the 64-byte alignment
|
|
3403
|
+
* of an entry is invalidated when the disk it is written into rolls over.
|
|
3392
3404
|
*
|
|
3393
3405
|
* These constraints apply to the entries written with {@link ZipWriter#add} only. The entries copied with
|
|
3394
3406
|
* {@link ZipWriter#appendZip} keep the layout of the source zip file and are not checked, so appending a
|
|
@@ -4634,6 +4646,10 @@ export const ERR_INVALID_ENCRYPTION_STRENGTH: string;
|
|
|
4634
4646
|
* Unsupported encryption in USDZ files error
|
|
4635
4647
|
*/
|
|
4636
4648
|
export const ERR_UNSUPPORTED_ENCRYPTION_USDZ: string;
|
|
4649
|
+
/**
|
|
4650
|
+
* Unsupported split zip file in USDZ files error
|
|
4651
|
+
*/
|
|
4652
|
+
export const ERR_UNSUPPORTED_SPLIT_USDZ: string;
|
|
4637
4653
|
/**
|
|
4638
4654
|
* Unsupported encryption in pass-through entries error
|
|
4639
4655
|
*/
|
|
@@ -4728,6 +4744,15 @@ export const ERR_UNDETERMINED_SIZE: string;
|
|
|
4728
4744
|
* is not there. Directory entries are exempt, they have no content to write as-is.
|
|
4729
4745
|
*/
|
|
4730
4746
|
export const ERR_UNDEFINED_READER: string;
|
|
4747
|
+
/**
|
|
4748
|
+
* Invalid reader error
|
|
4749
|
+
*
|
|
4750
|
+
* @remarks Thrown when the second argument of {@link ZipWriter#add} is neither a {@link Reader} instance, a
|
|
4751
|
+
* `ReadableStream` instance, nor an object exposing a `readable` property. A `Blob`, a string or a
|
|
4752
|
+
* `Uint8Array` must be wrapped in the matching Reader class, e.g. {@link BlobReader}, {@link TextReader}
|
|
4753
|
+
* or {@link Uint8ArrayReader}.
|
|
4754
|
+
*/
|
|
4755
|
+
export const ERR_INVALID_READER: string;
|
|
4731
4756
|
/**
|
|
4732
4757
|
* Writer not initialized error
|
|
4733
4758
|
*/
|