@zip.js/zip.js 2.8.59 → 2.8.61
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/deno.json +2 -2
- package/dist/zip-core-external.js +167 -37
- package/dist/zip-core-external.min.js +1 -1
- package/dist/zip-core.js +143 -20
- package/dist/zip-core.min.js +1 -1
- package/dist/zip-fs-core-external.js +173 -45
- package/dist/zip-fs-core-external.min.js +1 -1
- package/dist/zip-fs-core.js +5326 -3928
- package/dist/zip-fs-core.min.js +1 -1
- package/dist/zip-fs-external.js +173 -45
- package/dist/zip-fs-external.min.js +1 -1
- package/dist/zip-fs-native.js +151 -30
- package/dist/zip-fs-native.min.js +1 -1
- package/dist/zip-fs.js +176 -45
- package/dist/zip-fs.min.js +1 -1
- package/dist/zip-legacy.js +145 -22
- package/dist/zip-legacy.min.js +1 -1
- package/dist/zip-native.js +145 -22
- package/dist/zip-native.min.js +1 -1
- package/dist/zip-web-worker-native.js +1 -1
- package/dist/zip-web-worker.js +1 -1
- package/dist/zip.js +170 -37
- package/dist/zip.min.js +1 -1
- package/index-native.cjs +151 -30
- package/index-native.min.js +1 -1
- package/index.cjs +176 -45
- package/index.d.cts +134 -1
- package/index.d.ts +134 -1
- package/index.min.js +1 -1
- package/lib/core/codec-registry.js +5 -0
- package/lib/core/compression-methods.js +93 -0
- package/lib/core/streams/zip-entry-stream.js +7 -3
- package/lib/core/streams/zlib-wasm/zlib-streams.js +18 -8
- package/lib/core/version.js +31 -0
- package/lib/core/web-worker-inline-native.js +1 -1
- package/lib/core/web-worker-inline-wasm.js +1 -1
- package/lib/core/zip-fs.js +5 -4
- package/lib/core/zip-writer.js +38 -31
- package/lib/zip-core-base.js +7 -0
- package/lib/zip-fs-core.js +32 -0
- package/package.json +4 -3
- package/release.sh +47 -0
- package/sync-versions.js +26 -0
package/deno.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zip-js/zip-js",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.61",
|
|
4
4
|
"exports": {
|
|
5
5
|
".": "./index.js",
|
|
6
6
|
"./external": "./lib/zip-fs-external.js",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"mangled-property-names.js",
|
|
53
53
|
"mime-types.json",
|
|
54
54
|
"generate-mime-type-data.js",
|
|
55
|
-
"sync-
|
|
55
|
+
"sync-versions.js",
|
|
56
56
|
"tsconfig.json",
|
|
57
57
|
".vscode",
|
|
58
58
|
".eslintrc.json",
|
|
@@ -2109,6 +2109,10 @@ function getRegisteredCodec(compressionMethod) {
|
|
|
2109
2109
|
return registeredCodecs.get(compressionMethod);
|
|
2110
2110
|
}
|
|
2111
2111
|
|
|
2112
|
+
function getRegisteredCodecs() {
|
|
2113
|
+
return Array.from(registeredCodecs.values(), codec => Object.assign({}, codec, codecStreams.get(codec.format)));
|
|
2114
|
+
}
|
|
2115
|
+
|
|
2112
2116
|
function getCodecStreams(format) {
|
|
2113
2117
|
return codecStreams.get(format);
|
|
2114
2118
|
}
|
|
@@ -2160,9 +2164,9 @@ const ERR_INVALID_UNCOMPRESSED_SIZE = "Invalid uncompressed size";
|
|
|
2160
2164
|
const ERR_INVALID_COMPRESSED_DATA = "Invalid compressed data";
|
|
2161
2165
|
const ERR_INVALID_CRC32 = ERR_INVALID_SIGNATURE;
|
|
2162
2166
|
const ERR_UNSUPPORTED_COMPRESSION$2 = "Compression method not supported";
|
|
2163
|
-
const FORMAT_DEFLATE_RAW = "deflate-raw";
|
|
2164
|
-
const FORMAT_DEFLATE64_RAW = "deflate64-raw";
|
|
2165
|
-
const FORMAT_GZIP = "gzip";
|
|
2167
|
+
const FORMAT_DEFLATE_RAW$1 = "deflate-raw";
|
|
2168
|
+
const FORMAT_DEFLATE64_RAW$1 = "deflate64-raw";
|
|
2169
|
+
const FORMAT_GZIP$1 = "gzip";
|
|
2166
2170
|
const GZIP_HEADER_LENGTH = 10;
|
|
2167
2171
|
const GZIP_TRAILER_LENGTH = 8;
|
|
2168
2172
|
const GZIP_HEADER_BYTES = [0x1f, 0x8b, 0x08];
|
|
@@ -2172,7 +2176,7 @@ class DeflateStream extends TransformStream {
|
|
|
2172
2176
|
|
|
2173
2177
|
constructor(options, { chunkSize, CompressionStreamFallback, CompressionStream }) {
|
|
2174
2178
|
super({});
|
|
2175
|
-
const { compressed, encrypted, useCompressionStream, zipCrypto, computeCrc32, level, deflate64, format, compressionMethod } = options;
|
|
2179
|
+
const { compressed, encrypted, useCompressionStream, zipCrypto, computeCrc32, level, deflate64, format, compressionMethod, inputSize } = options;
|
|
2176
2180
|
const stream = this;
|
|
2177
2181
|
let crc32Stream, encryptionStream, gzipCrc32Stream;
|
|
2178
2182
|
let readable = super.readable;
|
|
@@ -2185,10 +2189,10 @@ class DeflateStream extends TransformStream {
|
|
|
2185
2189
|
}
|
|
2186
2190
|
if (compressed) {
|
|
2187
2191
|
if (codecStreams) {
|
|
2188
|
-
readable = pipeThroughBackpressured(readable, createCodecStream(codecStreams.CompressionStream, format, { level, chunkSize, compressionMethod }));
|
|
2192
|
+
readable = pipeThroughBackpressured(readable, createCodecStream(codecStreams.CompressionStream, format, { level, chunkSize, compressionMethod, uncompressedSize: inputSize }));
|
|
2189
2193
|
} else if (useGzipCrc32) {
|
|
2190
2194
|
gzipCrc32Stream = new GzipToRawDeflateStream();
|
|
2191
|
-
readable = pipeThroughBackpressured(readable, new CompressionStream(FORMAT_GZIP));
|
|
2195
|
+
readable = pipeThroughBackpressured(readable, new CompressionStream(FORMAT_GZIP$1));
|
|
2192
2196
|
readable = pipeThrough(readable, gzipCrc32Stream);
|
|
2193
2197
|
} else {
|
|
2194
2198
|
try {
|
|
@@ -2196,7 +2200,7 @@ class DeflateStream extends TransformStream {
|
|
|
2196
2200
|
} catch (error) {
|
|
2197
2201
|
let gzipStream;
|
|
2198
2202
|
try {
|
|
2199
|
-
gzipStream = new CompressionStream(FORMAT_GZIP);
|
|
2203
|
+
gzipStream = new CompressionStream(FORMAT_GZIP$1);
|
|
2200
2204
|
} catch {
|
|
2201
2205
|
throw error;
|
|
2202
2206
|
}
|
|
@@ -2360,7 +2364,7 @@ class InflateStream extends TransformStream {
|
|
|
2360
2364
|
}
|
|
2361
2365
|
let gzipStream;
|
|
2362
2366
|
try {
|
|
2363
|
-
gzipStream = new DecompressionStream(FORMAT_GZIP);
|
|
2367
|
+
gzipStream = new DecompressionStream(FORMAT_GZIP$1);
|
|
2364
2368
|
} catch {
|
|
2365
2369
|
throw error;
|
|
2366
2370
|
}
|
|
@@ -2409,11 +2413,11 @@ function supportsFormat(StreamClass, format) {
|
|
|
2409
2413
|
}
|
|
2410
2414
|
|
|
2411
2415
|
function supportsDeflateRaw(StreamClass) {
|
|
2412
|
-
return supportsFormat(StreamClass, FORMAT_DEFLATE_RAW);
|
|
2416
|
+
return supportsFormat(StreamClass, FORMAT_DEFLATE_RAW$1);
|
|
2413
2417
|
}
|
|
2414
2418
|
|
|
2415
2419
|
function supportsGzip(StreamClass) {
|
|
2416
|
-
return supportsFormat(StreamClass, FORMAT_GZIP);
|
|
2420
|
+
return supportsFormat(StreamClass, FORMAT_GZIP$1);
|
|
2417
2421
|
}
|
|
2418
2422
|
|
|
2419
2423
|
function setReadable(stream, readable, flush) {
|
|
@@ -2436,7 +2440,7 @@ function pipeThroughCompressionStream(readable, useCompressionStream, options, C
|
|
|
2436
2440
|
const Stream = useCompressionStream && CompressionStreamNative ?
|
|
2437
2441
|
CompressionStreamNative :
|
|
2438
2442
|
CompressionStreamFallback || CompressionStreamNative;
|
|
2439
|
-
const format = options.deflate64 ? FORMAT_DEFLATE64_RAW : FORMAT_DEFLATE_RAW;
|
|
2443
|
+
const format = options.deflate64 ? FORMAT_DEFLATE64_RAW$1 : FORMAT_DEFLATE_RAW$1;
|
|
2440
2444
|
let codecStream;
|
|
2441
2445
|
try {
|
|
2442
2446
|
codecStream = new Stream(format, options);
|
|
@@ -6681,6 +6685,13 @@ async function addFile(zipWriter, name, reader, options) {
|
|
|
6681
6685
|
const { comment } = metadataInfo;
|
|
6682
6686
|
const extraField = options[PROPERTY_NAME_EXTRA_FIELD];
|
|
6683
6687
|
zipWriter.fileEntries.set(name, UNDEFINED_VALUE);
|
|
6688
|
+
const previousFileEntry = zipWriter.lastFileEntry;
|
|
6689
|
+
const pendingFileEntry = {};
|
|
6690
|
+
let releaseLockFileEntry;
|
|
6691
|
+
if (metadataInfo.resolvedOptions.keepOrder) {
|
|
6692
|
+
pendingFileEntry.lockFileEntry = new Promise(resolve => releaseLockFileEntry = resolve);
|
|
6693
|
+
}
|
|
6694
|
+
zipWriter.lastFileEntry = pendingFileEntry;
|
|
6684
6695
|
let fileEntry;
|
|
6685
6696
|
try {
|
|
6686
6697
|
const { resolvedOptions } = metadataInfo;
|
|
@@ -6702,10 +6713,21 @@ async function addFile(zipWriter, name, reader, options) {
|
|
|
6702
6713
|
const headerInfo = getHeaderInfo(options);
|
|
6703
6714
|
const dataDescriptorInfo = getDataDescriptorInfo(options);
|
|
6704
6715
|
const metadataSize = getLength(headerInfo.localHeaderArray, dataDescriptorInfo.dataDescriptorArray);
|
|
6705
|
-
fileEntry = await getFileEntry(zipWriter, name, reader, {
|
|
6716
|
+
fileEntry = await getFileEntry(zipWriter, name, reader, {
|
|
6717
|
+
headerInfo,
|
|
6718
|
+
dataDescriptorInfo,
|
|
6719
|
+
metadataSize,
|
|
6720
|
+
fileEntry: pendingFileEntry,
|
|
6721
|
+
previousFileEntry,
|
|
6722
|
+
releaseLockFileEntry
|
|
6723
|
+
}, options);
|
|
6706
6724
|
} catch (error) {
|
|
6707
6725
|
zipWriter.fileEntries.delete(name);
|
|
6708
6726
|
throw error;
|
|
6727
|
+
} finally {
|
|
6728
|
+
if (releaseLockFileEntry) {
|
|
6729
|
+
releaseLockFileEntry(previousFileEntry && previousFileEntry.lockFileEntry);
|
|
6730
|
+
}
|
|
6709
6731
|
}
|
|
6710
6732
|
Object.assign(fileEntry, {
|
|
6711
6733
|
name,
|
|
@@ -7091,27 +7113,23 @@ async function getFileEntry(zipWriter, name, reader, entryInfo, options) {
|
|
|
7091
7113
|
signal
|
|
7092
7114
|
} = options;
|
|
7093
7115
|
const {
|
|
7094
|
-
headerInfo
|
|
7116
|
+
headerInfo,
|
|
7117
|
+
fileEntry: pendingFileEntry,
|
|
7118
|
+
previousFileEntry,
|
|
7119
|
+
releaseLockFileEntry
|
|
7095
7120
|
} = entryInfo;
|
|
7096
7121
|
const usdz = zipWriter.options[OPTION_USDZ];
|
|
7097
|
-
|
|
7098
|
-
let fileEntry = {};
|
|
7122
|
+
let fileEntry = pendingFileEntry;
|
|
7099
7123
|
let bufferedWrite;
|
|
7100
7124
|
let releaseLockWriter;
|
|
7101
|
-
let releaseLockCurrentFileEntry;
|
|
7102
7125
|
let writingBufferedEntryData;
|
|
7103
7126
|
let writingEntryData;
|
|
7104
7127
|
let writerSizeBeforeEntry;
|
|
7105
7128
|
let flushedBufferedSize = 0;
|
|
7106
7129
|
let fileWriter;
|
|
7130
|
+
const lockPreviousFileEntry = keepOrder && previousFileEntry ? previousFileEntry.lockFileEntry : UNDEFINED_VALUE;
|
|
7107
7131
|
fileEntries.set(name, fileEntry);
|
|
7108
|
-
zipWriter.lastFileEntry = fileEntry;
|
|
7109
7132
|
try {
|
|
7110
|
-
let lockPreviousFileEntry;
|
|
7111
|
-
if (keepOrder) {
|
|
7112
|
-
lockPreviousFileEntry = previousFileEntry && previousFileEntry.lockFileEntry;
|
|
7113
|
-
requestLockCurrentFileEntry();
|
|
7114
|
-
}
|
|
7115
7133
|
if (options.bufferedWrite || !keepOrder || zipWriter.writerLocked || zipWriter.bufferedWrites || (!dataDescriptor && !emptyEntry)) {
|
|
7116
7134
|
bufferedWrite = true;
|
|
7117
7135
|
zipWriter.bufferedWrites++;
|
|
@@ -7124,6 +7142,7 @@ async function getFileEntry(zipWriter, name, reader, entryInfo, options) {
|
|
|
7124
7142
|
await initStream(writer);
|
|
7125
7143
|
} else {
|
|
7126
7144
|
fileWriter = writer;
|
|
7145
|
+
await lockPreviousFileEntry;
|
|
7127
7146
|
await requestLockWriter();
|
|
7128
7147
|
}
|
|
7129
7148
|
await initStream(fileWriter);
|
|
@@ -7136,7 +7155,6 @@ async function getFileEntry(zipWriter, name, reader, entryInfo, options) {
|
|
|
7136
7155
|
}
|
|
7137
7156
|
const { localHeaderArray } = headerInfo;
|
|
7138
7157
|
if (!bufferedWrite) {
|
|
7139
|
-
await lockPreviousFileEntry;
|
|
7140
7158
|
await skipDiskIfNeeded();
|
|
7141
7159
|
}
|
|
7142
7160
|
const diskNumberStart = getDiskNumber(writer);
|
|
@@ -7201,8 +7219,8 @@ async function getFileEntry(zipWriter, name, reader, entryInfo, options) {
|
|
|
7201
7219
|
if (bufferedWrite) {
|
|
7202
7220
|
zipWriter.bufferedWrites--;
|
|
7203
7221
|
}
|
|
7204
|
-
if (
|
|
7205
|
-
|
|
7222
|
+
if (releaseLockFileEntry) {
|
|
7223
|
+
releaseLockFileEntry(lockPreviousFileEntry);
|
|
7206
7224
|
}
|
|
7207
7225
|
if (releaseLockWriter) {
|
|
7208
7226
|
releaseLockWriter();
|
|
@@ -7216,10 +7234,6 @@ async function getFileEntry(zipWriter, name, reader, entryInfo, options) {
|
|
|
7216
7234
|
}
|
|
7217
7235
|
}
|
|
7218
7236
|
|
|
7219
|
-
function requestLockCurrentFileEntry() {
|
|
7220
|
-
fileEntry.lockFileEntry = new Promise(resolve => releaseLockCurrentFileEntry = resolve);
|
|
7221
|
-
}
|
|
7222
|
-
|
|
7223
7237
|
async function requestLockWriter() {
|
|
7224
7238
|
zipWriter.writerLocked = true;
|
|
7225
7239
|
const { lockWriter } = zipWriter;
|
|
@@ -7354,6 +7368,7 @@ async function createFileEntry(reader, writer, { diskNumberStart, lockFileEntry
|
|
|
7354
7368
|
const workerOptions = {
|
|
7355
7369
|
options: {
|
|
7356
7370
|
codecType: CODEC_DEFLATE,
|
|
7371
|
+
inputSize: size,
|
|
7357
7372
|
level,
|
|
7358
7373
|
rawPassword,
|
|
7359
7374
|
password,
|
|
@@ -8464,6 +8479,111 @@ function getMimeType() {
|
|
|
8464
8479
|
*/
|
|
8465
8480
|
|
|
8466
8481
|
|
|
8482
|
+
function getSupportedCompressionMethods() {
|
|
8483
|
+
const { CompressionStream, DecompressionStream, CompressionStreamFallback, DecompressionStreamFallback } = getConfiguration();
|
|
8484
|
+
const supportedMethods = [{
|
|
8485
|
+
compressionMethod: COMPRESSION_METHOD_STORE,
|
|
8486
|
+
compression: true,
|
|
8487
|
+
decompression: true,
|
|
8488
|
+
registered: false
|
|
8489
|
+
}, {
|
|
8490
|
+
compressionMethod: COMPRESSION_METHOD_DEFLATE,
|
|
8491
|
+
compression: formatSupported(CompressionStreamFallback, FORMAT_DEFLATE_RAW$1) ||
|
|
8492
|
+
formatSupported(CompressionStream, FORMAT_DEFLATE_RAW$1) || formatSupported(CompressionStream, FORMAT_GZIP$1),
|
|
8493
|
+
decompression: formatSupported(DecompressionStreamFallback, FORMAT_DEFLATE_RAW$1) ||
|
|
8494
|
+
formatSupported(DecompressionStream, FORMAT_DEFLATE_RAW$1) || formatSupported(DecompressionStream, FORMAT_GZIP$1),
|
|
8495
|
+
registered: false
|
|
8496
|
+
}, {
|
|
8497
|
+
compressionMethod: COMPRESSION_METHOD_DEFLATE_64,
|
|
8498
|
+
compression: false,
|
|
8499
|
+
decompression: formatSupported(DecompressionStreamFallback, FORMAT_DEFLATE64_RAW$1) ||
|
|
8500
|
+
formatSupported(DecompressionStream, FORMAT_DEFLATE64_RAW$1),
|
|
8501
|
+
registered: false
|
|
8502
|
+
}];
|
|
8503
|
+
for (const codec of getRegisteredCodecs()) {
|
|
8504
|
+
const codecStreams = getCodecStreams(codec.format);
|
|
8505
|
+
supportedMethods.push({
|
|
8506
|
+
compressionMethod: codec.compressionMethod,
|
|
8507
|
+
// deno-lint-ignore valid-typeof
|
|
8508
|
+
compression: codecStreams ? typeof codecStreams.CompressionStream == FUNCTION_TYPE : UNDEFINED_VALUE,
|
|
8509
|
+
// deno-lint-ignore valid-typeof
|
|
8510
|
+
decompression: codecStreams ? typeof codecStreams.DecompressionStream == FUNCTION_TYPE : UNDEFINED_VALUE,
|
|
8511
|
+
registered: true
|
|
8512
|
+
});
|
|
8513
|
+
}
|
|
8514
|
+
return supportedMethods;
|
|
8515
|
+
}
|
|
8516
|
+
|
|
8517
|
+
function formatSupported(StreamClass, format) {
|
|
8518
|
+
if (!StreamClass) {
|
|
8519
|
+
return false;
|
|
8520
|
+
}
|
|
8521
|
+
const { supportedFormats } = StreamClass;
|
|
8522
|
+
if (supportedFormats) {
|
|
8523
|
+
return supportedFormats.includes(format);
|
|
8524
|
+
}
|
|
8525
|
+
return supportsFormat(StreamClass, format);
|
|
8526
|
+
}
|
|
8527
|
+
|
|
8528
|
+
/*
|
|
8529
|
+
Copyright (c) 2025 Gildas Lormeau. All rights reserved.
|
|
8530
|
+
|
|
8531
|
+
Redistribution and use in source and binary forms, with or without
|
|
8532
|
+
modification, are permitted provided that the following conditions are met:
|
|
8533
|
+
|
|
8534
|
+
1. Redistributions of source code must retain the above copyright notice,
|
|
8535
|
+
this list of conditions and the following disclaimer.
|
|
8536
|
+
|
|
8537
|
+
2. Redistributions in binary form must reproduce the above copyright
|
|
8538
|
+
notice, this list of conditions and the following disclaimer in
|
|
8539
|
+
the documentation and/or other materials provided with the distribution.
|
|
8540
|
+
|
|
8541
|
+
3. The names of the authors may not be used to endorse or promote products
|
|
8542
|
+
derived from this software without specific prior written permission.
|
|
8543
|
+
|
|
8544
|
+
THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
|
|
8545
|
+
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
|
8546
|
+
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
|
|
8547
|
+
INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
8548
|
+
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
8549
|
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
|
8550
|
+
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
8551
|
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
8552
|
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
|
8553
|
+
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
8554
|
+
*/
|
|
8555
|
+
|
|
8556
|
+
const VERSION = "2.8.61";
|
|
8557
|
+
|
|
8558
|
+
/*
|
|
8559
|
+
Copyright (c) 2025 Gildas Lormeau. All rights reserved.
|
|
8560
|
+
|
|
8561
|
+
Redistribution and use in source and binary forms, with or without
|
|
8562
|
+
modification, are permitted provided that the following conditions are met:
|
|
8563
|
+
|
|
8564
|
+
1. Redistributions of source code must retain the above copyright notice,
|
|
8565
|
+
this list of conditions and the following disclaimer.
|
|
8566
|
+
|
|
8567
|
+
2. Redistributions in binary form must reproduce the above copyright
|
|
8568
|
+
notice, this list of conditions and the following disclaimer in
|
|
8569
|
+
the documentation and/or other materials provided with the distribution.
|
|
8570
|
+
|
|
8571
|
+
3. The names of the authors may not be used to endorse or promote products
|
|
8572
|
+
derived from this software without specific prior written permission.
|
|
8573
|
+
|
|
8574
|
+
THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
|
|
8575
|
+
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
|
8576
|
+
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
|
|
8577
|
+
INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
8578
|
+
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
8579
|
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
|
8580
|
+
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
8581
|
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
8582
|
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
|
8583
|
+
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
8584
|
+
*/
|
|
8585
|
+
|
|
8586
|
+
|
|
8467
8587
|
const DEFAULT_THRESHOLD$2 = 1024 * 1024;
|
|
8468
8588
|
const DEFAULT_DIRECTORY_NAME$1 = ".zip.js-temp";
|
|
8469
8589
|
|
|
@@ -8912,6 +9032,11 @@ try {
|
|
|
8912
9032
|
|
|
8913
9033
|
/* global TransformStream */
|
|
8914
9034
|
|
|
9035
|
+
const FORMAT_DEFLATE = "deflate";
|
|
9036
|
+
const FORMAT_DEFLATE_RAW = "deflate-raw";
|
|
9037
|
+
const FORMAT_DEFLATE64_RAW = "deflate64-raw";
|
|
9038
|
+
const FORMAT_GZIP = "gzip";
|
|
9039
|
+
|
|
8915
9040
|
let wasm, malloc, free, memory, initError;
|
|
8916
9041
|
|
|
8917
9042
|
function setWasmExports(wasmAPI) {
|
|
@@ -8957,15 +9082,15 @@ function _make(isCompress, type, options = {}) {
|
|
|
8957
9082
|
this._last_consumed = wasm.deflate_last_consumed;
|
|
8958
9083
|
this._end = wasm.deflate_end;
|
|
8959
9084
|
this.streamHandle = wasm.deflate_new();
|
|
8960
|
-
if (type ===
|
|
9085
|
+
if (type === FORMAT_GZIP) {
|
|
8961
9086
|
result = wasm.deflate_init_gzip(this.streamHandle, level);
|
|
8962
|
-
} else if (type ===
|
|
9087
|
+
} else if (type === FORMAT_DEFLATE_RAW) {
|
|
8963
9088
|
result = wasm.deflate_init_raw(this.streamHandle, level);
|
|
8964
9089
|
} else {
|
|
8965
9090
|
result = wasm.deflate_init(this.streamHandle, level);
|
|
8966
9091
|
}
|
|
8967
9092
|
} else {
|
|
8968
|
-
if (type ===
|
|
9093
|
+
if (type === FORMAT_DEFLATE64_RAW) {
|
|
8969
9094
|
this._process = wasm.inflate9_process;
|
|
8970
9095
|
this._last_consumed = wasm.inflate9_last_consumed;
|
|
8971
9096
|
this._end = wasm.inflate9_end;
|
|
@@ -8976,9 +9101,9 @@ function _make(isCompress, type, options = {}) {
|
|
|
8976
9101
|
this._last_consumed = wasm.inflate_last_consumed;
|
|
8977
9102
|
this._end = wasm.inflate_end;
|
|
8978
9103
|
this.streamHandle = wasm.inflate_new();
|
|
8979
|
-
if (type ===
|
|
9104
|
+
if (type === FORMAT_DEFLATE_RAW) {
|
|
8980
9105
|
result = wasm.inflate_init_raw(this.streamHandle);
|
|
8981
|
-
} else if (type ===
|
|
9106
|
+
} else if (type === FORMAT_GZIP) {
|
|
8982
9107
|
result = wasm.inflate_init_gzip(this.streamHandle);
|
|
8983
9108
|
} else {
|
|
8984
9109
|
result = wasm.inflate_init(this.streamHandle);
|
|
@@ -9099,12 +9224,12 @@ function _make(isCompress, type, options = {}) {
|
|
|
9099
9224
|
}
|
|
9100
9225
|
|
|
9101
9226
|
class CompressionStreamZlib {
|
|
9102
|
-
constructor(type =
|
|
9227
|
+
constructor(type = FORMAT_DEFLATE, options) {
|
|
9103
9228
|
return _make(true, type, options);
|
|
9104
9229
|
}
|
|
9105
9230
|
}
|
|
9106
9231
|
class DecompressionStreamZlib {
|
|
9107
|
-
constructor(type =
|
|
9232
|
+
constructor(type = FORMAT_DEFLATE, options) {
|
|
9108
9233
|
return _make(false, type, options);
|
|
9109
9234
|
}
|
|
9110
9235
|
}
|
|
@@ -9113,6 +9238,11 @@ class DecompressionStreamZlib {
|
|
|
9113
9238
|
// module fails to load, rather than discarding a self-contained codec supplied through config.
|
|
9114
9239
|
CompressionStreamZlib.requiresModule = true;
|
|
9115
9240
|
DecompressionStreamZlib.requiresModule = true;
|
|
9241
|
+
// Constructing these classes before the module is loaded throws, so capability probes cannot rely
|
|
9242
|
+
// on trying the constructor; the formats are declared instead, next to the branches implementing
|
|
9243
|
+
// them in _make().
|
|
9244
|
+
CompressionStreamZlib.supportedFormats = [FORMAT_DEFLATE, FORMAT_DEFLATE_RAW, FORMAT_GZIP];
|
|
9245
|
+
DecompressionStreamZlib.supportedFormats = [FORMAT_DEFLATE, FORMAT_DEFLATE_RAW, FORMAT_GZIP, FORMAT_DEFLATE64_RAW];
|
|
9116
9246
|
|
|
9117
9247
|
/*
|
|
9118
9248
|
Copyright (c) 2025 Gildas Lormeau. All rights reserved.
|
|
@@ -9257,4 +9387,4 @@ function terminateWorkersAndModule() {
|
|
|
9257
9387
|
|
|
9258
9388
|
configureExternalAssets();
|
|
9259
9389
|
|
|
9260
|
-
export { BlobReader, BlobWriter, Data64URIReader, Data64URIWriter, ERR_AMBIGUOUS_ARCHIVE, ERR_BAD_FORMAT, ERR_CENTRAL_DIRECTORY_NOT_FOUND, ERR_DUPLICATED_NAME, ERR_ENCRYPTED, ERR_ENCRYPTED_CENTRAL_DIRECTORY, ERR_ENTRY_DATA_OUT_OF_BOUNDS, 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_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_SIGNAL, ERR_INVALID_SIGNATURE, 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_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$1 as 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_NOT_EMPTY, HttpRangeReader, HttpReader, Reader, SplitDataReader, SplitDataWriter, TextReader, TextWriter, Uint8ArrayReader, Uint8ArrayWriter, 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_DATA, WARNING_TRAILING_CENTRAL_DIRECTORY_DATA, WARNING_UNKNOWN_VERSION, WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA, WARNING_UNSORTED_CENTRAL_DIRECTORY, WARNING_WRAPPED_ENTRIES_COUNT, Writer, ZipReader, ZipReaderStream, ZipWriter, ZipWriterStream, configure, createBlobTempStream, createOPFSTempStream, createSyncAccessHandleTempStream, getMimeType, isZipFile, registerCodec, resetConfiguration, terminateWorkersAndModule as terminateWorkers, unregisterCodec };
|
|
9390
|
+
export { BlobReader, BlobWriter, Data64URIReader, Data64URIWriter, ERR_AMBIGUOUS_ARCHIVE, ERR_BAD_FORMAT, ERR_CENTRAL_DIRECTORY_NOT_FOUND, ERR_DUPLICATED_NAME, ERR_ENCRYPTED, ERR_ENCRYPTED_CENTRAL_DIRECTORY, ERR_ENTRY_DATA_OUT_OF_BOUNDS, 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_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_SIGNAL, ERR_INVALID_SIGNATURE, 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_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$1 as 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_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_DATA, WARNING_TRAILING_CENTRAL_DIRECTORY_DATA, WARNING_UNKNOWN_VERSION, WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA, WARNING_UNSORTED_CENTRAL_DIRECTORY, WARNING_WRAPPED_ENTRIES_COUNT, Writer, ZipReader, ZipReaderStream, ZipWriter, ZipWriterStream, configure, createBlobTempStream, createOPFSTempStream, createSyncAccessHandleTempStream, getMimeType, getRegisteredCodecs, getSupportedCompressionMethods, isZipFile, registerCodec, resetConfiguration, terminateWorkersAndModule as terminateWorkers, unregisterCodec };
|