@zip.js/zip.js 2.8.2 → 2.8.3

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.
Files changed (62) hide show
  1. package/README.md +2 -2
  2. package/deno.json +1 -1
  3. package/dist/README.md +5 -1
  4. package/dist/zip-core.js +2322 -2604
  5. package/dist/zip-core.min.js +1 -1
  6. package/dist/zip-fs-core.js +29 -535
  7. package/dist/zip-fs-core.min.js +1 -1
  8. package/dist/zip-fs-native.js +8251 -0
  9. package/dist/zip-fs-native.min.js +1 -0
  10. package/dist/zip-fs.js +2821 -2788
  11. package/dist/zip-fs.min.js +1 -1
  12. package/dist/zip-legacy.js +5712 -0
  13. package/dist/zip-legacy.min.js +1 -0
  14. package/dist/zip-native.js +5750 -0
  15. package/dist/zip-native.min.js +1 -0
  16. package/dist/zip-web-worker-native.js +1 -0
  17. package/dist/zip-web-worker.js +1 -1
  18. package/dist/zip.js +2818 -2782
  19. package/dist/zip.min.js +1 -1
  20. package/index-native.cjs +8243 -0
  21. package/index-native.js +31 -0
  22. package/index-native.min.js +1 -0
  23. package/index.cjs +2821 -2788
  24. package/index.d.ts +2 -2
  25. package/index.js +1 -1
  26. package/index.min.js +1 -1
  27. package/lib/core/codec-pool.js +1 -4
  28. package/lib/core/codec-worker.js +17 -21
  29. package/lib/core/configuration.js +2 -3
  30. package/lib/core/io.js +2 -1
  31. package/lib/core/streams/aes-crypto-stream.js +2 -4
  32. package/lib/core/streams/zlib-js/README.md +1 -0
  33. package/lib/core/streams/zlib-js/zlib-streams.min.js +1 -0
  34. package/lib/core/streams/{zlib → zlib-wasm}/zlib-streams-loader.js +1 -2
  35. package/lib/core/streams/{zlib → zlib-wasm}/zlib-streams.js +4 -0
  36. package/lib/core/{web-worker.js → web-worker-base.js} +7 -12
  37. package/lib/core/web-worker-inline-native.js +1 -0
  38. package/lib/core/web-worker-inline-wasm.js +1 -0
  39. package/lib/core/web-worker-native.js +40 -0
  40. package/lib/core/web-worker-wasm.js +47 -0
  41. package/lib/core/zip-fs.js +3 -6
  42. package/lib/core/zip-reader.js +5 -10
  43. package/lib/core/zip-writer.js +3 -6
  44. package/lib/zip-core-base.js +61 -0
  45. package/lib/zip-core-native.js +30 -0
  46. package/lib/zip-core-reader.js +46 -0
  47. package/lib/zip-core-wasm.js +30 -0
  48. package/lib/zip-core-writer.js +43 -0
  49. package/lib/zip-core.js +2 -79
  50. package/lib/zip-fs-core-native.js +30 -0
  51. package/lib/{zip-fs-core.js → zip-fs-core-wasm.js} +1 -1
  52. package/lib/{zip-fs.js → zip-fs-native.js} +2 -4
  53. package/lib/zip-fs-wasm.js +35 -0
  54. package/lib/{zip.js → zip-legacy.js} +3 -4
  55. package/lib/zip-module-native.js +39 -0
  56. package/lib/zip-module-wasm.js +63 -0
  57. package/lib/zip-native.js +35 -0
  58. package/lib/zip-wasm.js +35 -0
  59. package/package.json +64 -11
  60. package/lib/core/web-worker-inline.js +0 -1
  61. /package/lib/core/streams/{zlib → zlib-wasm}/README.md +0 -0
  62. /package/lib/core/streams/{zlib → zlib-wasm}/zlib-streams.wasm +0 -0
@@ -356,8 +356,7 @@ class ZipReader {
356
356
  if (onprogress) {
357
357
  try {
358
358
  await onprogress(indexFile + 1, filesLength, new Entry(fileEntry));
359
- // eslint-disable-next-line no-unused-vars
360
- } catch (_) {
359
+ } catch {
361
360
  // ignored
362
361
  }
363
362
  }
@@ -630,8 +629,7 @@ function readCommonFooter(fileEntry, directory, dataView, offset, localDirectory
630
629
  });
631
630
  offsetExtraField += 4 + size;
632
631
  }
