amos-tool 1.6.15 → 1.6.17
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 +163 -1
- package/docs/index.html +1 -1
- package/index.d.ts +1 -1
- package/lib/algorithm/is.js +15 -8
- package/lib/algorithm/rank.js +15 -11
- package/lib/math/colorUtil.js +2 -2
- 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 Mon Jul 22 2024 14:08:56 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
|
@@ -11419,6 +11419,168 @@ isNil(NaN)
|
|
|
11419
11419
|
|
|
11420
11420
|
|
|
11421
11421
|
|
|
11422
|
+
|
|
11423
|
+
|
|
11424
|
+
|
|
11425
|
+
|
|
11426
|
+
<h4 class="name" id="isObject"><span class="type-signature"></span>isObject<span class="signature">(value)</span><span class="type-signature"> → {boolean}</span></h4>
|
|
11427
|
+
|
|
11428
|
+
|
|
11429
|
+
|
|
11430
|
+
|
|
11431
|
+
|
|
11432
|
+
|
|
11433
|
+
<dl class="details">
|
|
11434
|
+
|
|
11435
|
+
|
|
11436
|
+
|
|
11437
|
+
|
|
11438
|
+
|
|
11439
|
+
|
|
11440
|
+
|
|
11441
|
+
|
|
11442
|
+
|
|
11443
|
+
|
|
11444
|
+
|
|
11445
|
+
|
|
11446
|
+
|
|
11447
|
+
|
|
11448
|
+
|
|
11449
|
+
|
|
11450
|
+
|
|
11451
|
+
|
|
11452
|
+
|
|
11453
|
+
|
|
11454
|
+
|
|
11455
|
+
|
|
11456
|
+
|
|
11457
|
+
|
|
11458
|
+
|
|
11459
|
+
|
|
11460
|
+
|
|
11461
|
+
|
|
11462
|
+
|
|
11463
|
+
|
|
11464
|
+
|
|
11465
|
+
|
|
11466
|
+
</dl>
|
|
11467
|
+
|
|
11468
|
+
|
|
11469
|
+
|
|
11470
|
+
|
|
11471
|
+
|
|
11472
|
+
<div class="description usertext">
|
|
11473
|
+
<p>Tests if a value is an object; e.g., <code>{}</code>.</p>
|
|
11474
|
+
</div>
|
|
11475
|
+
|
|
11476
|
+
|
|
11477
|
+
|
|
11478
|
+
|
|
11479
|
+
|
|
11480
|
+
|
|
11481
|
+
|
|
11482
|
+
|
|
11483
|
+
|
|
11484
|
+
<h5>Examples</h5>
|
|
11485
|
+
|
|
11486
|
+
<pre class="prettyprint"><code>var bool = isObject( {} );
|
|
11487
|
+
// returns true</code></pre>
|
|
11488
|
+
|
|
11489
|
+
<pre class="prettyprint"><code>var bool = isObject( null );
|
|
11490
|
+
// returns false</code></pre>
|
|
11491
|
+
|
|
11492
|
+
|
|
11493
|
+
|
|
11494
|
+
|
|
11495
|
+
<h5>Parameters:</h5>
|
|
11496
|
+
|
|
11497
|
+
|
|
11498
|
+
<table class="params">
|
|
11499
|
+
<thead>
|
|
11500
|
+
<tr>
|
|
11501
|
+
|
|
11502
|
+
<th>Name</th>
|
|
11503
|
+
|
|
11504
|
+
|
|
11505
|
+
<th>Type</th>
|
|
11506
|
+
|
|
11507
|
+
|
|
11508
|
+
|
|
11509
|
+
|
|
11510
|
+
|
|
11511
|
+
<th class="last">Description</th>
|
|
11512
|
+
</tr>
|
|
11513
|
+
</thead>
|
|
11514
|
+
|
|
11515
|
+
<tbody>
|
|
11516
|
+
|
|
11517
|
+
|
|
11518
|
+
<tr>
|
|
11519
|
+
|
|
11520
|
+
<td class="name"><code>value</code></td>
|
|
11521
|
+
|
|
11522
|
+
|
|
11523
|
+
<td class="type">
|
|
11524
|
+
|
|
11525
|
+
|
|
11526
|
+
<span class="param-type">*</span>
|
|
11527
|
+
|
|
11528
|
+
|
|
11529
|
+
|
|
11530
|
+
</td>
|
|
11531
|
+
|
|
11532
|
+
|
|
11533
|
+
|
|
11534
|
+
|
|
11535
|
+
|
|
11536
|
+
<td class="description last"><p>value to test</p></td>
|
|
11537
|
+
</tr>
|
|
11538
|
+
|
|
11539
|
+
|
|
11540
|
+
</tbody>
|
|
11541
|
+
</table>
|
|
11542
|
+
|
|
11543
|
+
|
|
11544
|
+
|
|
11545
|
+
|
|
11546
|
+
|
|
11547
|
+
|
|
11548
|
+
|
|
11549
|
+
|
|
11550
|
+
|
|
11551
|
+
|
|
11552
|
+
|
|
11553
|
+
|
|
11554
|
+
|
|
11555
|
+
|
|
11556
|
+
|
|
11557
|
+
|
|
11558
|
+
<h5>Returns:</h5>
|
|
11559
|
+
|
|
11560
|
+
|
|
11561
|
+
<div class="param-desc">
|
|
11562
|
+
<p>boolean indicating whether value is an object</p>
|
|
11563
|
+
</div>
|
|
11564
|
+
|
|
11565
|
+
|
|
11566
|
+
|
|
11567
|
+
<dl class="param-type">
|
|
11568
|
+
<dt>
|
|
11569
|
+
Type
|
|
11570
|
+
</dt>
|
|
11571
|
+
<dd>
|
|
11572
|
+
|
|
11573
|
+
<span class="param-type">boolean</span>
|
|
11574
|
+
|
|
11575
|
+
|
|
11576
|
+
</dd>
|
|
11577
|
+
</dl>
|
|
11578
|
+
|
|
11579
|
+
|
|
11580
|
+
|
|
11581
|
+
|
|
11582
|
+
|
|
11583
|
+
|
|
11422
11584
|
|
|
11423
11585
|
|
|
11424
11586
|
|
|
@@ -19042,7 +19204,7 @@ schedule <code>callback</code> to execute after <code>delay</code> ms.</p></td>
|
|
|
19042
19204
|
<br class="clear">
|
|
19043
19205
|
|
|
19044
19206
|
<footer>
|
|
19045
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.6</a> on
|
|
19207
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.6</a> on Mon Jul 22 2024 14:08:56 GMT+0800 (GMT+08:00) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
19046
19208
|
</footer>
|
|
19047
19209
|
|
|
19048
19210
|
<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 Mon Jul 22 2024 14:08:56 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
|
@@ -785,7 +785,7 @@ declare namespace algor {
|
|
|
785
785
|
* @param x data array
|
|
786
786
|
* @param options options object
|
|
787
787
|
* @param options.method [options.method='average'] method name determining how ties are treated
|
|
788
|
-
* @param options.missing [options.missing='last'] determines where missing values go (`first`,`last`, or `remove`)
|
|
788
|
+
* @param options.missing [options.missing='last'] determines where missing values go (`first`,`last`, `*`, or `remove`) `*` is same with `last`, only replace `value` to `null`
|
|
789
789
|
* @param options.missing [options.encoding=[null,NaN]] array of values encoding missing values
|
|
790
790
|
* @example
|
|
791
791
|
* ranks( [ 1.1, 2.0, 3.5, 0.0, 2.4 ] ); // [ 2, 3, 5, 1, 4 ]
|
package/lib/algorithm/is.js
CHANGED
|
@@ -26,29 +26,35 @@ function isnan(e) {
|
|
|
26
26
|
return isNumber(e) && isBaseNaN(e.valueOf());
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
function contains(e, r,
|
|
30
|
-
var
|
|
29
|
+
function contains(e, r, t) {
|
|
30
|
+
var n, i, o;
|
|
31
31
|
if (!isCollection(e) && !isString(e)) throw new TypeError("invalid argument. First argument must be array-like. Value: '".concat(e, "'"));
|
|
32
32
|
if (arguments.length < 2) throw new Error("insufficient arguments. Must provide a search value.");
|
|
33
33
|
if (arguments.length > 2) {
|
|
34
|
-
if (!isInteger(
|
|
35
|
-
(i =
|
|
34
|
+
if (!isInteger(t)) throw new TypeError("invalid argument. Third argument must be an integer. Value: '".concat(t, "'."));
|
|
35
|
+
(i = t) < 0 && (i = 0);
|
|
36
36
|
} else i = 0;
|
|
37
37
|
if (isString(e)) {
|
|
38
38
|
if (!isString(r)) throw new TypeError("invalid argument. Second argument must be a string. Value: '".concat(r, "'."));
|
|
39
39
|
return -1 !== e.indexOf(r, i);
|
|
40
40
|
}
|
|
41
|
-
if (
|
|
42
|
-
for (o = i; o <
|
|
41
|
+
if (n = e.length, isnan(r)) {
|
|
42
|
+
for (o = i; o < n; o++) if (isnan(e[o])) return !0;
|
|
43
43
|
return !1;
|
|
44
44
|
}
|
|
45
|
-
for (o = i; o <
|
|
45
|
+
for (o = i; o < n; o++) if (e[o] === r) return !0;
|
|
46
46
|
return !1;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
var isArray = Array.isArray || function(e) {
|
|
50
50
|
return "[object Array]" === Object.prototype.toString.call(e);
|
|
51
|
-
}
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
function isObject(e) {
|
|
54
|
+
return "object" === (0, _typeof2.default)(e) && null !== e && !isArray(e);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
var has = Object.prototype.hasOwnProperty;
|
|
52
58
|
|
|
53
59
|
function hasOwnProp(e, r) {
|
|
54
60
|
return null != e && has.call(e, r);
|
|
@@ -61,5 +67,6 @@ module.exports = {
|
|
|
61
67
|
isString: isString,
|
|
62
68
|
contains: contains,
|
|
63
69
|
isArray: isArray,
|
|
70
|
+
isObject: isObject,
|
|
64
71
|
hasOwnProp: hasOwnProp
|
|
65
72
|
};
|
package/lib/algorithm/rank.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _templateObject, _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"), _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral")), _require = require("./is"), isCollection = _require.isCollection, contains = _require.contains, isArray = _require.isArray, hasOwnProp = _require.hasOwnProp, METHODS = [ "min", "max", "average", "dense", "ordinal" ], MISSING = [ "last", "first", "remove" ];
|
|
3
|
+
var _templateObject, _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"), _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral")), _require = require("./is"), isCollection = _require.isCollection, contains = _require.contains, isArray = _require.isArray, hasOwnProp = _require.hasOwnProp, isObject = _require.isObject, isString = _require.isString, METHODS = [ "min", "max", "average", "dense", "ordinal" ], MISSING = [ "last", "first", "remove", "*" ];
|
|
4
4
|
|
|
5
5
|
function validate(e, r) {
|
|
6
6
|
if (!isObject(r)) return new TypeError("invalid argument. Options argument must be an object. Value: '".concat(r, "'."));
|
|
@@ -42,13 +42,13 @@ function order(e) {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
function ranks(e, r) {
|
|
45
|
-
var n, i, t, o, a, s, l, u, g, m, c, f,
|
|
45
|
+
var n, i, t, o, a, s, l, u, g, m, c, f, h, d, p, w, b, v;
|
|
46
46
|
if (!isCollection(e)) throw new TypeError("invalid argument. First argument must be an array-like object. Value: '".concat(e, "'."));
|
|
47
|
-
if (
|
|
48
|
-
for (c =
|
|
49
|
-
|
|
50
|
-
if (n = isMissing(e, s),
|
|
51
|
-
|
|
47
|
+
if (h = {}, arguments.length > 1 && (p = validate(h, r))) throw p;
|
|
48
|
+
for (c = h.method || "average", s = h.encoding || [ null, NaN ], g = h.missing || "last",
|
|
49
|
+
w = e.length, d = [], b = 0; b < w; b++) contains(s, e[b]) || d.push(e[b]);
|
|
50
|
+
if (n = isMissing(e, s), w = d.length, o = 0, f = new Array(w), u = order(d), "ordinal" === c) for (b = 0; b < w; b++) f[u[b]] = b + 1; else for (i = 0,
|
|
51
|
+
b = 0; b < w; b++) if (l = b + 1, b === w - 1 || d[u[b]] !== d[u[l]]) {
|
|
52
52
|
switch (c) {
|
|
53
53
|
case "min":
|
|
54
54
|
m = l - i;
|
|
@@ -66,16 +66,20 @@ function ranks(e, r) {
|
|
|
66
66
|
default:
|
|
67
67
|
m = l - .5 * i;
|
|
68
68
|
}
|
|
69
|
-
for (
|
|
69
|
+
for (v = b - i; v < l; v++) f[u[v]] = m;
|
|
70
70
|
i = 0;
|
|
71
71
|
} else i += 1;
|
|
72
72
|
if ("first" === g) {
|
|
73
|
-
for (t = sum(n),
|
|
74
|
-
|
|
73
|
+
for (t = sum(n), v = 1, a = new Array(n.length), b = 0; b < n.length; b++) n[b] ? (a[b] = v,
|
|
74
|
+
v += 1) : a[b] = f.shift() + t;
|
|
75
75
|
return a;
|
|
76
76
|
}
|
|
77
77
|
if ("last" === g) {
|
|
78
|
-
for (a = new Array(n.length),
|
|
78
|
+
for (a = new Array(n.length), b = 0; b < n.length; b++) n[b] ? a[b] = b + f.length + 1 : a[b] = f.shift();
|
|
79
|
+
return a;
|
|
80
|
+
}
|
|
81
|
+
if ("*" === g) {
|
|
82
|
+
for (a = new Array(n.length), b = 0; b < n.length; b++) n[b] ? a[b] = null : a[b] = f.shift();
|
|
79
83
|
return a;
|
|
80
84
|
}
|
|
81
85
|
return f;
|
package/lib/math/colorUtil.js
CHANGED
|
@@ -9,7 +9,7 @@ var utils = require("./../utils"), colorKeyWordsHexStr = require("./_keyColor"),
|
|
|
9
9
|
n < 1 && (t += n = n.toString(16).substring(2, 4));
|
|
10
10
|
} else {
|
|
11
11
|
var s = Number(e[o]).toString(16);
|
|
12
|
-
1 === s.length && (s =
|
|
12
|
+
1 === s.length && (s = "0".concat(s)), t += s;
|
|
13
13
|
}
|
|
14
14
|
return 7 !== t.length && 9 !== t.length && (t = r), t;
|
|
15
15
|
}
|
|
@@ -29,7 +29,7 @@ var utils = require("./../utils"), colorKeyWordsHexStr = require("./_keyColor"),
|
|
|
29
29
|
r.indexOf("rgb") > -1 && (e = e.replace(rgbaRegex, ""));
|
|
30
30
|
for (var t = e.split(","), o = "#", n = 0; n < t.length; n++) if (n < 3) {
|
|
31
31
|
var s = Number(t[n]).toString(16);
|
|
32
|
-
1 === s.length && (s =
|
|
32
|
+
1 === s.length && (s = "0".concat(s)), o += s;
|
|
33
33
|
}
|
|
34
34
|
return o.length > 7 && (o = r), o;
|
|
35
35
|
}, toRGBcolor = function(r) {
|