wasm-image-optimization 1.2.1 → 1.2.2

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.
@@ -4,9 +4,9 @@ var __commonJS = (cb, mod) => function __require() {
4
4
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
5
5
  };
6
6
 
7
- // node_modules/.pnpm/worker-lib@1.0.4/node_modules/worker-lib/dist/cjs/node.js
7
+ // node_modules/.pnpm/worker-lib@2.0.0/node_modules/worker-lib/dist/cjs/node.js
8
8
  var require_node = __commonJS({
9
- "node_modules/.pnpm/worker-lib@1.0.4/node_modules/worker-lib/dist/cjs/node.js"(exports2) {
9
+ "node_modules/.pnpm/worker-lib@2.0.0/node_modules/worker-lib/dist/cjs/node.js"(exports2) {
10
10
  "use strict";
11
11
  Object.defineProperty(exports2, "__esModule", { value: true });
12
12
  exports2.initWorker = exports2.createWorker = void 0;
@@ -3929,7 +3929,7 @@
3929
3929
  }
3930
3930
  });
3931
3931
 
3932
- // node_modules/.pnpm/worker-lib@1.0.4/node_modules/worker-lib/dist/esm/index.js
3932
+ // node_modules/.pnpm/worker-lib@2.0.0/node_modules/worker-lib/dist/esm/index.js
3933
3933
  var initWorker = (WorkerProc) => {
3934
3934
  const worker = self;
3935
3935
  worker.addEventListener("message", async (e) => {
@@ -1,4 +1,5 @@
1
1
  import { type OptimizeParams } from "../lib/optimizeImage.js";
2
+ declare const setLimit: (limit: number) => void, close: () => void;
2
3
  export declare const optimizeImage: (params: OptimizeParams) => Promise<Uint8Array<ArrayBuffer> | undefined>;
3
4
  export declare const optimizeImageExt: (params: OptimizeParams) => Promise<{
4
5
  data: Uint8Array<ArrayBuffer>;
@@ -7,3 +8,4 @@ export declare const optimizeImageExt: (params: OptimizeParams) => Promise<{
7
8
  width: number;
8
9
  height: number;
9
10
  } | undefined>;
11
+ export { setLimit, close };
@@ -1,5 +1,6 @@
1
1
  import { createWorker } from "worker-lib";
2
- const execute = createWorker(() => new Worker(new URL("../esm/web-worker.js", import.meta.url)), 5);
2
+ const { execute, setLimit, close } = createWorker(() => new Worker(new URL("../esm/web-worker.js", import.meta.url)), 5);
3
3
  export const optimizeImage = async (params) => execute("optimizeImage", params);
4
4
  export const optimizeImageExt = async (params) => execute("optimizeImageExt", params);
5
+ export { setLimit, close };
5
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/web-worker/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAQ1C,MAAM,OAAO,GAAG,YAAY,CAC1B,GAAG,EAAE,CAAC,IAAI,MAAM,CAAC,IAAI,GAAG,CAAC,sBAAsB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAClE,CAAC,CACF,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,EAAE,MAAsB,EAAE,EAAE,CAC5D,OAAO,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;AAEnC,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,EAAE,MAAsB,EAAE,EAAE,CAC/D,OAAO,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC","sourcesContent":["import { createWorker } from \"worker-lib\";\nimport {\n _optimizeImage,\n _optimizeImageExt,\n type OptimizeParams,\n} from \"../lib/optimizeImage.js\";\nimport type { WorkerType } from \"../esm/_web-worker.js\";\n\nconst execute = createWorker<WorkerType>(\n () => new Worker(new URL(\"../esm/web-worker.js\", import.meta.url)),\n 5\n);\n\nexport const optimizeImage = async (params: OptimizeParams) =>\n execute(\"optimizeImage\", params);\n\nexport const optimizeImageExt = async (params: OptimizeParams) =>\n execute(\"optimizeImageExt\", params);\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/web-worker/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAQ1C,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,YAAY,CAC/C,GAAG,EAAE,CAAC,IAAI,MAAM,CAAC,IAAI,GAAG,CAAC,sBAAsB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAClE,CAAC,CACF,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,EAAE,MAAsB,EAAE,EAAE,CAC5D,OAAO,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;AAEnC,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,EAAE,MAAsB,EAAE,EAAE,CAC/D,OAAO,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC;AAEtC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC","sourcesContent":["import { createWorker } from \"worker-lib\";\nimport {\n _optimizeImage,\n _optimizeImageExt,\n type OptimizeParams,\n} from \"../lib/optimizeImage.js\";\nimport type { WorkerType } from \"../esm/_web-worker.js\";\n\nconst { execute, setLimit, close } = createWorker<WorkerType>(\n () => new Worker(new URL(\"../esm/web-worker.js\", import.meta.url)),\n 5\n);\n\nexport const optimizeImage = async (params: OptimizeParams) =>\n execute(\"optimizeImage\", params);\n\nexport const optimizeImageExt = async (params: OptimizeParams) =>\n execute(\"optimizeImageExt\", params);\n\nexport { setLimit, close };\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "wasm-image-optimization",
3
3
  "description": "Optimize images with wasm on edge runtime",
4
- "version": "1.2.1",
4
+ "version": "1.2.2",
5
5
  "scripts": {
6
6
  "test": "yarn ts-node test",
7
7
  "lint:fix": "eslint --fix src/ && prettier -w src",
@@ -92,7 +92,7 @@
92
92
  },
93
93
  "license": "MIT",
94
94
  "dependencies": {
95
- "worker-lib": "1.0.4"
95
+ "worker-lib": "2.0.0"
96
96
  },
97
97
  "devDependencies": {
98
98
  "@eslint/js": "9.21.0",