wasm-image-optimization 2.0.2 → 2.0.4
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/dist/vite-plugin.d.ts +3 -0
- package/dist/vite-plugin.js +15 -0
- package/dist/workers.js +3 -5
- package/package.json +7 -3
package/dist/workers.js
CHANGED
|
@@ -32,11 +32,9 @@ const createImageConverterWorker = (params) => {
|
|
|
32
32
|
get(target, prop, receiver) {
|
|
33
33
|
if (prop === "optimizeImage") {
|
|
34
34
|
return async (options) => {
|
|
35
|
-
const image = options.image
|
|
36
|
-
? options.image
|
|
37
|
-
:
|
|
38
|
-
? new TextEncoder().encode(options.image)
|
|
39
|
-
: new Uint8Array(options.image);
|
|
35
|
+
const image = typeof options.image === "string"
|
|
36
|
+
? new TextEncoder().encode(options.image)
|
|
37
|
+
: new Uint8Array(options.image);
|
|
40
38
|
return await target.execute("optimizeImage", {
|
|
41
39
|
...options,
|
|
42
40
|
image,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wasm-image-optimization",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"description": "Optimize images with wasm on edge runtime",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -42,7 +42,11 @@
|
|
|
42
42
|
"import": "./dist/single.js"
|
|
43
43
|
},
|
|
44
44
|
"./wasm-image-optimization.js": "./dist/wasm-image-optimization.js",
|
|
45
|
-
"./wasm-image-optimization.wasm": "./dist/wasm-image-optimization.wasm"
|
|
45
|
+
"./wasm-image-optimization.wasm": "./dist/wasm-image-optimization.wasm",
|
|
46
|
+
"./vite-plugin": {
|
|
47
|
+
"types": "./dist/vite-plugin.d.ts",
|
|
48
|
+
"default": "./dist/vite-plugin.js"
|
|
49
|
+
}
|
|
46
50
|
},
|
|
47
51
|
"typesVersions": {
|
|
48
52
|
"*": {
|
|
@@ -81,7 +85,7 @@
|
|
|
81
85
|
"devDependencies": {
|
|
82
86
|
"rolldown": "1.0.0-rc.7",
|
|
83
87
|
"typescript": "^5.9.3",
|
|
84
|
-
"
|
|
88
|
+
"vite": "7.3.1"
|
|
85
89
|
},
|
|
86
90
|
"dependencies": {
|
|
87
91
|
"commander": "14.0.3",
|