633
- // eslint-disable-next-line no-unused-vars
634
- } catch (_) {
632
+ } catch {
635
633
  // ignored
636
634
  }
637
635
  const compressionMethod = getUint16(dataView, offset + 4);
@@ -738,8 +736,7 @@ function readExtraFieldNTFS(extraFieldNTFS, directory) {
738
736
  }
739
737
  offsetExtraField += 4 + attributeSize;
740
738
  }
741
- // eslint-disable-next-line no-unused-vars
742
- } catch (_) {
739
+ } catch {
743
740
  // ignored
744
741
  }
745
742
  try {
@@ -760,8 +757,7 @@ function readExtraFieldNTFS(extraFieldNTFS, directory) {
760
757
  Object.assign(extraFieldNTFS, extraFieldData);
761
758
  Object.assign(directory, extraFieldData);
762
759
  }
763
- // eslint-disable-next-line no-unused-vars
764
- } catch (_) {
760
+ } catch {
765
761
  // ignored
766
762
  }
767
763
  }
@@ -895,8 +891,7 @@ function getDate(timeRaw) {
895
891
  const date = (timeRaw & 0xffff0000) >> 16, time = timeRaw & 0x0000ffff;
896
892
  try {
897
893
  return new Date(1980 + ((date & 0xFE00) >> 9), ((date & 0x01E0) >> 5) - 1, date & 0x001F, (time & 0xF800) >> 11, (time & 0x07E0) >> 5, (time & 0x001F) * 2, 0);
898
- // eslint-disable-next-line no-unused-vars
899
- } catch (_) {
894
+ } catch {
900
895
  // ignored
901
896
  }
902
897
  }
