@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/lib/core/io.js CHANGED
@@ -30,7 +30,6 @@
30
30
 
31
31
  const ERR_HTTP_STATUS = "HTTP error ";
32
32
  const ERR_HTTP_RANGE = "HTTP Range not supported";
33
- const ERR_NOT_SEEKABLE_READER = "Reader is not seekable";
34
33
 
35
34
  const CONTENT_TYPE_TEXT_PLAIN = "text/plain";
36
35
  const HTTP_HEADER_CONTENT_LENGTH = "Content-Length";
@@ -267,32 +266,6 @@ function flushArrayBuffers(blobWriter) {
267
266
  blobWriter.arrayBuffers = [];
268
267
  }
269
268
 
270
- class ReadableStreamReader extends Stream {
271
-
272
- constructor(readable) {
273
- super();
274
- if (!readable) {
275
- this.readable = new ReadableStream({});
276
- }
277
- }
278
- }
279
-
280
- class WritableStreamWriter extends Writer {
281
-
282
- constructor(writable, { preventClose } = {}) {
283
- super();
284
- this.preventClose = preventClose;
285
- if (!writable) {
286
- writable = new WritableStream({});
287
- }
288
- Object.defineProperty(this, "writable", {
289
- get() {
290
- return writable;
291
- }
292
- });
293
- }
294
- }
295
-
296
269
  class FetchReader extends Reader {
297
270
 
298
271
  constructor(url, options) {
@@ -559,8 +532,5 @@ export {
559
532
  Uint8ArrayWriter,
560
533
  HttpReader,
561
534
  HttpRangeReader,
562
- ReadableStreamReader,
563
- WritableStreamWriter,
564
- ERR_HTTP_RANGE,
565
- ERR_NOT_SEEKABLE_READER
535
+ ERR_HTTP_RANGE
566
536
  };
@@ -418,7 +418,6 @@ class FS {
418
418
  }
419
419
 
420
420
  const fs = { FS, ZipDirectoryEntry, ZipFileEntry };
421
- export { ERR_ABORT } from "./codec-pool.js";
422
421
  export { fs };
423
422
 
424
423
  function getTotalSize(entries, propertyName) {
package/lib/zip-fs.js CHANGED
@@ -30,10 +30,7 @@ import { configure } from "./core/configuration.js";
30
30
  import configureWebWorker from "./z-worker-inline.js";
31
31
  import { getMimeType } from "./core/util/default-mime-type.js";
32
32
  import initShimAsyncCodec from "./core/util/stream-codec-shim.js";
33
- import {
34
- terminateWorkers,
35
- ERR_ABORT
36
- } from "./core/codec-pool.js";
33
+ import { terminateWorkers } from "./core/codec-pool.js";
37
34
 
38
35
  let baseURL;
39
36
  try {
@@ -52,6 +49,5 @@ export {
52
49
  configure,
53
50
  getMimeType,
54
51
  initShimAsyncCodec,
55
- terminateWorkers,
56
- ERR_ABORT
52
+ terminateWorkers
57
53
  };
@@ -31,10 +31,7 @@ import { configure } from "./core/configuration.js";
31
31
  import configureWebWorker from "./z-worker-inline.js";
32
32
  import { getMimeType } from "./core/util/default-mime-type.js";
33
33
  import initShimAsyncCodec from "./core/util/stream-codec-shim.js";
34
- import {
35
- terminateWorkers,
36
- ERR_ABORT
37
- } from "./core/codec-pool.js";
34
+ import { terminateWorkers } from "./core/codec-pool.js";
38
35
 
39
36
  let baseURL;
40
37
  try {
@@ -52,6 +49,5 @@ export {
52
49
  configure,
53
50
  getMimeType,
54
51
  initShimAsyncCodec,
55
- terminateWorkers,
56
- ERR_ABORT
52
+ terminateWorkers
57
53
  };
package/lib/zip-full.js CHANGED
@@ -32,10 +32,7 @@ import { configure } from "./core/configuration.js";
32
32
  import configureWebWorker from "./z-worker-inline.js";
33
33
  import { getMimeType } from "./core/util/default-mime-type.js";
34
34
  import initShimAsyncCodec from "./core/util/stream-codec-shim.js";
35
- import {
36
- terminateWorkers,
37
- ERR_ABORT
38
- } from "./core/codec-pool.js";
35
+ import { terminateWorkers } from "./core/codec-pool.js";
39
36
 
40
37
  let baseURL;
41
38
  try {
@@ -53,6 +50,5 @@ export {
53
50
  configure,
54
51
  getMimeType,
55
52
  initShimAsyncCodec,
56
- terminateWorkers,
57
- ERR_ABORT
53
+ terminateWorkers
58
54
  };
@@ -29,10 +29,7 @@
29
29
  import Deflate from "./core/streams/codecs/deflate.js";
30
30
  import { configure } from "./core/configuration.js";
31
31
  import { getMimeType } from "./core/util/default-mime-type.js";
32
- import {
33
- terminateWorkers,
34
- ERR_ABORT
35
- } from "./core/codec-pool.js";
32
+ import { terminateWorkers } from "./core/codec-pool.js";
36
33
 
37
34
  configure({ Deflate });
38
35
 
@@ -41,6 +38,5 @@ export * from "./core/zip-writer.js";
41
38
  export {
42
39
  configure,
43
40
  getMimeType,
44
- terminateWorkers,
45
- ERR_ABORT
41
+ terminateWorkers
46
42
  };
@@ -29,10 +29,7 @@
29
29
  import { Deflate } from "./zip-fflate-shim.js";
30
30
  import { configure } from "./core/configuration.js";
31
31
  import { getMimeType } from "./core/util/default-mime-type.js";
32
- import {
33
- terminateWorkers,
34
- ERR_ABORT
35
- } from "./core/codec-pool.js";
32
+ import { terminateWorkers } from "./core/codec-pool.js";
36
33
 
37
34
  configure({ Deflate });
38
35
 
@@ -41,6 +38,5 @@ export * from "./core/zip-writer.js";
41
38
  export {
42
39
  configure,
43
40
  getMimeType,
44
- terminateWorkers,
45
- ERR_ABORT
41
+ terminateWorkers
46
42
  };
@@ -29,10 +29,7 @@
29
29
  import { Inflate } from "./zip-fflate-shim.js";
30
30
  import { configure } from "./core/configuration.js";
31
31
  import { getMimeType } from "./core/util/default-mime-type.js";
32
- import {
33
- terminateWorkers,
34
- ERR_ABORT
35
- } from "./core/codec-pool.js";
32
+ import { terminateWorkers } from "./core/codec-pool.js";
36
33
 
37
34
  configure({ Inflate });
38
35
 
@@ -41,6 +38,5 @@ export * from "./core/zip-reader.js";
41
38
  export {
42
39
  configure,
43
40
  getMimeType,
44
- terminateWorkers,
45
- ERR_ABORT
41
+ terminateWorkers
46
42
  };
@@ -29,10 +29,7 @@
29
29
  import { Deflate, Inflate } from "./zip-fflate-shim.js";
30
30
  import { configure } from "./core/configuration.js";
31
31
  import { getMimeType } from "./core/util/default-mime-type.js";
32
- import {
33
- terminateWorkers,
34
- ERR_ABORT
35
- } from "./core/codec-pool.js";
32
+ import { terminateWorkers } from "./core/codec-pool.js";
36
33
 
37
34
  configure({ Deflate, Inflate });
38
35
 
@@ -42,6 +39,5 @@ export * from "./core/zip-writer.js";
42
39
  export {
43
40
  configure,
44
41
  getMimeType,
45
- terminateWorkers,
46
- ERR_ABORT
42
+ terminateWorkers
47
43
  };
@@ -29,10 +29,7 @@
29
29
  import Inflate from "./core/streams/codecs/inflate.js";
30
30
  import { configure } from "./core/configuration.js";
31
31
  import { getMimeType } from "./core/util/default-mime-type.js";
32
- import {
33
- terminateWorkers,
34
- ERR_ABORT
35
- } from "./core/codec-pool.js";
32
+ import { terminateWorkers } from "./core/codec-pool.js";
36
33
 
37
34
  configure({ Inflate });
38
35
 
@@ -41,6 +38,5 @@ export * from "./core/zip-reader.js";
41
38
  export {
42
39
  configure,
43
40
  getMimeType,
44
- terminateWorkers,
45
- ERR_ABORT
41
+ terminateWorkers
46
42
  };
@@ -30,10 +30,7 @@ import Deflate from "./core/streams/codecs/deflate.js";
30
30
  import Inflate from "./core/streams/codecs/inflate.js";
31
31
  import { configure } from "./core/configuration.js";
32
32
  import { getMimeType } from "./core/util/default-mime-type.js";
33
- import {
34
- terminateWorkers,
35
- ERR_ABORT
36
- } from "./core/codec-pool.js";
33
+ import { terminateWorkers } from "./core/codec-pool.js";
37
34
 
38
35
  configure({ Deflate, Inflate });
39
36
 
@@ -43,6 +40,5 @@ export * from "./core/zip-writer.js";
43
40
  export {
44
41
  configure,
45
42
  getMimeType,
46
- terminateWorkers,
47
- ERR_ABORT
43
+ terminateWorkers
48
44
  };
package/lib/zip.js CHANGED
@@ -30,10 +30,7 @@ import { configure } from "./core/configuration.js";
30
30
  import configureWebWorker from "./z-worker-inline.js";
31
31
  import { getMimeType } from "./core/util/default-mime-type.js";
32
32
  import initShimAsyncCodec from "./core/util/stream-codec-shim.js";
33
- import {
34
- terminateWorkers,
35
- ERR_ABORT
36
- } from "./core/codec-pool.js";
33
+ import { terminateWorkers } from "./core/codec-pool.js";
37
34
 
38
35
  let baseURL;
39
36
  try {
@@ -51,6 +48,5 @@ export {
51
48
  configure,
52
49
  getMimeType,
53
50
  initShimAsyncCodec,
54
- terminateWorkers,
55
- ERR_ABORT
51
+ terminateWorkers
56
52
  };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "A JavaScript library to zip and unzip files in the browser and Deno",
4
4
  "author": "Gildas Lormeau",
5
5
  "license": "BSD-3-Clause",
6
- "version": "2.5.26",
6
+ "version": "2.6.0",
7
7
  "type": "module",
8
8
  "keywords": [
9
9
  "zip",
@@ -25,7 +25,7 @@ async function test() {
25
25
  });
26
26
  await zipReader.close();
27
27
  } catch (error) {
28
- if (error.message == zip.ERR_ABORT) {
28
+ if (signal.reason == error) {
29
29
  zip.terminateWorkers();
30
30
  return true;
31
31
  } else {
@@ -21,7 +21,7 @@ async function test() {
21
21
  });
22
22
  await zipWriter.close();
23
23
  } catch (error) {
24
- if (error.message == zip.ERR_ABORT) {
24
+ if (signal.reason == error) {
25
25
  zip.terminateWorkers();
26
26
  return true;
27
27
  } else {