magtool 1.2.9 → 1.3.0

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.
Files changed (2) hide show
  1. package/dist/util.js +7 -4
  2. package/package.json +1 -1
package/dist/util.js CHANGED
@@ -230,10 +230,13 @@ const A = (a) => {
230
230
  i("success", e);
231
231
  }
232
232
  };
233
- const E = (e) => new Promise((r, o) => {
234
- const t = new Image();
235
- t.src = window.$getType(e) === "String" ? e : URL.createObjectURL(e), t.onload = () => r(t), t.onerror = () => o(new Error("Could not load image"));
236
- });
233
+ const E = (e) => {
234
+ if (e)
235
+ return new Promise((r, o) => {
236
+ const t = new Image();
237
+ t.src = window.$getType(e) === "String" ? e : URL.createObjectURL(e), t.onload = () => r(t), t.onerror = () => o(new Error("Could not load image"));
238
+ });
239
+ };
237
240
  window.$loadImage = E;
238
241
  const j = (e) => new Promise((r, o) => {
239
242
  const t = document.createElement("video");
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "magtool",
3
3
  "packageManager": "yarn@4.4.1",
4
- "version": "1.2.9",
4
+ "version": "1.3.0",
5
5
  "author": "matt avis",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",