@@ -681,8 +681,7 @@ async function getFileEntry(zipWriter, name, reader, entryInfo, options) {
681
681
  if (error) {
682
682
  try {
683
683
  error.corruptedEntry = true;
684
- // eslint-disable-next-line no-unused-vars
685
- } catch (_) {
684
+ } catch {
686
685
  // ignored
687
686
  }
688
687
  }
@@ -999,8 +998,7 @@ function getHeaderInfo(options) {
999
998
  setBigUint64(extraFieldNTFSView, 12, lastModTimeNTFS);
1000
999
  setBigUint64(extraFieldNTFSView, 20, getTimeNTFS(lastAccessDate) || lastModTimeNTFS);
1001
1000
  setBigUint64(extraFieldNTFSView, 28, getTimeNTFS(creationDate) || lastModTimeNTFS);
1002
- // eslint-disable-next-line no-unused-vars
1003
- } catch (_) {
1001
+ } catch {
1004
1002
  rawExtraFieldNTFS = new Uint8Array();
1005
1003
  }
1006
1004
  } else {
@@ -1357,8 +1355,7 @@ async function closeFile(zipWriter, comment, options) {
1357
1355
  if (options.onprogress) {
1358
1356
  try {
1359
1357
  await options.onprogress(indexFileEntry + 1, files.size, new Entry(fileEntry));
1360
- // eslint-disable-next-line no-unused-vars
1361
- } catch (_) {
1358
+ } catch {
1362
1359
  // ignored
1363
1360
  }
1364
1361
  }
@@ -0,0 +1,61 @@
1
+ /*
2
+ Copyright (c) 2025 Gildas Lormeau. All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without
5
+ modification, are permitted provided that the following conditions are met:
6
+
7
+ 1. Redistributions of source code must retain the above copyright notice,
8
+ this list of conditions and the following disclaimer.
9
+
10
+ 2. Redistributions in binary form must reproduce the above copyright
11
+ notice, this list of conditions and the following disclaimer in
12
+ the documentation and/or other materials provided with the distribution.
13
+
14
+ 3. The names of the authors may not be used to endorse or promote products
15
+ derived from this software without specific prior written permission.
16
+
17
+ THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
18
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
19
+ FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
20
+ INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
21
+ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
23
+ OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
24
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26
+ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ */
28
+
29
+ import { configure } from "./core/configuration.js";
30
+
31
+ try {
32
+ configure({ baseURI: import.meta.url });
33
+ } catch {
34
+ // ignored
35
+ }
36
+
37
+ export * from "./zip-core-reader.js";
38
+ export * from "./zip-core-writer.js";
39
+ export {
40
+ Reader,
41
+ Writer,
42
+ TextReader,
43
+ TextWriter,
44
+ Data64URIReader,
45
+ Data64URIWriter,
46
+ BlobReader,
47
+ BlobWriter,
48
+ HttpReader,
49
+ HttpRangeReader,
50
+ Uint8ArrayWriter,
51
+ Uint8ArrayReader,
52
+ SplitDataReader,
53
+ SplitDataWriter,
54
+ ERR_HTTP_RANGE
55
+ } from "./core/io.js";
56
+ export {
57
+ getMimeType
58
+ } from "./core/util/default-mime-type.js";
59
+ export {
60
+ configure
61
+ } from "./core/configuration.js";
@@ -0,0 +1,30 @@
1
+ /*
2
+ Copyright (c) 2025 Gildas Lormeau. All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without
5
+ modification, are permitted provided that the following conditions are met:
6
+
7
+ 1. Redistributions of source code must retain the above copyright notice,
8
+ this list of conditions and the following disclaimer.
9
+
10
+ 2. Redistributions in binary form must reproduce the above copyright
11
+ notice, this list of conditions and the following disclaimer in
12
+ the documentation and/or other materials provided with the distribution.
13
+
14
+ 3. The names of the authors may not be used to endorse or promote products
15
+ derived from this software without specific prior written permission.
16
+
17
+ THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
18
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
19
+ FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
20
+ INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
21
+ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
23
+ OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
24
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26
+ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ */
28
+
29
+ export * from "./zip-core-base.js";
30
+ export * from "./zip-module-native.js";
@@ -0,0 +1,46 @@
1
+ /*
2
+ Copyright (c) 2025 Gildas Lormeau. All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without
5
+ modification, are permitted provided that the following conditions are met:
6
+
7
+ 1. Redistributions of source code must retain the above copyright notice,
8
+ this list of conditions and the following disclaimer.
9
+
10
+ 2. Redistributions in binary form must reproduce the above copyright
11
+ notice, this list of conditions and the following disclaimer in
12
+ the documentation and/or other materials provided with the distribution.
13
+
14
+ 3. The names of the authors may not be used to endorse or promote products
15
+ derived from this software without specific prior written permission.
16
+
17
+ THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
18
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
19
+ FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
20
+ INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
21
+ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
23
+ OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
24
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26
+ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ */
28
+
29
+ export {
30
+ ZipReader,
31
+ ZipReaderStream,
32
+ ERR_BAD_FORMAT,
33
+ ERR_EOCDR_NOT_FOUND,
34
+ ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND,
35
+ ERR_CENTRAL_DIRECTORY_NOT_FOUND,
36
+ ERR_LOCAL_FILE_HEADER_NOT_FOUND,
37
+ ERR_EXTRAFIELD_ZIP64_NOT_FOUND,
38
+ ERR_ENCRYPTED,
39
+ ERR_UNSUPPORTED_ENCRYPTION,
40
+ ERR_UNSUPPORTED_COMPRESSION,
41
+ ERR_INVALID_SIGNATURE,
42
+ ERR_INVALID_UNCOMPRESSED_SIZE,
43
+ ERR_INVALID_PASSWORD,
44
+ ERR_SPLIT_ZIP_FILE,
45
+ ERR_OVERLAPPING_ENTRY
46
+ } from "./core/zip-reader.js";
@@ -0,0 +1,30 @@
1
+ /*
2
+ Copyright (c) 2025 Gildas Lormeau. All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without
5
+ modification, are permitted provided that the following conditions are met:
6
+
7
+ 1. Redistributions of source code must retain the above copyright notice,
8
+ this list of conditions and the following disclaimer.
9
+
10
+ 2. Redistributions in binary form must reproduce the above copyright
11
+ notice, this list of conditions and the following disclaimer in
12
+ the documentation and/or other materials provided with the distribution.
13
+
14
+ 3. The names of the authors may not be used to endorse or promote products
15
+ derived from this software without specific prior written permission.
16
+
17
+ THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
18
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
19
+ FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
20
+ INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
21
+ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
23
+ OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
24
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26
+ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ */
28
+
29
+ export * from "./zip-core-base.js";
30
+ export * from "./zip-module-wasm.js";
@@ -0,0 +1,43 @@
1
+ /*
2
+ Copyright (c) 2025 Gildas Lormeau. All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without
5
+ modification, are permitted provided that the following conditions are met:
6
+
7
+ 1. Redistributions of source code must retain the above copyright notice,
8
+ this list of conditions and the following disclaimer.
9
+
10
+ 2. Redistributions in binary form must reproduce the above copyright
11
+ notice, this list of conditions and the following disclaimer in
12
+ the documentation and/or other materials provided with the distribution.
13
+
14
+ 3. The names of the authors may not be used to endorse or promote products
15
+ derived from this software without specific prior written permission.
16
+
17
+ THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
18
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
19
+ FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
20
+ INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
21
+ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
23
+ OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
24
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26
+ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ */
28
+
29
+ export {
30
+ ZipWriter,
31
+ ZipWriterStream,
32
+ ERR_DUPLICATED_NAME,
33
+ ERR_INVALID_COMMENT,
34
+ ERR_INVALID_ENTRY_NAME,
35
+ ERR_INVALID_ENTRY_COMMENT,
36
+ ERR_INVALID_VERSION,
37
+ ERR_INVALID_EXTRAFIELD_TYPE,
38
+ ERR_INVALID_EXTRAFIELD_DATA,
39
+ ERR_INVALID_ENCRYPTION_STRENGTH,
40
+ ERR_UNSUPPORTED_FORMAT,
41
+ ERR_UNDEFINED_UNCOMPRESSED_SIZE,
42
+ ERR_ZIP_NOT_EMPTY
43
+ } from "./core/zip-writer.js";
package/lib/zip-core.js CHANGED
@@ -26,82 +26,5 @@
26
26
  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
27
  */
28
28
 
29
- import { configure } from "./core/configuration.js";
30
- import { CompressionStreamZlib, DecompressionStreamZlib } from "./core/streams/zlib/zlib-streams-loader.js";
31
-
32
- let baseURI;
33
- try {
34
- baseURI = import.meta.url;
35
- // eslint-disable-next-line no-unused-vars
36
- } catch (_) {
37
- // ignored
38
- }
39
-
40
- configure({
41
- baseURI,
42
- CompressionStreamZlib,
43
- DecompressionStreamZlib
44
- });
45
-
46
- export {
47
- Reader,
48
- Writer,
49
- TextReader,
50
- TextWriter,
51
- Data64URIReader,
52
- Data64URIWriter,
53
- BlobReader,
54
- BlobWriter,
55
- HttpReader,
56
- HttpRangeReader,
57
- Uint8ArrayWriter,
58
- Uint8ArrayReader,
59
- SplitDataReader,
60
- SplitDataWriter,
61
- ERR_HTTP_RANGE
62
- } from "./core/io.js";
63
- export {
64
- ZipReader,
65
- ZipReaderStream,
66
- ERR_BAD_FORMAT,
67
- ERR_EOCDR_NOT_FOUND,
68
- ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND,
69
- ERR_CENTRAL_DIRECTORY_NOT_FOUND,
70
- ERR_LOCAL_FILE_HEADER_NOT_FOUND,
71
- ERR_EXTRAFIELD_ZIP64_NOT_FOUND,
72
- ERR_ENCRYPTED,
73
- ERR_UNSUPPORTED_ENCRYPTION,
74
- ERR_UNSUPPORTED_COMPRESSION,
75
- ERR_INVALID_SIGNATURE,
76
- ERR_INVALID_UNCOMPRESSED_SIZE,
77
- ERR_INVALID_PASSWORD,
78
- ERR_SPLIT_ZIP_FILE,
79
- ERR_OVERLAPPING_ENTRY
80
- } from "./core/zip-reader.js";
81
- export {
82
- ZipWriter,
83
- ZipWriterStream,
84
- ERR_DUPLICATED_NAME,
85
- ERR_INVALID_COMMENT,
86
- ERR_INVALID_ENTRY_NAME,
87
- ERR_INVALID_ENTRY_COMMENT,
88
- ERR_INVALID_VERSION,
89
- ERR_INVALID_EXTRAFIELD_TYPE,
90
- ERR_INVALID_EXTRAFIELD_DATA,
91
- ERR_INVALID_ENCRYPTION_STRENGTH,
92
- ERR_UNSUPPORTED_FORMAT,
93
- ERR_UNDEFINED_UNCOMPRESSED_SIZE,
94
- ERR_ZIP_NOT_EMPTY
95
- } from "./core/zip-writer.js";
96
- export {
97
- getMimeType
98
- } from "./core/util/default-mime-type.js";
99
- export {
100
- terminateWorkers
101
- } from "./core/codec-pool.js";
102
- export {
103
- resetWasmModule
104
- } from "./core/streams/zlib/zlib-streams-loader.js";
105
- export {
106
- configure
107
- };
29
+ export * from "./zip-core-base.js";
30
+ export { terminateWorkers } from "./core/codec-pool.js";
@@ -0,0 +1,30 @@
1
+ /*
2
+ Copyright (c) 2025 Gildas Lormeau. All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without
5
+ modification, are permitted provided that the following conditions are met:
6
+
7
+ 1. Redistributions of source code must retain the above copyright notice,
8
+ this list of conditions and the following disclaimer.
9
+
10
+ 2. Redistributions in binary form must reproduce the above copyright
11
+ notice, this list of conditions and the following disclaimer in
12
+ the documentation and/or other materials provided with the distribution.
13
+
14
+ 3. The names of the authors may not be used to endorse or promote products
15
+ derived from this software without specific prior written permission.
16
+
17
+ THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
18
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
19
+ FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
20
+ INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
21
+ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
23
+ OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
24
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26
+ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ */
28
+
29
+ export * from "./zip-core-native.js";
30
+ export * from "./core/zip-fs.js";
@@ -26,5 +26,5 @@
26
26
  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
27
  */
28
28
 
29
- export * from "./zip-core.js";
29
+ export * from "./zip-core-wasm.js";
30
30
  export * from "./core/zip-fs.js";
@@ -27,11 +27,9 @@
27
27
  */
28
28
 
29
29
  import { configure } from "./core/configuration.js";
30
- import { configureWebWorker } from "./core/web-worker-inline.js";
31
- import { configureZlibModule } from "./core/zlib-streams-inline.js";
30
+ import { configureWebWorker } from "./core/web-worker-inline-native.js";
32
31
 
33
32
  configureWebWorker(configure);
34
- configureZlibModule(configure);
35
33
 
36
- export * from "./zip-fs-core.js";
34
+ export * from "./zip-fs-core-native.js";
37
35
  export { getMimeType } from "./core/util/mime-type.js";
@@ -0,0 +1,35 @@
1
+ /*
2
+ Copyright (c) 2025 Gildas Lormeau. All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without
5
+ modification, are permitted provided that the following conditions are met:
6
+
7
+ 1. Redistributions of source code must retain the above copyright notice,
8
+ this list of conditions and the following disclaimer.
9
+
10
+ 2. Redistributions in binary form must reproduce the above copyright
11
+ notice, this list of conditions and the following disclaimer in
12
+ the documentation and/or other materials provided with the distribution.
13
+
14
+ 3. The names of the authors may not be used to endorse or promote products
15
+ derived from this software without specific prior written permission.
16
+
17
+ THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
18
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
19
+ FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
20
+ INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
21
+ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
23
+ OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
24
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26
+ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ */
28
+
29
+ import { configure } from "./core/configuration.js";
30
+ import { configureWebWorker } from "./core/web-worker-inline-wasm.js";
31
+
32
+ configureWebWorker(configure);
33
+
34
+ export * from "./zip-fs-core-wasm.js";
35
+ export { getMimeType } from "./core/util/mime-type.js";
@@ -27,10 +27,9 @@
27
27
  */
28
28
 
29
29
  import { configure } from "./core/configuration.js";
30
- import { configureWebWorker } from "./core/web-worker-inline.js";
31
- import { configureZlibModule } from "./core/zlib-streams-inline.js";
30
+ import { configureWebWorker } from "./core/web-worker-inline-native.js";
32
31
 
33
32
  configureWebWorker(configure);
34
- configureZlibModule(configure);
35
33
 
36
- export * from "./zip-core.js";
34
+ export * from "./zip-core-base.js";
35
+ export { terminateWorkers } from "./core/codec-pool.js";
@@ -0,0 +1,39 @@
1
+ /*
2
+ Copyright (c) 2025 Gildas Lormeau. All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without
5
+ modification, are permitted provided that the following conditions are met:
6
+
7
+ 1. Redistributions of source code must retain the above copyright notice,
8
+ this list of conditions and the following disclaimer.
9
+
10
+ 2. Redistributions in binary form must reproduce the above copyright
11
+ notice, this list of conditions and the following disclaimer in
12
+ the documentation and/or other materials provided with the distribution.
13
+
14
+ 3. The names of the authors may not be used to endorse or promote products
15
+ derived from this software without specific prior written permission.
16
+
17
+ THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
18
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
19
+ FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
20
+ INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
21
+ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
23
+ OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
24
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26
+ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ */
28
+
29
+ import { configure } from "./core/configuration.js";
30
+ import { CompressionStreamZlib, DecompressionStreamZlib } from "./core/streams/zlib-js/zlib-streams.min.js";
31
+
32
+ configure({
33
+ workerURI: "./core/web-worker-native.js",
34
+ wasmURI: null,
35
+ CompressionStreamZlib,
36
+ DecompressionStreamZlib
37
+ });
38
+
39
+ export { terminateWorkers } from "./core/codec-pool.js";
@@ -0,0 +1,63 @@
1
+ /*
2
+ Copyright (c) 2025 Gildas Lormeau. All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without
5
+ modification, are permitted provided that the following conditions are met:
6
+
7
+ 1. Redistributions of source code must retain the above copyright notice,
8
+ this list of conditions and the following disclaimer.
9
+
10
+ 2. Redistributions in binary form must reproduce the above copyright
11
+ notice, this list of conditions and the following disclaimer in
12
+ the documentation and/or other materials provided with the distribution.
13
+
14
+ 3. The names of the authors may not be used to endorse or promote products
15
+ derived from this software without specific prior written permission.
16
+
17
+ THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
18
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
19
+ FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
20
+ INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
21
+ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
23
+ OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
24
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26
+ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ */
28
+
29
+ import { FUNCTION_TYPE } from "./core/constants.js";
30
+ import { configure } from "./core/configuration.js";
31
+ import { configureZlibModule } from "./core/zlib-streams-inline.js";
32
+ import { configureWorker } from "./core/codec-worker.js";
33
+ import { terminateWorkers } from "./core/codec-pool.js";
34
+ import { initModule, initializedModule, resetWasmModule, CompressionStreamZlib, DecompressionStreamZlib } from "./core/streams/zlib-wasm/zlib-streams-loader.js";
35
+
36
+ let initializingModule = false;
37
+
38
+ configureZlibModule(configure);
39
+ configureWorker({
40
+ initModule: config => {
41
+ if (!initializedModule && !initializingModule) {
42
+ let { wasmURI } = config;
43
+ // deno-lint-ignore valid-typeof
44
+ if (typeof wasmURI == FUNCTION_TYPE) {
45
+ wasmURI = wasmURI();
46
+ }
47
+ initializingModule = false;
48
+ return initModule(wasmURI, config);
49
+ }
50
+ initializingModule = true;
51
+ }
52
+ });
53
+ configure({
54
+ CompressionStreamZlib,
55
+ DecompressionStreamZlib
56
+ });
57
+
58
+ export { terminateWorkersAndModule as terminateWorkers };
59
+
60
+ function terminateWorkersAndModule() {
61
+ terminateWorkers();
62
+ resetWasmModule();
63
+ }
@@ -0,0 +1,35 @@
1
+ /*
2
+ Copyright (c) 2025 Gildas Lormeau. All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without
5
+ modification, are permitted provided that the following conditions are met:
6
+
7
+ 1. Redistributions of source code must retain the above copyright notice,
8
+ this list of conditions and the following disclaimer.
9
+
10
+ 2. Redistributions in binary form must reproduce the above copyright
11
+ notice, this list of conditions and the following disclaimer in
12
+ the documentation and/or other materials provided with the distribution.
13
+
14
+ 3. The names of the authors may not be used to endorse or promote products
15
+ derived from this software without specific prior written permission.
16
+
17
+ THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
18
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
19
+ FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
20
+ INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
21
+ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
23
+ OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
24
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26
+ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ */
28
+
29
+ import { configure } from "./core/configuration.js";
30
+ import { configureWebWorker } from "./core/web-worker-inline-native.js";
31
+
32
+ configureWebWorker(configure);
33
+
34
+ export * from "./zip-core-native.js";
35
+ export * from "./zip-module-native.js";
@@ -0,0 +1,35 @@
1
+ /*
2
+ Copyright (c) 2025 Gildas Lormeau. All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without
5
+ modification, are permitted provided that the following conditions are met:
6
+
7
+ 1. Redistributions of source code must retain the above copyright notice,
8
+ this list of conditions and the following disclaimer.
9
+
10
+ 2. Redistributions in binary form must reproduce the above copyright
11
+ notice, this list of conditions and the following disclaimer in
12
+ the documentation and/or other materials provided with the distribution.
13
+
14
+ 3. The names of the authors may not be used to endorse or promote products
15
+ derived from this software without specific prior written permission.
16
+
17
+ THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
18
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
19
+ FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
20
+ INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
21
+ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
23
+ OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
24
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26
+ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ */
28
+
29
+ import { configure } from "./core/configuration.js";
30
+ import { configureWebWorker } from "./core/web-worker-inline-wasm.js";
31
+
32
+ configureWebWorker(configure);
33
+
34
+ export * from "./zip-core-wasm.js";
35
+ export * from "./zip-module-wasm.js";