@zip.js/zip.js 2.13.0 → 2.13.1
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 +1 -1
- package/dist/zip-core-external.js +36 -12
- package/dist/zip-core-external.min.js +1 -1
- package/dist/zip-core.js +36 -12
- package/dist/zip-core.min.js +1 -1
- package/dist/zip-fs-core-external.js +36 -12
- package/dist/zip-fs-core-external.min.js +1 -1
- package/dist/zip-fs-core.js +36 -12
- package/dist/zip-fs-core.min.js +1 -1
- package/dist/zip-fs-external.js +36 -12
- package/dist/zip-fs-external.min.js +1 -1
- package/dist/zip-fs-native.js +36 -12
- package/dist/zip-fs-native.min.js +1 -1
- package/dist/zip-fs.js +36 -12
- package/dist/zip-fs.min.js +1 -1
- package/dist/zip-legacy.js +36 -12
- package/dist/zip-legacy.min.js +1 -1
- package/dist/zip-native.js +36 -12
- package/dist/zip-native.min.js +1 -1
- package/dist/zip.js +36 -12
- package/dist/zip.min.js +1 -1
- package/index-native.cjs +36 -12
- package/index-native.min.js +1 -1
- package/index.cjs +36 -12
- package/index.d.cts +6 -0
- package/index.d.ts +6 -0
- package/index.min.js +1 -1
- package/lib/core/codec-worker-web.js +35 -11
- package/lib/core/version.js +1 -1
- package/package.json +1 -1
package/dist/zip-native.js
CHANGED
|
@@ -3049,7 +3049,7 @@
|
|
|
3049
3049
|
rejectResult = error => {
|
|
3050
3050
|
const { outputSize, workerOptions } = workerData;
|
|
3051
3051
|
workerOptions.outputSize = outputSize;
|
|
3052
|
-
if (isErrorObject(error)
|
|
3052
|
+
if (isErrorObject(error)) {
|
|
3053
3053
|
try {
|
|
3054
3054
|
error.outputSize = outputSize;
|
|
3055
3055
|
} catch {
|
|
@@ -3063,12 +3063,14 @@
|
|
|
3063
3063
|
reader: null,
|
|
3064
3064
|
writer: null,
|
|
3065
3065
|
outputSize: 0,
|
|
3066
|
+
destinationFailed: false,
|
|
3067
|
+
destinationError: null,
|
|
3066
3068
|
resolveResult,
|
|
3067
3069
|
rejectResult,
|
|
3068
3070
|
result
|
|
3069
3071
|
});
|
|
3070
3072
|
const { readable, options } = workerData;
|
|
3071
|
-
const { writable, closed, abortPipe } = watchClosedStream(workerData.writable);
|
|
3073
|
+
const { writable, closed, abortPipe } = watchClosedStream(workerData.writable, workerData);
|
|
3072
3074
|
let streamsTransferred;
|
|
3073
3075
|
try {
|
|
3074
3076
|
streamsTransferred = sendMessage({
|
|
@@ -3111,7 +3113,18 @@
|
|
|
3111
3113
|
} catch {
|
|
3112
3114
|
// ignored
|
|
3113
3115
|
}
|
|
3114
|
-
|
|
3116
|
+
const { outputSize, workerOptions, destinationFailed, destinationError } = workerData;
|
|
3117
|
+
workerOptions.outputSize = outputSize;
|
|
3118
|
+
const workerFailed = isErrorObject(error) && (error.codecImportFailed || error.workerStartupFailed);
|
|
3119
|
+
const reportedError = destinationFailed && !workerFailed ? destinationError : error;
|
|
3120
|
+
if (isErrorObject(reportedError)) {
|
|
3121
|
+
try {
|
|
3122
|
+
reportedError.outputSize = outputSize;
|
|
3123
|
+
} catch {
|
|
3124
|
+
// ignored
|
|
3125
|
+
}
|
|
3126
|
+
}
|
|
3127
|
+
throw reportedError;
|
|
3115
3128
|
}
|
|
3116
3129
|
|
|
3117
3130
|
async function closeWritable() {
|
|
@@ -3125,12 +3138,27 @@
|
|
|
3125
3138
|
}
|
|
3126
3139
|
}
|
|
3127
3140
|
|
|
3128
|
-
function watchClosedStream(writableSource) {
|
|
3141
|
+
function watchClosedStream(writableSource, workerData) {
|
|
3129
3142
|
const abortController = new AbortController();
|
|
3130
|
-
|
|
3143
|
+
let aborting;
|
|
3144
|
+
const { writable, readable } = new TransformStream({
|
|
3145
|
+
transform(chunk, controller) {
|
|
3146
|
+
workerData.outputSize += chunk.length;
|
|
3147
|
+
controller.enqueue(chunk);
|
|
3148
|
+
}
|
|
3149
|
+
});
|
|
3131
3150
|
const closed = readable.pipeTo(writableSource, { preventClose: true, preventAbort: true, signal: abortController.signal });
|
|
3132
|
-
closed.catch(
|
|
3133
|
-
|
|
3151
|
+
closed.catch(error => {
|
|
3152
|
+
if (!aborting) {
|
|
3153
|
+
Object.assign(workerData, { destinationFailed: true, destinationError: error });
|
|
3154
|
+
}
|
|
3155
|
+
});
|
|
3156
|
+
return {
|
|
3157
|
+
writable, closed, abortPipe: () => {
|
|
3158
|
+
aborting = true;
|
|
3159
|
+
abortController.abort();
|
|
3160
|
+
}
|
|
3161
|
+
};
|
|
3134
3162
|
}
|
|
3135
3163
|
|
|
3136
3164
|
function releaseWorkerStreams(workerData) {
|
|
@@ -3328,9 +3356,6 @@
|
|
|
3328
3356
|
const stale = () => workerData.generation != generation;
|
|
3329
3357
|
try {
|
|
3330
3358
|
if (error) {
|
|
3331
|
-
if (error.outputSize !== UNDEFINED_VALUE) {
|
|
3332
|
-
workerData.outputSize = error.outputSize;
|
|
3333
|
-
}
|
|
3334
3359
|
fail(getResponseError(error, errorValue));
|
|
3335
3360
|
} else {
|
|
3336
3361
|
if (type == MESSAGE_PULL) {
|
|
@@ -3343,7 +3368,6 @@
|
|
|
3343
3368
|
const chunk = new Uint8Array(value);
|
|
3344
3369
|
await writer.ready;
|
|
3345
3370
|
await writer.write(chunk);
|
|
3346
|
-
workerData.outputSize += chunk.length;
|
|
3347
3371
|
if (!stale()) {
|
|
3348
3372
|
sendMessage({ type: MESSAGE_ACK_DATA, messageId }, workerData);
|
|
3349
3373
|
}
|
|
@@ -8962,7 +8986,7 @@
|
|
|
8962
8986
|
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
8963
8987
|
*/
|
|
8964
8988
|
|
|
8965
|
-
const VERSION = "2.13.
|
|
8989
|
+
const VERSION = "2.13.1";
|
|
8966
8990
|
|
|
8967
8991
|
/*
|
|
8968
8992
|
Copyright (c) 2025 Gildas Lormeau. All rights reserved.
|