@cyberalien/svg-utils 1.0.3 → 1.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.
|
@@ -22,12 +22,12 @@ function uniquePromise(key, callback) {
|
|
|
22
22
|
}]
|
|
23
23
|
};
|
|
24
24
|
cache.push(newItem);
|
|
25
|
-
function done(
|
|
25
|
+
function done(success, result) {
|
|
26
26
|
cache = cache.filter((item) => item !== newItem);
|
|
27
27
|
newItem.callbacks.forEach((item) => {
|
|
28
28
|
try {
|
|
29
|
-
if (
|
|
30
|
-
else item.
|
|
29
|
+
if (success) item.resolve(result);
|
|
30
|
+
else item.reject(result);
|
|
31
31
|
} catch (err2) {}
|
|
32
32
|
});
|
|
33
33
|
}
|
|
@@ -35,15 +35,15 @@ function uniquePromise(key, callback) {
|
|
|
35
35
|
try {
|
|
36
36
|
cb = callback();
|
|
37
37
|
} catch (err) {
|
|
38
|
-
done(
|
|
38
|
+
done(false, err);
|
|
39
39
|
return;
|
|
40
40
|
}
|
|
41
41
|
if (cb instanceof Promise) cb.then((data) => {
|
|
42
|
-
done(data);
|
|
42
|
+
done(true, data);
|
|
43
43
|
}).catch((err) => {
|
|
44
|
-
done(
|
|
44
|
+
done(false, err);
|
|
45
45
|
});
|
|
46
|
-
else done(cb);
|
|
46
|
+
else done(true, cb);
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
49
|
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"type": "module",
|
|
4
4
|
"description": "Common functions for working with SVG used by various packages.",
|
|
5
5
|
"author": "Vjacheslav Trushkin",
|
|
6
|
-
"version": "1.0.
|
|
6
|
+
"version": "1.0.4",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"bugs": "https://github.com/cyberalien/svg-utils/issues",
|
|
9
9
|
"homepage": "https://cyberalien.dev/",
|