amos-tool 1.6.12 → 1.6.14
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/README.md +3 -0
- package/docs/Logger.html +1 -1
- package/docs/global.html +6 -2
- package/docs/index.html +5 -1
- package/index.d.ts +14 -10
- package/lib/arrayUtils.js +7 -5
- package/lib/math/colorUtil.js +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
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 Wed Jun 12 2024 13:51:57 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
|
@@ -17768,7 +17768,11 @@ schedule <code>callback</code> to execute after <code>delay</code> ms.</p></td>
|
|
|
17768
17768
|
<pre class="prettyprint"><code>toHexColor('rgba(241,112,19)'); // #f17013
|
|
17769
17769
|
toHexColor('rgba(241,112,19, 1)'); // #f17013
|
|
17770
17770
|
toHexColor('rgba(241,112,19, 0.1)'); // #f17013
|
|
17771
|
-
toHexColor('red'); // #ff0000
|
|
17771
|
+
toHexColor('red'); // #ff0000
|
|
17772
|
+
toHexColor(); // ''
|
|
17773
|
+
toHexColor(null); // ''
|
|
17774
|
+
toHexColor(123456); // ''
|
|
17775
|
+
toHexColor(0x123456123456); // ''</code></pre>
|
|
17772
17776
|
|
|
17773
17777
|
|
|
17774
17778
|
|
|
@@ -18901,7 +18905,7 @@ schedule <code>callback</code> to execute after <code>delay</code> ms.</p></td>
|
|
|
18901
18905
|
<br class="clear">
|
|
18902
18906
|
|
|
18903
18907
|
<footer>
|
|
18904
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.6</a> on
|
|
18908
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.6</a> on Wed Jun 12 2024 13:51:57 GMT+0800 (GMT+08:00) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
18905
18909
|
</footer>
|
|
18906
18910
|
|
|
18907
18911
|
<script>prettyPrint();</script>
|
package/docs/index.html
CHANGED
|
@@ -743,6 +743,10 @@ convert2BMP(canvas, width, height)</p>
|
|
|
743
743
|
<h2>changelog</h2>
|
|
744
744
|
<ul>
|
|
745
745
|
<li>
|
|
746
|
+
<p>v1.6.13
|
|
747
|
+
<code>*</code> fix color Log</p>
|
|
748
|
+
</li>
|
|
749
|
+
<li>
|
|
746
750
|
<p>v1.6.3
|
|
747
751
|
<code>*</code> fix Log</p>
|
|
748
752
|
</li>
|
|
@@ -793,7 +797,7 @@ convert2BMP(canvas, width, height)</p>
|
|
|
793
797
|
<br class="clear">
|
|
794
798
|
|
|
795
799
|
<footer>
|
|
796
|
-
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 Wed Jun 12 2024 13:51:57 GMT+0800 (GMT+08:00) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
797
801
|
</footer>
|
|
798
802
|
|
|
799
803
|
<script>prettyPrint();</script>
|
package/index.d.ts
CHANGED
|
@@ -245,12 +245,12 @@ declare namespace LocationParam {
|
|
|
245
245
|
/**
|
|
246
246
|
* 获取 url 中参数集合
|
|
247
247
|
* @param url
|
|
248
|
-
* @param decode
|
|
248
|
+
* @param decode 是否解码, 默认为 false
|
|
249
249
|
* @example
|
|
250
250
|
* extractParamAll('/vizmixpub?appId=1536262837746302978&id=1536264796842786817&designerType=vizmix&isPreview=true', 'id');
|
|
251
251
|
* // { appId: '1536262837746302978', id: '1536264796842786817', designerType: 'vizmix', isPreview: 'true' }
|
|
252
252
|
*/
|
|
253
|
-
export function extractParamAll(url: string, decode
|
|
253
|
+
export function extractParamAll(url: string, decode?: boolean): Object;
|
|
254
254
|
/**
|
|
255
255
|
* 补全参数
|
|
256
256
|
* @param {Object} param
|
|
@@ -515,6 +515,10 @@ declare namespace colorUtil {
|
|
|
515
515
|
* toHexColor('rgba(241,112,19, 1)'); // #f17013
|
|
516
516
|
* toHexColor('rgba(241,112,19, 0.1)'); // #f17013
|
|
517
517
|
* toHexColor('red'); // #ff0000
|
|
518
|
+
* toHexColor(); // ''
|
|
519
|
+
* toHexColor(null); // ''
|
|
520
|
+
* toHexColor(123456); // ''
|
|
521
|
+
* toHexColor(0x123456123456); // ''
|
|
518
522
|
*/
|
|
519
523
|
export function toHexColor(stringRgb: string): string;
|
|
520
524
|
/**
|
|
@@ -747,7 +751,7 @@ declare namespace arrayUtils {
|
|
|
747
751
|
* @param source 原始数组
|
|
748
752
|
* @param compareFn 排序方法
|
|
749
753
|
*/
|
|
750
|
-
export function deduplicateAndSort(source: [], compareFn: (a:
|
|
754
|
+
export function deduplicateAndSort(source: [], compareFn: (a: any, b: any) => number): [];
|
|
751
755
|
/**
|
|
752
756
|
* 通过索引删除数组指定位置的数据。
|
|
753
757
|
*
|
|
@@ -771,7 +775,7 @@ declare namespace arrayUtils {
|
|
|
771
775
|
* const array2 = [[5, 6], [7, 8]];
|
|
772
776
|
* merge2DArraysDiagonally(array1, array2); // 输出: [[1, 2, 5, 6], [3, 4, 7, 8]]
|
|
773
777
|
*/
|
|
774
|
-
export function merge2DArraysDiagonally(arr1:
|
|
778
|
+
export function merge2DArraysDiagonally(arr1: any[][], arr2: any[][]): any[][];
|
|
775
779
|
}
|
|
776
780
|
|
|
777
781
|
declare namespace algor {
|
|
@@ -897,26 +901,26 @@ export function subtraction(arg1, arg2): number;
|
|
|
897
901
|
* 小数乘法
|
|
898
902
|
* @param arg1 被乘数(接受小数和整数)
|
|
899
903
|
* @param arg2 乘数(接受小数和整数)
|
|
900
|
-
* @param fix 乘积保留几位(接受正负整数以及0
|
|
904
|
+
* @param fix 乘积保留几位(接受正负整数以及0),默认值为 0
|
|
901
905
|
* @returns {Number}
|
|
902
906
|
* @example
|
|
903
907
|
* accMul(0.56, 100); // 56
|
|
904
908
|
* accMul(0.5679, 100); // 57
|
|
905
909
|
* accMul(0.5679, 100.2); // 57
|
|
906
910
|
*/
|
|
907
|
-
export function accMul(arg1: Number, arg2: Number, fix
|
|
911
|
+
export function accMul(arg1: Number, arg2: Number, fix?: Number): number;
|
|
908
912
|
/**
|
|
909
913
|
* 小数除法
|
|
910
914
|
* @param arg1 被乘数(接受小数和整数)
|
|
911
915
|
* @param arg2 乘数(接受小数和整数)
|
|
912
|
-
* @param fix
|
|
916
|
+
* @param fix 除法保留几位(接受正负整数以及0),默认值为 0
|
|
913
917
|
* @returns {Number}
|
|
914
918
|
* @example
|
|
915
919
|
* accDivide(56, 100); // 0.56
|
|
916
920
|
* accDivide(5679, 100, 2); // 56.79
|
|
917
921
|
* accDivide(5679, 100.2, 2); // 56.68
|
|
918
922
|
*/
|
|
919
|
-
export function accDivide(arg1: Number, arg2: Number, fix
|
|
923
|
+
export function accDivide(arg1: Number, arg2: Number, fix?: Number): number;
|
|
920
924
|
|
|
921
925
|
/**
|
|
922
926
|
* 将数值格式化成金额形式
|
|
@@ -1360,7 +1364,7 @@ declare namespace flat {
|
|
|
1360
1364
|
/**
|
|
1361
1365
|
* 获取树结构数据 flat keys
|
|
1362
1366
|
* @param item
|
|
1363
|
-
* @param options
|
|
1367
|
+
* @param options 默认值为 { uniqueKey: 'key', childrenKey: 'children' }
|
|
1364
1368
|
*/
|
|
1365
|
-
export function getTreeFlatKeys(item: Object | any[], options
|
|
1369
|
+
export function getTreeFlatKeys(item: Object | any[], options?: { uniqueKey?: 'key', childrenKey?: 'children' }): String[] | Number[];
|
|
1366
1370
|
}
|
package/lib/arrayUtils.js
CHANGED
|
@@ -18,9 +18,11 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
18
18
|
return t;
|
|
19
19
|
},
|
|
20
20
|
merge2DArraysDiagonally: function(r, e) {
|
|
21
|
-
for (var t = [], n = Math.max(r.length, e.length), u = 0
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
for (var t = [], n = Math.max(r.length, e.length), u = r[0].length, a = e[0].length, l = function(r) {
|
|
22
|
+
return Array(r).fill(null);
|
|
23
|
+
}, o = 0; o < n; o++) {
|
|
24
|
+
var i = r[o] || l(u), s = e[o] || l(a);
|
|
25
|
+
t[o] = [].concat((0, _toConsumableArray2.default)(i), (0, _toConsumableArray2.default)(s));
|
|
24
26
|
}
|
|
25
27
|
return t;
|
|
26
28
|
},
|
|
@@ -41,8 +43,8 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
41
43
|
for (var e = {}, t = r.slice().sort((function(r, e) {
|
|
42
44
|
return r - e;
|
|
43
45
|
})), n = 1, u = t[0], a = 0; a < t.length; a++) {
|
|
44
|
-
var
|
|
45
|
-
|
|
46
|
+
var l = t[a];
|
|
47
|
+
l !== u && (n = a + 1, u = l), e[l] ? (e[l].count++, e[l].sum += n) : e[l] = {
|
|
46
48
|
count: 1,
|
|
47
49
|
sum: n
|
|
48
50
|
};
|
package/lib/math/colorUtil.js
CHANGED
|
@@ -21,8 +21,10 @@ var utils = require("./../utils"), colorKeyWordsHexStr = require("./_keyColor"),
|
|
|
21
21
|
return a;
|
|
22
22
|
}
|
|
23
23
|
}, toHexColor = function(r) {
|
|
24
|
+
if (utils.isNil(r)) return "";
|
|
24
25
|
if (isHexColor(r)) return r;
|
|
25
26
|
if (isKeyColor(r)) return colorKeyWordsHexStr[r];
|
|
27
|
+
if (!utils.isString(r)) return "";
|
|
26
28
|
var e = r;
|
|
27
29
|
r.indexOf("rgb") > -1 && (e = e.replace(rgbaRegex, ""));
|
|
28
30
|
for (var t = e.split(","), o = "#", n = 0; n < t.length; n++) if (n < 3) {
|