@zip.js/zip.js 2.5.26 → 2.6.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 +62 -0
- package/cli-deno/mc-zip.js +1 -3
- package/dist/zip-fs-full.js +2 -43
- package/dist/zip-fs-full.min.js +1 -1
- package/dist/zip-fs.js +2 -43
- package/dist/zip-fs.min.js +1 -1
- package/dist/zip-full.js +2 -43
- package/dist/zip-full.min.js +1 -1
- package/dist/zip-no-worker-deflate.min.js +1 -1
- package/dist/zip-no-worker-inflate.min.js +1 -1
- package/dist/zip-no-worker.min.js +1 -1
- package/dist/zip.js +2 -43
- package/dist/zip.min.js +1 -1
- package/index-fflate.js +1 -5
- package/index.d.ts +2 -14
- package/index.js +1 -5
- package/lib/core/codec-interface.js +1 -3
- package/lib/core/codec-pool.js +4 -15
- package/lib/core/io.js +1 -31
- package/lib/core/zip-fs-core.js +0 -1
- package/lib/zip-fs.js +2 -6
- package/lib/zip-full-fflate.js +2 -6
- package/lib/zip-full.js +2 -6
- package/lib/zip-no-worker-deflate.js +2 -6
- package/lib/zip-no-worker-fflate-deflate.js +2 -6
- package/lib/zip-no-worker-fflate-inflate.js +2 -6
- package/lib/zip-no-worker-fflate.js +2 -6
- package/lib/zip-no-worker-inflate.js +2 -6
- package/lib/zip-no-worker.js +2 -6
- package/lib/zip.js +2 -6
- package/package.json +1 -1
- package/tests/all/test-abort-signal-read.js +1 -1
- package/tests/all/test-abort-signal-write.js +1 -1
package/dist/zip-full.js
CHANGED
|
@@ -6095,7 +6095,6 @@
|
|
|
6095
6095
|
const MESSAGE_PULL = "pull";
|
|
6096
6096
|
const MESSAGE_DATA = "data";
|
|
6097
6097
|
const MESSAGE_CLOSE = "close";
|
|
6098
|
-
const ERR_ABORT = "AbortError";
|
|
6099
6098
|
|
|
6100
6099
|
class Codec {
|
|
6101
6100
|
|
|
@@ -6363,7 +6362,7 @@
|
|
|
6363
6362
|
let indexWorker = 0;
|
|
6364
6363
|
|
|
6365
6364
|
async function runWorker(stream, workerOptions) {
|
|
6366
|
-
const { options, config
|
|
6365
|
+
const { options, config } = workerOptions;
|
|
6367
6366
|
const streamCopy = !options.compressed && !options.signed && !options.encrypted;
|
|
6368
6367
|
const { useWebWorkers, useCompressionStream, codecType } = options;
|
|
6369
6368
|
const { workerScripts } = config;
|
|
@@ -6385,16 +6384,7 @@
|
|
|
6385
6384
|
worker = await new Promise(resolve => pendingRequests.push({ resolve, stream, workerOptions }));
|
|
6386
6385
|
}
|
|
6387
6386
|
}
|
|
6388
|
-
|
|
6389
|
-
return await worker.run();
|
|
6390
|
-
} catch (error) {
|
|
6391
|
-
const { signal } = streamOptions;
|
|
6392
|
-
if (signal && signal.aborted && (signal.reason == error || error.name == ERR_ABORT)) {
|
|
6393
|
-
throw new Error(ERR_ABORT);
|
|
6394
|
-
} else {
|
|
6395
|
-
throw error;
|
|
6396
|
-
}
|
|
6397
|
-
}
|
|
6387
|
+
return worker.run();
|
|
6398
6388
|
|
|
6399
6389
|
function onTaskFinished(workerData) {
|
|
6400
6390
|
if (pendingRequests.length) {
|
|
@@ -6462,7 +6452,6 @@
|
|
|
6462
6452
|
|
|
6463
6453
|
const ERR_HTTP_STATUS = "HTTP error ";
|
|
6464
6454
|
const ERR_HTTP_RANGE = "HTTP Range not supported";
|
|
6465
|
-
const ERR_NOT_SEEKABLE_READER = "Reader is not seekable";
|
|
6466
6455
|
|
|
6467
6456
|
const CONTENT_TYPE_TEXT_PLAIN = "text/plain";
|
|
6468
6457
|
const HTTP_HEADER_CONTENT_LENGTH = "Content-Length";
|
|
@@ -6697,32 +6686,6 @@
|
|
|
6697
6686
|
blobWriter.arrayBuffers = [];
|
|
6698
6687
|
}
|
|
6699
6688
|
|
|
6700
|
-
class ReadableStreamReader extends Stream {
|
|
6701
|
-
|
|
6702
|
-
constructor(readable) {
|
|
6703
|
-
super();
|
|
6704
|
-
if (!readable) {
|
|
6705
|
-
this.readable = new ReadableStream({});
|
|
6706
|
-
}
|
|
6707
|
-
}
|
|
6708
|
-
}
|
|
6709
|
-
|
|
6710
|
-
class WritableStreamWriter extends Writer {
|
|
6711
|
-
|
|
6712
|
-
constructor(writable, { preventClose } = {}) {
|
|
6713
|
-
super();
|
|
6714
|
-
this.preventClose = preventClose;
|
|
6715
|
-
if (!writable) {
|
|
6716
|
-
writable = new WritableStream({});
|
|
6717
|
-
}
|
|
6718
|
-
Object.defineProperty(this, "writable", {
|
|
6719
|
-
get() {
|
|
6720
|
-
return writable;
|
|
6721
|
-
}
|
|
6722
|
-
});
|
|
6723
|
-
}
|
|
6724
|
-
}
|
|
6725
|
-
|
|
6726
6689
|
class FetchReader extends Reader {
|
|
6727
6690
|
|
|
6728
6691
|
constructor(url, options) {
|
|
@@ -8509,7 +8472,6 @@
|
|
|
8509
8472
|
exports.BlobWriter = BlobWriter;
|
|
8510
8473
|
exports.Data64URIReader = Data64URIReader;
|
|
8511
8474
|
exports.Data64URIWriter = Data64URIWriter;
|
|
8512
|
-
exports.ERR_ABORT = ERR_ABORT;
|
|
8513
8475
|
exports.ERR_BAD_FORMAT = ERR_BAD_FORMAT;
|
|
8514
8476
|
exports.ERR_CENTRAL_DIRECTORY_NOT_FOUND = ERR_CENTRAL_DIRECTORY_NOT_FOUND;
|
|
8515
8477
|
exports.ERR_DUPLICATED_NAME = ERR_DUPLICATED_NAME;
|
|
@@ -8529,19 +8491,16 @@
|
|
|
8529
8491
|
exports.ERR_INVALID_SIGNATURE = ERR_INVALID_SIGNATURE;
|
|
8530
8492
|
exports.ERR_INVALID_VERSION = ERR_INVALID_VERSION;
|
|
8531
8493
|
exports.ERR_LOCAL_FILE_HEADER_NOT_FOUND = ERR_LOCAL_FILE_HEADER_NOT_FOUND;
|
|
8532
|
-
exports.ERR_NOT_SEEKABLE_READER = ERR_NOT_SEEKABLE_READER;
|
|
8533
8494
|
exports.ERR_UNSUPPORTED_COMPRESSION = ERR_UNSUPPORTED_COMPRESSION;
|
|
8534
8495
|
exports.ERR_UNSUPPORTED_ENCRYPTION = ERR_UNSUPPORTED_ENCRYPTION;
|
|
8535
8496
|
exports.ERR_UNSUPPORTED_FORMAT = ERR_UNSUPPORTED_FORMAT;
|
|
8536
8497
|
exports.HttpRangeReader = HttpRangeReader;
|
|
8537
8498
|
exports.HttpReader = HttpReader;
|
|
8538
|
-
exports.ReadableStreamReader = ReadableStreamReader;
|
|
8539
8499
|
exports.Reader = Reader;
|
|
8540
8500
|
exports.TextReader = TextReader;
|
|
8541
8501
|
exports.TextWriter = TextWriter;
|
|
8542
8502
|
exports.Uint8ArrayReader = Uint8ArrayReader;
|
|
8543
8503
|
exports.Uint8ArrayWriter = Uint8ArrayWriter;
|
|
8544
|
-
exports.WritableStreamWriter = WritableStreamWriter;
|
|
8545
8504
|
exports.Writer = Writer;
|
|
8546
8505
|
exports.ZipReader = ZipReader;
|
|
8547
8506
|
exports.ZipWriter = ZipWriter;
|