@zip.js/zip.js 2.11.0 → 2.11.2
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 +127 -60
- package/deno.json +1 -1
- package/dist/zip-core-external.js +22 -19
- package/dist/zip-core-external.min.js +1 -1
- package/dist/zip-core.js +12 -6
- package/dist/zip-core.min.js +1 -1
- package/dist/zip-fs-core-external.js +22 -19
- package/dist/zip-fs-core-external.min.js +1 -1
- package/dist/zip-fs-core.js +12 -6
- package/dist/zip-fs-core.min.js +1 -1
- package/dist/zip-fs-external.js +22 -19
- package/dist/zip-fs-external.min.js +1 -1
- package/dist/zip-fs-native.js +12 -6
- package/dist/zip-fs-native.min.js +1 -1
- package/dist/zip-fs.js +25 -22
- package/dist/zip-fs.min.js +1 -1
- package/dist/zip-legacy.js +12 -6
- package/dist/zip-legacy.min.js +1 -1
- package/dist/zip-module.wasm +0 -0
- package/dist/zip-native.js +12 -6
- package/dist/zip-native.min.js +1 -1
- package/dist/zip-web-worker.js +1 -1
- package/dist/zip.js +25 -22
- package/dist/zip.min.js +1 -1
- package/eslint.config.mjs +1 -1
- package/index-native.cjs +12 -6
- package/index-native.min.js +1 -1
- package/index.cjs +25 -22
- package/index.d.cts +3 -4
- package/index.d.ts +3 -4
- package/index.min.js +1 -1
- package/lib/core/io.js +2 -3
- package/lib/core/streams/zlib-wasm/zlib-streams.js +10 -13
- package/lib/core/streams/zlib-wasm/zlib-streams.wasm +0 -0
- package/lib/core/version.js +1 -1
- package/lib/core/web-worker-inline-wasm.js +1 -1
- package/lib/core/zip-writer.js +13 -2
- package/lib/core/zlib-streams-inline.js +1 -1
- package/package.json +4 -2
package/dist/zip-fs-core.js
CHANGED
|
@@ -3608,11 +3608,10 @@
|
|
|
3608
3608
|
const data = await readUint8Array(reader, offset + chunkOffset, dataSize);
|
|
3609
3609
|
if (data.length) {
|
|
3610
3610
|
controller.enqueue(data);
|
|
3611
|
+
chunkOffset += data.length;
|
|
3611
3612
|
}
|
|
3612
|
-
if ((
|
|
3613
|
+
if ((size !== UNDEFINED_VALUE && chunkOffset >= size) || (!data.length && dataSize)) {
|
|
3613
3614
|
controller.close();
|
|
3614
|
-
} else {
|
|
3615
|
-
chunkOffset += chunkSize;
|
|
3616
3615
|
}
|
|
3617
3616
|
}
|
|
3618
3617
|
});
|
|
@@ -6323,6 +6322,7 @@
|
|
|
6323
6322
|
pendingAddFileCalls: new Set(),
|
|
6324
6323
|
pendingErrors: [],
|
|
6325
6324
|
bufferedWrites: 0,
|
|
6325
|
+
directWrites: 0,
|
|
6326
6326
|
lastFileEntry: UNDEFINED_VALUE
|
|
6327
6327
|
});
|
|
6328
6328
|
}
|
|
@@ -7173,6 +7173,7 @@
|
|
|
7173
7173
|
const usdz = zipWriter.options[OPTION_USDZ];
|
|
7174
7174
|
let fileEntry = pendingFileEntry;
|
|
7175
7175
|
let bufferedWrite;
|
|
7176
|
+
let directWrite;
|
|
7176
7177
|
let releaseLockWriter;
|
|
7177
7178
|
let writingBufferedEntryData;
|
|
7178
7179
|
let writingEntryData;
|
|
@@ -7182,7 +7183,7 @@
|
|
|
7182
7183
|
const lockPreviousFileEntry = keepOrder && previousFileEntry ? previousFileEntry.lockFileEntry : UNDEFINED_VALUE;
|
|
7183
7184
|
fileEntries.set(name, fileEntry);
|
|
7184
7185
|
try {
|
|
7185
|
-
if (options.bufferedWrite || !keepOrder || zipWriter.writerLocked || zipWriter.bufferedWrites || (!dataDescriptor && !emptyEntry)) {
|
|
7186
|
+
if (options.bufferedWrite || !keepOrder || zipWriter.writerLocked || zipWriter.bufferedWrites || zipWriter.directWrites || (!dataDescriptor && !emptyEntry)) {
|
|
7186
7187
|
bufferedWrite = true;
|
|
7187
7188
|
zipWriter.bufferedWrites++;
|
|
7188
7189
|
if (options.createTempStream) {
|
|
@@ -7193,6 +7194,8 @@
|
|
|
7193
7194
|
fileWriter.size = 0;
|
|
7194
7195
|
await initStream(writer);
|
|
7195
7196
|
} else {
|
|
7197
|
+
directWrite = true;
|
|
7198
|
+
zipWriter.directWrites++;
|
|
7196
7199
|
fileWriter = writer;
|
|
7197
7200
|
await lockPreviousFileEntry;
|
|
7198
7201
|
await requestLockWriter();
|
|
@@ -7271,6 +7274,9 @@
|
|
|
7271
7274
|
if (bufferedWrite) {
|
|
7272
7275
|
zipWriter.bufferedWrites--;
|
|
7273
7276
|
}
|
|
7277
|
+
if (directWrite) {
|
|
7278
|
+
zipWriter.directWrites--;
|
|
7279
|
+
}
|
|
7274
7280
|
if (releaseLockFileEntry) {
|
|
7275
7281
|
releaseLockFileEntry(lockPreviousFileEntry);
|
|
7276
7282
|
}
|
|
@@ -7415,8 +7421,8 @@
|
|
|
7415
7421
|
}
|
|
7416
7422
|
const { writable } = writer;
|
|
7417
7423
|
if (reader) {
|
|
7418
|
-
const readable = toCompatibleReadable(createReadable(reader));
|
|
7419
7424
|
const size = reader.size;
|
|
7425
|
+
const readable = toCompatibleReadable(createReadable(reader, { size }));
|
|
7420
7426
|
const workerOptions = {
|
|
7421
7427
|
options: {
|
|
7422
7428
|
codecType: CODEC_DEFLATE,
|
|
@@ -8595,7 +8601,7 @@
|
|
|
8595
8601
|
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
8596
8602
|
*/
|
|
8597
8603
|
|
|
8598
|
-
const VERSION = "2.11.
|
|
8604
|
+
const VERSION = "2.11.2";
|
|
8599
8605
|
|
|
8600
8606
|
/*
|
|
8601
8607
|
Copyright (c) 2025 Gildas Lormeau. All rights reserved.
|