amos-tool 1.6.20 → 1.6.21
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/docs/Logger.html +1 -1
- package/docs/global.html +1 -1
- package/docs/index.html +1 -1
- package/index.d.ts +17 -0
- package/lib/objectPath.js +16 -12
- package/package.json +1 -1
package/docs/Logger.html
CHANGED
|
@@ -490,7 +490,7 @@ isDebug: true
|
|
|
490
490
|
<br class="clear">
|
|
491
491
|
|
|
492
492
|
<footer>
|
|
493
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.6</a> on
|
|
493
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.6</a> on Tue Dec 10 2024 10:00:18 GMT+0800 (GMT+08:00) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
494
494
|
</footer>
|
|
495
495
|
|
|
496
496
|
<script>prettyPrint();</script>
|
package/docs/global.html
CHANGED
|
@@ -19513,7 +19513,7 @@ schedule <code>callback</code> to execute after <code>delay</code> ms.</p></td>
|
|
|
19513
19513
|
<br class="clear">
|
|
19514
19514
|
|
|
19515
19515
|
<footer>
|
|
19516
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.6</a> on
|
|
19516
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.6</a> on Tue Dec 10 2024 10:00:18 GMT+0800 (GMT+08:00) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
19517
19517
|
</footer>
|
|
19518
19518
|
|
|
19519
19519
|
<script>prettyPrint();</script>
|
package/docs/index.html
CHANGED
|
@@ -797,7 +797,7 @@ convert2BMP(canvas, width, height)</p>
|
|
|
797
797
|
<br class="clear">
|
|
798
798
|
|
|
799
799
|
<footer>
|
|
800
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.6</a> on
|
|
800
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.6</a> on Tue Dec 10 2024 10:00:18 GMT+0800 (GMT+08:00) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
801
801
|
</footer>
|
|
802
802
|
|
|
803
803
|
<script>prettyPrint();</script>
|
package/index.d.ts
CHANGED
|
@@ -852,6 +852,20 @@ declare namespace completeUnit {
|
|
|
852
852
|
* @param tag unit tag default is 'px'
|
|
853
853
|
*/
|
|
854
854
|
export function completeUnit(val: number | string, tag: string): string;
|
|
855
|
+
/**
|
|
856
|
+
*
|
|
857
|
+
* @param val 转化为 pixel
|
|
858
|
+
* @example
|
|
859
|
+
* toPixel('12'); // 12px
|
|
860
|
+
* toPixel('12rem'); // 12rem
|
|
861
|
+
* toPixel('12px'); // 12px
|
|
862
|
+
* toPixel('auto'); // auto
|
|
863
|
+
* toPixel('15%'); // 15%
|
|
864
|
+
* toPixel('calc(100% - 16px)'); // calc(100% - 16px)
|
|
865
|
+
* toPixel(false); // false
|
|
866
|
+
* toPixel(true); // true
|
|
867
|
+
* toPixel(); // undefined
|
|
868
|
+
*/
|
|
855
869
|
export function toPixel(val: number | string): string;
|
|
856
870
|
}
|
|
857
871
|
|
|
@@ -1145,6 +1159,9 @@ declare namespace utils {
|
|
|
1145
1159
|
* isBlank(''); // true
|
|
1146
1160
|
* isBlank(NaN); // false
|
|
1147
1161
|
* isBlank(' '); // false
|
|
1162
|
+
* isBlank(0); // false
|
|
1163
|
+
* isBlank(false); // false
|
|
1164
|
+
* isBlank(true); // false
|
|
1148
1165
|
*/
|
|
1149
1166
|
export function isBlank(value: any): boolean;
|
|
1150
1167
|
export function has(obj: object | Array<any>, path: Array<any> | string): boolean;
|
package/lib/objectPath.js
CHANGED
|
@@ -32,6 +32,10 @@ function isBoolean(e) {
|
|
|
32
32
|
return "boolean" == typeof e || "[object Boolean]" === toString(e);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
function isNullOrUndefined(e) {
|
|
36
|
+
return null == e;
|
|
37
|
+
}
|
|
38
|
+
|
|
35
39
|
function getKey(e) {
|
|
36
40
|
var r = parseInt(e);
|
|
37
41
|
return r.toString() === e ? r : e;
|
|
@@ -51,12 +55,12 @@ function factory(e) {
|
|
|
51
55
|
function n(e, r) {
|
|
52
56
|
if (t(e, r)) return e[r];
|
|
53
57
|
}
|
|
54
|
-
function i(e, r, t,
|
|
58
|
+
function i(e, r, t, u) {
|
|
55
59
|
if ("number" == typeof r && (r = [ r ]), !r || 0 === r.length) return e;
|
|
56
|
-
if ("string" == typeof r) return i(e, r.split(".").map(getKey), t,
|
|
57
|
-
var
|
|
58
|
-
return 1 === r.length ? (
|
|
59
|
-
i(e[
|
|
60
|
+
if ("string" == typeof r) return i(e, r.split(".").map(getKey), t, u);
|
|
61
|
+
var o = r[0], f = n(e, o);
|
|
62
|
+
return 1 === r.length ? (!isNullOrUndefined(f) && u || (e[o] = t), f) : (isNullOrUndefined(f) && ("number" == typeof r[1] ? e[o] = [] : e[o] = {}),
|
|
63
|
+
i(e[o], r.slice(1), t, u));
|
|
60
64
|
}
|
|
61
65
|
return r.has = function(r, t) {
|
|
62
66
|
if ("number" == typeof t ? t = [ t ] : "string" == typeof t && (t = t.split(".")),
|
|
@@ -72,31 +76,31 @@ function factory(e) {
|
|
|
72
76
|
}, r.set = function(e, r, t, n) {
|
|
73
77
|
return i(e, r, t, n);
|
|
74
78
|
}, r.insert = function(e, t, n, i) {
|
|
75
|
-
var
|
|
76
|
-
i = ~~i, isArray(
|
|
79
|
+
var u = r.get(e, t);
|
|
80
|
+
i = ~~i, isArray(u) || r.set(e, t, u = []), u.splice(i, 0, n);
|
|
77
81
|
}, r.empty = function(e, n) {
|
|
78
|
-
var i,
|
|
82
|
+
var i, u;
|
|
79
83
|
if (!isEmpty(n) && (null != e && (i = r.get(e, n)))) {
|
|
80
84
|
if ("string" == typeof i) return r.set(e, n, "");
|
|
81
85
|
if (isBoolean(i)) return r.set(e, n, !1);
|
|
82
86
|
if ("number" == typeof i) return r.set(e, n, 0);
|
|
83
87
|
if (isArray(i)) i.length = 0; else {
|
|
84
88
|
if (!isObject(i)) return r.set(e, n, null);
|
|
85
|
-
for (
|
|
89
|
+
for (u in i) t(i, u) && delete i[u];
|
|
86
90
|
}
|
|
87
91
|
}
|
|
88
92
|
}, r.push = function(e, t) {
|
|
89
93
|
var n = r.get(e, t);
|
|
90
94
|
isArray(n) || r.set(e, t, n = []), n.push.apply(n, Array.prototype.slice.call(arguments, 2));
|
|
91
95
|
}, r.coalesce = function(e, t, n) {
|
|
92
|
-
for (var i,
|
|
96
|
+
for (var i, u = 0, o = t.length; u < o; u++) if (void 0 !== (i = r.get(e, t[u]))) return i;
|
|
93
97
|
return n;
|
|
94
98
|
}, r.get = function(e, t, i) {
|
|
95
99
|
if ("number" == typeof t && (t = [ t ]), !t || 0 === t.length) return e;
|
|
96
100
|
if (null == e) return i;
|
|
97
101
|
if ("string" == typeof t) return r.get(e, t.split("."), i);
|
|
98
|
-
var
|
|
99
|
-
return void 0 ===
|
|
102
|
+
var u = getKey(t[0]), o = n(e, u);
|
|
103
|
+
return void 0 === o ? i : 1 === t.length ? o : r.get(e[u], t.slice(1), i);
|
|
100
104
|
}, r.del = function(e, n) {
|
|
101
105
|
if ("number" == typeof n && (n = [ n ]), null == e) return e;
|
|
102
106
|
if (isEmpty(n)) return e;
|