@zip.js/zip.js 2.9.0 → 2.11.0
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 +40 -0
- package/deno.json +1 -1
- package/dist/zip-core-external.js +17 -46
- package/dist/zip-core-external.min.js +1 -1
- package/dist/zip-core.js +16 -46
- package/dist/zip-core.min.js +1 -1
- package/dist/zip-fs-core-external.js +170 -88
- package/dist/zip-fs-core-external.min.js +1 -1
- package/dist/zip-fs-core.js +171 -88
- package/dist/zip-fs-core.min.js +1 -1
- package/dist/zip-fs-external.js +170 -88
- package/dist/zip-fs-external.min.js +1 -1
- package/dist/zip-fs-native.js +174 -91
- package/dist/zip-fs-native.min.js +1 -1
- package/dist/zip-fs.js +175 -92
- package/dist/zip-fs.min.js +1 -1
- package/dist/zip-legacy.js +18 -48
- package/dist/zip-legacy.min.js +1 -1
- package/dist/zip-module.wasm +0 -0
- package/dist/zip-native.js +19 -49
- 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 +20 -50
- package/dist/zip.min.js +1 -1
- package/index-native.cjs +174 -91
- package/index-native.min.js +1 -1
- package/index.cjs +175 -92
- package/index.d.cts +92 -44
- package/index.d.ts +92 -44
- package/index.min.js +1 -1
- package/lib/core/codec-pool.js +0 -2
- package/lib/core/codec-registry.js +2 -0
- package/lib/core/streams/codec-stream.js +0 -2
- package/lib/core/streams/common-crypto.js +1 -3
- package/lib/core/streams/zip-entry-stream.js +2 -5
- package/lib/core/streams/zlib-js/zlib-streams.min.js +1 -1
- package/lib/core/streams/zlib-wasm/zlib-streams.js +1 -1
- package/lib/core/streams/zlib-wasm/zlib-streams.wasm +0 -0
- package/lib/core/util/decode-cp437.js +4 -11
- package/lib/core/version.js +1 -1
- package/lib/core/web-worker-inline-native.js +1 -1
- package/lib/core/web-worker-inline-wasm.js +1 -1
- package/lib/core/zip-entry.js +0 -6
- package/lib/core/zip-fs.js +155 -44
- package/lib/core/zip-reader.js +1 -6
- package/lib/core/zip-writer.js +4 -19
- package/lib/core/zlib-streams-inline.js +1 -1
- package/lib/zip-core-reader.js +0 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -75,6 +75,46 @@ console.log(helloWorldText);
|
|
|
75
75
|
|
|
76
76
|
Run the code on JSFiddle: https://jsfiddle.net/tm9fhvab/
|
|
77
77
|
|
|
78
|
+
## Hello world with the filesystem API
|
|
79
|
+
|
|
80
|
+
The filesystem API stores the entries in a tree instead of a flat list. It needs
|
|
81
|
+
a single import, it infers the Reader and the Writer from the type of the data,
|
|
82
|
+
and it reaches an entry from its name instead of searching it in an array.
|
|
83
|
+
|
|
84
|
+
```js
|
|
85
|
+
import { ZipFS } from "@zip.js/zip.js";
|
|
86
|
+
// "jsr:@zip-js/zip-js" for Deno
|
|
87
|
+
|
|
88
|
+
// ----
|
|
89
|
+
// Write the zip file
|
|
90
|
+
// ----
|
|
91
|
+
|
|
92
|
+
// Creates a ZipFS object and adds two entries to it. The name of an entry is a
|
|
93
|
+
// path, so the "folder" directory is created by the second call.
|
|
94
|
+
const zipFs = new ZipFS();
|
|
95
|
+
zipFs.addText("hello.txt", "Hello world!");
|
|
96
|
+
zipFs.addText("folder/hello.txt", "Hello world from a directory!");
|
|
97
|
+
|
|
98
|
+
// Retrieves the Blob object containing the zip content.
|
|
99
|
+
const zipFileBlob = await zipFs.exportBlob();
|
|
100
|
+
|
|
101
|
+
// ----
|
|
102
|
+
// Read the zip file
|
|
103
|
+
// ----
|
|
104
|
+
|
|
105
|
+
// Imports the zip content into a new ZipFS object, then retrieves the content
|
|
106
|
+
// of the entries from their full name.
|
|
107
|
+
const importedZipFs = new ZipFS();
|
|
108
|
+
await importedZipFs.importBlob(zipFileBlob);
|
|
109
|
+
const helloWorldText = await importedZipFs.find("hello.txt").getText();
|
|
110
|
+
const nestedText = await importedZipFs.find("folder/hello.txt").getText();
|
|
111
|
+
|
|
112
|
+
// Displays "Hello world!" and "Hello world from a directory!".
|
|
113
|
+
console.log(helloWorldText, nestedText);
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Run the code on JSFiddle: https://jsfiddle.net/gcnret0x/
|
|
117
|
+
|
|
78
118
|
## Hello world with Streams
|
|
79
119
|
|
|
80
120
|
```js
|
package/deno.json
CHANGED
|
@@ -1488,8 +1488,7 @@ misc.hmacSha1 = class {
|
|
|
1488
1488
|
const GET_RANDOM_VALUES_SUPPORTED = typeof crypto != UNDEFINED_TYPE && typeof crypto.getRandomValues == FUNCTION_TYPE;
|
|
1489
1489
|
|
|
1490
1490
|
const ERR_INVALID_PASSWORD = "Invalid password";
|
|
1491
|
-
const
|
|
1492
|
-
const ERR_INVALID_AUTHENTICATION_CODE = ERR_INVALID_SIGNATURE;
|
|
1491
|
+
const ERR_INVALID_AUTHENTICATION_CODE = "Invalid authentication code";
|
|
1493
1492
|
const ERR_ABORT_CHECK_PASSWORD = "zipjs-abort-check-password";
|
|
1494
1493
|
const ERR_UNSUPPORTED_CRYPTO_API = "Crypto API not supported";
|
|
1495
1494
|
|
|
@@ -2063,6 +2062,7 @@ function toCompatibleWritable(writable) {
|
|
|
2063
2062
|
const ERR_INVALID_CODEC_DEFINITION = "Invalid codec definition";
|
|
2064
2063
|
const ERR_RESERVED_COMPRESSION_METHOD = "Reserved compression method";
|
|
2065
2064
|
const ERR_INVALID_CODEC_MODULE = "Invalid codec module";
|
|
2065
|
+
const ERR_UNSUPPORTED_COMPRESSION = "Compression method not supported";
|
|
2066
2066
|
|
|
2067
2067
|
const RESERVED_COMPRESSION_METHODS = [
|
|
2068
2068
|
COMPRESSION_METHOD_STORE,
|
|
@@ -2162,8 +2162,7 @@ async function ensureCodecStreams(format, codecURI) {
|
|
|
2162
2162
|
|
|
2163
2163
|
const ERR_INVALID_UNCOMPRESSED_SIZE = "Invalid uncompressed size";
|
|
2164
2164
|
const ERR_INVALID_COMPRESSED_DATA = "Invalid compressed data";
|
|
2165
|
-
const ERR_INVALID_CRC32 =
|
|
2166
|
-
const ERR_UNSUPPORTED_COMPRESSION$2 = "Compression method not supported";
|
|
2165
|
+
const ERR_INVALID_CRC32 = "Invalid CRC32";
|
|
2167
2166
|
const FORMAT_DEFLATE_RAW$1 = "deflate-raw";
|
|
2168
2167
|
const FORMAT_DEFLATE64_RAW$1 = "deflate64-raw";
|
|
2169
2168
|
const FORMAT_GZIP$1 = "gzip";
|
|
@@ -2431,7 +2430,7 @@ function setReadable(stream, readable, flush) {
|
|
|
2431
2430
|
|
|
2432
2431
|
function createCodecStream(CodecStreamClass, format, options) {
|
|
2433
2432
|
if (!CodecStreamClass) {
|
|
2434
|
-
throw new Error(ERR_UNSUPPORTED_COMPRESSION
|
|
2433
|
+
throw new Error(ERR_UNSUPPORTED_COMPRESSION);
|
|
2435
2434
|
}
|
|
2436
2435
|
return new CodecStreamClass(format, options);
|
|
2437
2436
|
}
|
|
@@ -3506,21 +3505,14 @@ async function terminateWorkers() {
|
|
|
3506
3505
|
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
3507
3506
|
*/
|
|
3508
3507
|
|
|
3509
|
-
/* global TextDecoder */
|
|
3510
|
-
|
|
3511
3508
|
const CP437 = "\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\u00B6\u00A7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\u00C7\u00FC\u00E9\u00E2\u00E4\u00E0\u00E5\u00E7\u00EA\u00EB\u00E8\u00EF\u00EE\u00EC\u00C4\u00C5\u00C9\u00E6\u00C6\u00F4\u00F6\u00F2\u00FB\u00F9\u00FF\u00D6\u00DC\u00A2\u00A3\u00A5\u20A7\u0192\u00E1\u00ED\u00F3\u00FA\u00F1\u00D1\u00AA\u00BA\u00BF\u2310\u00AC\u00BD\u00BC\u00A1\u00AB\u00BB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\u00DF\u0393\u03C0\u03A3\u03C3\u00B5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\u00B1\u2265\u2264\u2320\u2321\u00F7\u2248\u00B0\u2219\u00B7\u221A\u207F\u00B2\u25A0\u00A0".split("");
|
|
3512
|
-
const VALID_CP437 = CP437.length == 256;
|
|
3513
3509
|
|
|
3514
3510
|
function decodeCP437(stringValue) {
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
result += CP437[stringValue[indexCharacter]];
|
|
3519
|
-
}
|
|
3520
|
-
return result;
|
|
3521
|
-
} else {
|
|
3522
|
-
return new TextDecoder().decode(stringValue);
|
|
3511
|
+
let result = "";
|
|
3512
|
+
for (let indexCharacter = 0; indexCharacter < stringValue.length; indexCharacter++) {
|
|
3513
|
+
result += CP437[stringValue[indexCharacter]];
|
|
3523
3514
|
}
|
|
3515
|
+
return result;
|
|
3524
3516
|
}
|
|
3525
3517
|
|
|
3526
3518
|
/*
|
|
@@ -4586,8 +4578,6 @@ const PROPERTY_NAME_CREATION_DATE = "creationDate";
|
|
|
4586
4578
|
const PROPERTY_NAME_RAW_CREATION_DATE = "rawCreationDate";
|
|
4587
4579
|
const PROPERTY_NAME_INTERNAL_FILE_ATTRIBUTES = "internalFileAttributes";
|
|
4588
4580
|
const PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTES = "externalFileAttributes";
|
|
4589
|
-
const PROPERTY_NAME_DEPRECATED_INTERNAL_FILE_ATTRIBUTES = "internalFileAttribute";
|
|
4590
|
-
const PROPERTY_NAME_DEPRECATED_EXTERNAL_FILE_ATTRIBUTES = "externalFileAttribute";
|
|
4591
4581
|
const PROPERTY_NAME_MSDOS_ATTRIBUTES_RAW = "msdosAttributesRaw";
|
|
4592
4582
|
const PROPERTY_NAME_MSDOS_ATTRIBUTES = "msdosAttributes";
|
|
4593
4583
|
const PROPERTY_NAME_MS_DOS_COMPATIBLE = "msDosCompatible";
|
|
@@ -4646,8 +4636,6 @@ const PROPERTY_NAMES = [
|
|
|
4646
4636
|
PROPERTY_NAME_DISK_NUMBER_START,
|
|
4647
4637
|
PROPERTY_NAME_INTERNAL_FILE_ATTRIBUTES,
|
|
4648
4638
|
PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTES,
|
|
4649
|
-
PROPERTY_NAME_DEPRECATED_INTERNAL_FILE_ATTRIBUTES,
|
|
4650
|
-
PROPERTY_NAME_DEPRECATED_EXTERNAL_FILE_ATTRIBUTES,
|
|
4651
4639
|
PROPERTY_NAME_MSDOS_ATTRIBUTES_RAW,
|
|
4652
4640
|
PROPERTY_NAME_MSDOS_ATTRIBUTES,
|
|
4653
4641
|
PROPERTY_NAME_MS_DOS_COMPATIBLE,
|
|
@@ -4735,7 +4723,6 @@ const ERR_LOCAL_FILE_HEADER_NOT_FOUND = "Local file header not found";
|
|
|
4735
4723
|
const ERR_EXTRAFIELD_ZIP64_NOT_FOUND = "Zip64 extra field not found";
|
|
4736
4724
|
const ERR_ENCRYPTED = "File contains encrypted entry";
|
|
4737
4725
|
const ERR_UNSUPPORTED_ENCRYPTION = "Encryption method not supported";
|
|
4738
|
-
const ERR_UNSUPPORTED_COMPRESSION$1 = "Compression method not supported";
|
|
4739
4726
|
const ERR_SPLIT_ZIP_FILE = "Split zip file";
|
|
4740
4727
|
const ERR_OVERLAPPING_ENTRY = "Overlapping entry found";
|
|
4741
4728
|
const ERR_ENTRY_DATA_OUT_OF_BOUNDS = "Entry data out of bounds";
|
|
@@ -5116,8 +5103,6 @@ class ZipReader {
|
|
|
5116
5103
|
sticky,
|
|
5117
5104
|
symlink,
|
|
5118
5105
|
unixExternalUpper,
|
|
5119
|
-
internalFileAttribute: fileEntry.internalFileAttributes,
|
|
5120
|
-
externalFileAttribute: fileEntry.externalFileAttributes,
|
|
5121
5106
|
executable,
|
|
5122
5107
|
directory: modeIsDir || upperIsDir || (msDosCompatible && msdosAttributes.directory) || fileEntry.filename.endsWith(DIRECTORY_SIGNATURE),
|
|
5123
5108
|
zipCrypto: fileEntry.encrypted && !fileEntry.extraFieldAES
|
|
@@ -5316,7 +5301,7 @@ class ZipEntry {
|
|
|
5316
5301
|
rawPassword = rawPassword && rawPassword.length && rawPassword;
|
|
5317
5302
|
if (extraFieldAES) {
|
|
5318
5303
|
if (extraFieldAES.originalCompressionMethod != COMPRESSION_METHOD_AES) {
|
|
5319
|
-
throw new Error(ERR_UNSUPPORTED_COMPRESSION
|
|
5304
|
+
throw new Error(ERR_UNSUPPORTED_COMPRESSION);
|
|
5320
5305
|
}
|
|
5321
5306
|
}
|
|
5322
5307
|
if (dataArray.length < HEADER_SIZE || getUint32$1(dataView, 0) != LOCAL_FILE_HEADER_SIGNATURE) {
|
|
@@ -5372,7 +5357,7 @@ class ZipEntry {
|
|
|
5372
5357
|
}
|
|
5373
5358
|
const registeredCodec = passThrough ? UNDEFINED_VALUE : getRegisteredCodec(compressionMethod);
|
|
5374
5359
|
if (compressionMethod != COMPRESSION_METHOD_STORE && compressionMethod != COMPRESSION_METHOD_DEFLATE && compressionMethod != COMPRESSION_METHOD_DEFLATE_64 && !registeredCodec && !passThrough) {
|
|
5375
|
-
throw new Error(ERR_UNSUPPORTED_COMPRESSION
|
|
5360
|
+
throw new Error(ERR_UNSUPPORTED_COMPRESSION);
|
|
5376
5361
|
}
|
|
5377
5362
|
if (encrypted) {
|
|
5378
5363
|
if (!zipCrypto && (extraFieldAES.strength < 1 || extraFieldAES.strength > 3)) {
|
|
@@ -6224,14 +6209,13 @@ var zipReader = /*#__PURE__*/Object.freeze({
|
|
|
6224
6209
|
ERR_INVALID_FILENAME_VALIDATION: ERR_INVALID_FILENAME_VALIDATION,
|
|
6225
6210
|
ERR_INVALID_MAX_APPENDED_DATA_SIZE: ERR_INVALID_MAX_APPENDED_DATA_SIZE,
|
|
6226
6211
|
ERR_INVALID_PASSWORD: ERR_INVALID_PASSWORD,
|
|
6227
|
-
ERR_INVALID_SIGNATURE: ERR_INVALID_SIGNATURE,
|
|
6228
6212
|
ERR_INVALID_STRICTNESS: ERR_INVALID_STRICTNESS,
|
|
6229
6213
|
ERR_INVALID_UNCOMPRESSED_SIZE: ERR_INVALID_UNCOMPRESSED_SIZE,
|
|
6230
6214
|
ERR_LOCAL_FILE_HEADER_NOT_FOUND: ERR_LOCAL_FILE_HEADER_NOT_FOUND,
|
|
6231
6215
|
ERR_OVERLAPPING_ENTRY: ERR_OVERLAPPING_ENTRY,
|
|
6232
6216
|
ERR_SPLIT_ZIP_FILE: ERR_SPLIT_ZIP_FILE,
|
|
6233
6217
|
ERR_UNSAFE_FILENAME: ERR_UNSAFE_FILENAME,
|
|
6234
|
-
ERR_UNSUPPORTED_COMPRESSION: ERR_UNSUPPORTED_COMPRESSION
|
|
6218
|
+
ERR_UNSUPPORTED_COMPRESSION: ERR_UNSUPPORTED_COMPRESSION,
|
|
6235
6219
|
ERR_UNSUPPORTED_ENCRYPTION: ERR_UNSUPPORTED_ENCRYPTION,
|
|
6236
6220
|
ERR_UNSUPPORTED_UINT64: ERR_UNSUPPORTED_UINT64,
|
|
6237
6221
|
ERR_WORKER_STARTUP_TIMEOUT: ERR_WORKER_STARTUP_TIMEOUT,
|
|
@@ -6299,7 +6283,6 @@ const ERR_INVALID_EXTRAFIELD = "Invalid extra field (must be a Map)";
|
|
|
6299
6283
|
const ERR_INVALID_EXTRAFIELD_TYPE = "Invalid extra field type (must be integer 0..65535)";
|
|
6300
6284
|
const ERR_INVALID_EXTRAFIELD_DATA_TYPE = "Invalid extra field data (must be a Uint8Array)";
|
|
6301
6285
|
const ERR_INVALID_EXTRAFIELD_DATA = "Extra field data exceeds 64KB";
|
|
6302
|
-
const ERR_UNSUPPORTED_COMPRESSION = "Compression method not supported";
|
|
6303
6286
|
const MIN_UNIX_TIME = -2147483648;
|
|
6304
6287
|
const MAX_UNIX_TIME = 2147483647;
|
|
6305
6288
|
const MIN_NTFS_TIME = BigInt(0);
|
|
@@ -6739,9 +6722,7 @@ async function addFile(zipWriter, name, reader, options) {
|
|
|
6739
6722
|
Object.assign(fileEntry, {
|
|
6740
6723
|
name,
|
|
6741
6724
|
comment,
|
|
6742
|
-
extraField
|
|
6743
|
-
[PROPERTY_NAME_DEPRECATED_INTERNAL_FILE_ATTRIBUTES]: fileEntry.internalFileAttributes,
|
|
6744
|
-
[PROPERTY_NAME_DEPRECATED_EXTERNAL_FILE_ATTRIBUTES]: fileEntry.externalFileAttributes
|
|
6725
|
+
extraField
|
|
6745
6726
|
});
|
|
6746
6727
|
return new Entry(fileEntry);
|
|
6747
6728
|
}
|
|
@@ -6788,7 +6769,7 @@ function resolveAttributes(zipWriter, name, options) {
|
|
|
6788
6769
|
if (versionMadeBy > MAX_16_BITS) {
|
|
6789
6770
|
throw new Error(ERR_INVALID_VERSION);
|
|
6790
6771
|
}
|
|
6791
|
-
let externalFileAttributes =
|
|
6772
|
+
let externalFileAttributes = getOptionValue(zipWriter, options, PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTES);
|
|
6792
6773
|
const externalFileAttributesProvided = externalFileAttributes !== UNDEFINED_VALUE;
|
|
6793
6774
|
if (!externalFileAttributesProvided) {
|
|
6794
6775
|
externalFileAttributes = 0;
|
|
@@ -6898,7 +6879,7 @@ function resolveMetadata(zipWriter, name, options) {
|
|
|
6898
6879
|
const rawLastModDate = getOptionValue(zipWriter, options, PROPERTY_NAME_RAW_LAST_MODIFICATION_DATE);
|
|
6899
6880
|
const lastAccessDate = getDateOptionValue(zipWriter, options, PROPERTY_NAME_LAST_ACCESS_DATE);
|
|
6900
6881
|
const creationDate = getDateOptionValue(zipWriter, options, PROPERTY_NAME_CREATION_DATE);
|
|
6901
|
-
const internalFileAttributes =
|
|
6882
|
+
const internalFileAttributes = getOptionValue(zipWriter, options, PROPERTY_NAME_INTERNAL_FILE_ATTRIBUTES, 0);
|
|
6902
6883
|
const passThrough = getOptionValue(zipWriter, options, OPTION_PASS_THROUGH);
|
|
6903
6884
|
const password = getOptionValue(zipWriter, options, OPTION_PASSWORD);
|
|
6904
6885
|
const rawPassword = getOptionValue(zipWriter, options, OPTION_RAW_PASSWORD);
|
|
@@ -8292,16 +8273,6 @@ function getFunctionOptionValue(zipWriter, options, name) {
|
|
|
8292
8273
|
return checkFunctionOption(getOptionValue(zipWriter, options, name));
|
|
8293
8274
|
}
|
|
8294
8275
|
|
|
8295
|
-
function getAliasedOptionValue(zipWriter, options, name, deprecatedName, defaultValue) {
|
|
8296
|
-
const value = getAliasedValue(options, name, deprecatedName);
|
|
8297
|
-
const result = value === UNDEFINED_VALUE ? getAliasedValue(zipWriter.options, name, deprecatedName) : value;
|
|
8298
|
-
return result === UNDEFINED_VALUE ? defaultValue : result;
|
|
8299
|
-
}
|
|
8300
|
-
|
|
8301
|
-
function getAliasedValue(options, name, deprecatedName) {
|
|
8302
|
-
return options[name] === UNDEFINED_VALUE ? options[deprecatedName] : options[name];
|
|
8303
|
-
}
|
|
8304
|
-
|
|
8305
8276
|
function getNumberOptionValue(zipWriter, options, name, defaultValue) {
|
|
8306
8277
|
return toNumber(getOptionValue(zipWriter, options, name, defaultValue));
|
|
8307
8278
|
}
|
|
@@ -8560,7 +8531,7 @@ function formatSupported(StreamClass, format) {
|
|
|
8560
8531
|
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
8561
8532
|
*/
|
|
8562
8533
|
|
|
8563
|
-
const VERSION = "2.
|
|
8534
|
+
const VERSION = "2.11.0";
|
|
8564
8535
|
|
|
8565
8536
|
/*
|
|
8566
8537
|
Copyright (c) 2025 Gildas Lormeau. All rights reserved.
|
|
@@ -9162,7 +9133,7 @@ function _make(isCompress, type, options = {}) {
|
|
|
9162
9133
|
}
|
|
9163
9134
|
}
|
|
9164
9135
|
const consumed = last_consumed(this.streamHandle);
|
|
9165
|
-
if (consumed === 0) {
|
|
9136
|
+
if (consumed === 0 && prod === 0) {
|
|
9166
9137
|
break;
|
|
9167
9138
|
}
|
|
9168
9139
|
offset += consumed;
|
|
@@ -9394,4 +9365,4 @@ function terminateWorkersAndModule() {
|
|
|
9394
9365
|
|
|
9395
9366
|
configureExternalAssets();
|
|
9396
9367
|
|
|
9397
|
-
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,
|
|
9368
|
+
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_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, 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_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 };
|