@zip.js/zip.js 2.8.45 → 2.8.46
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 +28 -2
- package/deno.json +13 -3
- package/dist/zip-core-external.js +61 -26
- package/dist/zip-core-external.min.js +1 -1
- package/dist/zip-core.js +59 -24
- package/dist/zip-core.min.js +1 -1
- package/dist/zip-fs-core-external.js +61 -26
- package/dist/zip-fs-core-external.min.js +1 -1
- package/dist/zip-fs-core.js +38 -22
- package/dist/zip-fs-core.min.js +1 -1
- package/dist/zip-fs-external.js +61 -26
- package/dist/zip-fs-external.min.js +1 -1
- package/dist/zip-fs-native.js +63 -28
- package/dist/zip-fs-native.min.js +1 -1
- package/dist/zip-fs.js +63 -28
- package/dist/zip-fs.min.js +1 -1
- package/dist/zip-legacy.js +61 -26
- package/dist/zip-legacy.min.js +1 -1
- package/dist/zip-native.js +63 -28
- package/dist/zip-native.min.js +1 -1
- package/dist/zip-web-worker-native.js +1 -1
- package/dist/zip-web-worker.js +1 -1
- package/dist/zip.js +63 -28
- package/dist/zip.min.js +1 -1
- package/index-native.cjs +63 -28
- package/index-native.min.js +1 -1
- package/index.cjs +63 -28
- package/index.d.cts +91 -1
- package/index.d.ts +91 -1
- package/index.min.js +1 -1
- package/lib/core/codec-pool.js +3 -2
- package/lib/core/codec-worker.js +28 -12
- package/lib/core/configuration.js +20 -2
- package/lib/core/streams/zip-entry-stream.js +8 -8
- package/lib/core/web-worker-base.js +27 -0
- package/lib/core/web-worker-inline-native.js +1 -1
- package/lib/core/web-worker-inline-wasm.js +1 -1
- package/lib/core/web-worker-native.js +7 -9
- package/lib/core/web-worker-wasm.js +9 -12
- package/lib/{core/web-worker-inline-template.js → zip-core-custom.js} +13 -20
- package/lib/zip-module-native.js +3 -3
- package/lib/zip-module-wasm-base.js +3 -3
- package/package.json +20 -2
- package/lib/core/web-worker-inline-template-native.js +0 -48
- package/lib/core/zlib-streams-inline-template.js +0 -45
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/// <reference types="../index.d.ts" />
|
|
2
|
+
|
|
1
3
|
/*
|
|
2
4
|
Copyright (c) 2025 Gildas Lormeau. All rights reserved.
|
|
3
5
|
|
|
@@ -7,8 +9,8 @@
|
|
|
7
9
|
1. Redistributions of source code must retain the above copyright notice,
|
|
8
10
|
this list of conditions and the following disclaimer.
|
|
9
11
|
|
|
10
|
-
2. Redistributions in binary form must reproduce the above copyright
|
|
11
|
-
notice, this list of conditions and the following disclaimer in
|
|
12
|
+
2. Redistributions in binary form must reproduce the above copyright
|
|
13
|
+
notice, this list of conditions and the following disclaimer in
|
|
12
14
|
the documentation and/or other materials provided with the distribution.
|
|
13
15
|
|
|
14
16
|
3. The names of the authors may not be used to endorse or promote products
|
|
@@ -26,21 +28,12 @@
|
|
|
26
28
|
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
27
29
|
*/
|
|
28
30
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
if (useBlobURI) {
|
|
39
|
-
const blob = new Blob([code], { type });
|
|
40
|
-
return URL.createObjectURL(blob);
|
|
41
|
-
} else {
|
|
42
|
-
return "data:" + type + "," + encodeURIComponent(code);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
}
|
|
31
|
+
import { setDefaultConfiguration } from "./core/configuration.js";
|
|
32
|
+
|
|
33
|
+
setDefaultConfiguration({
|
|
34
|
+
workerURI: null,
|
|
35
|
+
wasmURI: null
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export * from "./zip-core-base.js";
|
|
39
|
+
export { terminateWorkers } from "./core/codec-pool.js";
|
package/lib/zip-module-native.js
CHANGED
|
@@ -27,13 +27,13 @@
|
|
|
27
27
|
*/
|
|
28
28
|
|
|
29
29
|
import { setDefaultConfiguration } from "./core/configuration.js";
|
|
30
|
-
import { CompressionStreamZlib, DecompressionStreamZlib } from "./core/streams/zlib-js/zlib-streams.min.js";
|
|
30
|
+
import { CompressionStreamZlib as CompressionStreamFallback, DecompressionStreamZlib as DecompressionStreamFallback } from "./core/streams/zlib-js/zlib-streams.min.js";
|
|
31
31
|
|
|
32
32
|
setDefaultConfiguration({
|
|
33
33
|
workerURI: "./core/web-worker-native.js",
|
|
34
34
|
wasmURI: null,
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
CompressionStreamFallback,
|
|
36
|
+
DecompressionStreamFallback
|
|
37
37
|
});
|
|
38
38
|
|
|
39
39
|
export { terminateWorkers } from "./core/codec-pool.js";
|
|
@@ -30,7 +30,7 @@ import { FUNCTION_TYPE } from "./core/constants.js";
|
|
|
30
30
|
import { setDefaultConfiguration } from "./core/configuration.js";
|
|
31
31
|
import { configureWorker } from "./core/codec-worker.js";
|
|
32
32
|
import { terminateWorkers } from "./core/codec-pool.js";
|
|
33
|
-
import { initModule, resetWasmModule, CompressionStreamZlib, DecompressionStreamZlib } from "./core/streams/zlib-wasm/zlib-streams-loader.js";
|
|
33
|
+
import { initModule, resetWasmModule, CompressionStreamZlib as CompressionStreamFallback, DecompressionStreamZlib as DecompressionStreamFallback } from "./core/streams/zlib-wasm/zlib-streams-loader.js";
|
|
34
34
|
|
|
35
35
|
let modulePromise;
|
|
36
36
|
|
|
@@ -51,8 +51,8 @@ configureWorker({
|
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
53
|
setDefaultConfiguration({
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
CompressionStreamFallback,
|
|
55
|
+
DecompressionStreamFallback
|
|
56
56
|
});
|
|
57
57
|
|
|
58
58
|
export { terminateWorkersAndModule as terminateWorkers };
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "A JavaScript library to zip and unzip files in the browser, Deno and Node.js",
|
|
4
4
|
"author": "Gildas Lormeau",
|
|
5
5
|
"license": "BSD-3-Clause",
|
|
6
|
-
"version": "2.8.
|
|
6
|
+
"version": "2.8.46",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"keywords": [
|
|
9
9
|
"zip",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"test-browsers": "npm run test-chrome && npm run test-firefox && npm run test-webkit",
|
|
40
40
|
"test-all": "npm run lint && npm run test && npm run test-browsers",
|
|
41
41
|
"build": "npx rollup -c",
|
|
42
|
-
"build-dev": "npx rollup -c
|
|
42
|
+
"build-dev": "npx rollup -c --environment DEV",
|
|
43
43
|
"build-doc-api": "npx typedoc",
|
|
44
44
|
"build-doc-markdown": "npx typedoc --plugin typedoc-plugin-markdown --out ./docs",
|
|
45
45
|
"test-deno": "cd ./tests && deno test --allow-read ./deno-runner.js",
|
|
@@ -88,6 +88,12 @@
|
|
|
88
88
|
"default": "./lib/zip-mime-types.js"
|
|
89
89
|
}
|
|
90
90
|
},
|
|
91
|
+
"./worker": {
|
|
92
|
+
"import": {
|
|
93
|
+
"types": "./index.d.ts",
|
|
94
|
+
"default": "./lib/core/web-worker-base.js"
|
|
95
|
+
}
|
|
96
|
+
},
|
|
91
97
|
"./lib/zip-core-external.js": {
|
|
92
98
|
"import": {
|
|
93
99
|
"types": "./index.d.ts",
|
|
@@ -100,6 +106,12 @@
|
|
|
100
106
|
"default": "./lib/zip-fs-core-external.js"
|
|
101
107
|
}
|
|
102
108
|
},
|
|
109
|
+
"./lib/zip-core-custom.js": {
|
|
110
|
+
"import": {
|
|
111
|
+
"types": "./index.d.ts",
|
|
112
|
+
"default": "./lib/zip-core-custom.js"
|
|
113
|
+
}
|
|
114
|
+
},
|
|
103
115
|
"./dist/zip-fs-external.js": {
|
|
104
116
|
"import": {
|
|
105
117
|
"types": "./index.d.ts",
|
|
@@ -225,6 +237,12 @@
|
|
|
225
237
|
"types": "./index.d.ts",
|
|
226
238
|
"default": "./lib/zip-native.js"
|
|
227
239
|
}
|
|
240
|
+
},
|
|
241
|
+
"./lib/core/web-worker-base.js": {
|
|
242
|
+
"import": {
|
|
243
|
+
"types": "./index.d.ts",
|
|
244
|
+
"default": "./lib/core/web-worker-base.js"
|
|
245
|
+
}
|
|
228
246
|
}
|
|
229
247
|
},
|
|
230
248
|
"repository": {
|
|
@@ -1,48 +0,0 @@
|
|
|
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
|
-
/* global Blob, URL */
|
|
30
|
-
/* eslint-disable quotes */
|
|
31
|
-
import { inflateRaw } from "./util/inflate.js";
|
|
32
|
-
import { base64Decode, base64Encode } from "./util/base64.js";
|
|
33
|
-
|
|
34
|
-
export function configureWebWorker(configure) {
|
|
35
|
-
const code = `__workerCode__`;
|
|
36
|
-
configure({
|
|
37
|
-
workerURI: (useBlobURI) => {
|
|
38
|
-
const type = "text/javascript";
|
|
39
|
-
const source = inflateRaw(base64Decode(code));
|
|
40
|
-
if (useBlobURI) {
|
|
41
|
-
const blob = new Blob([source], { type });
|
|
42
|
-
return URL.createObjectURL(blob);
|
|
43
|
-
} else {
|
|
44
|
-
return "data:" + type + ";base64," + base64Encode(source);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
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
|
-
/* eslint-disable quotes */
|
|
30
|
-
|
|
31
|
-
import { inflateRaw } from "./util/inflate.js";
|
|
32
|
-
import { base64Decode, base64Encode } from "./util/base64.js";
|
|
33
|
-
|
|
34
|
-
export function configureZlibModule(configure) {
|
|
35
|
-
const data = `__wasmBinary__`;
|
|
36
|
-
let dataURI;
|
|
37
|
-
configure({
|
|
38
|
-
wasmURI: () => {
|
|
39
|
-
if (!dataURI) {
|
|
40
|
-
dataURI = "data:application/wasm;base64," + base64Encode(inflateRaw(base64Decode(data)));
|
|
41
|
-
}
|
|
42
|
-
return dataURI;
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
}
|