@zip.js/zip.js 2.8.3 → 2.8.5

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.
@@ -31,23 +31,23 @@ import { configure } from "./core/configuration.js";
31
31
  import { configureZlibModule } from "./core/zlib-streams-inline.js";
32
32
  import { configureWorker } from "./core/codec-worker.js";
33
33
  import { terminateWorkers } from "./core/codec-pool.js";
34
- import { initModule, initializedModule, resetWasmModule, CompressionStreamZlib, DecompressionStreamZlib } from "./core/streams/zlib-wasm/zlib-streams-loader.js";
34
+ import { initModule, resetWasmModule, CompressionStreamZlib, DecompressionStreamZlib } from "./core/streams/zlib-wasm/zlib-streams-loader.js";
35
35
 
36
- let initializingModule = false;
36
+ let modulePromise;
37
37
 
38
38
  configureZlibModule(configure);
39
39
  configureWorker({
40
40
  initModule: config => {
41
- if (!initializedModule && !initializingModule) {
41
+ if (!modulePromise) {
42
42
  let { wasmURI } = config;
43
43
  // deno-lint-ignore valid-typeof
44
44
  if (typeof wasmURI == FUNCTION_TYPE) {
45
45
  wasmURI = wasmURI();
46
46
  }
47
- initializingModule = false;
48
- return initModule(wasmURI, config);
47
+ modulePromise = initModule(wasmURI, config);
48
+
49
49
  }
50
- initializingModule = true;
50
+ return modulePromise;
51
51
  }
52
52
  });
53
53
  configure({
@@ -58,6 +58,7 @@ configure({
58
58
  export { terminateWorkersAndModule as terminateWorkers };
59
59
 
60
60
  function terminateWorkersAndModule() {
61
+ modulePromise = null;
61
62
  terminateWorkers();
62
63
  resetWasmModule();
63
64
  }
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.3",
6
+ "version": "2.8.5",
7
7
  "type": "module",
8
8
  "keywords": [
9
9
  "zip",
@@ -49,6 +49,9 @@
49
49
  "types": "./index.d.ts",
50
50
  "exports": {
51
51
  "./package.json": "./package.json",
52
+ "./dist/zip-web-worker.js": "./dist/zip-web-worker.js",
53
+ "./dist/zip-web-worker-native.js": "./dist/zip-web-worker-native.js",
54
+ "./dist/zip-module.wasm": "./dist/zip-module.wasm",
52
55
  ".": {
53
56
  "import": {
54
57
  "types": "./index.d.ts",