wasm-image-optimization 2.0.0 → 2.0.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.
package/dist/workers.js
CHANGED
|
@@ -32,9 +32,14 @@ const createImageConverterWorker = (params) => {
|
|
|
32
32
|
get(target, prop, receiver) {
|
|
33
33
|
if (prop === "optimizeImage") {
|
|
34
34
|
return async (options) => {
|
|
35
|
+
const image = options.image instanceof Uint8Array
|
|
36
|
+
? options.image
|
|
37
|
+
: typeof options.image === "string"
|
|
38
|
+
? new TextEncoder().encode(options.image)
|
|
39
|
+
: new Uint8Array(options.image);
|
|
35
40
|
return await target.execute("optimizeImage", {
|
|
36
41
|
...options,
|
|
37
|
-
image
|
|
42
|
+
image,
|
|
38
43
|
});
|
|
39
44
|
};
|
|
40
45
|
}
|