amos-tool 1.6.5 → 1.6.7

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 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 Fri Nov 24 2023 15:08:23 GMT+0800 (GMT+08:00) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
493
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.6</a> on Fri Nov 24 2023 17:11:24 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
@@ -15745,7 +15745,7 @@ schedule <code>callback</code> to execute after <code>delay</code> ms.</p></td>
15745
15745
 
15746
15746
 
15747
15747
 
15748
- <h4 class="name" id="toRealSize"><span class="type-signature"></span>toRealSize<span class="signature">(val, type, parentWH)</span><span class="type-signature"></span></h4>
15748
+ <h4 class="name" id="toRealSize"><span class="type-signature"></span>toRealSize<span class="signature">(val, type, parentWH)</span><span class="type-signature"> &rarr; {Number}</span></h4>
15749
15749
 
15750
15750
 
15751
15751
 
@@ -15919,6 +15919,18 @@ schedule <code>callback</code> to execute after <code>delay</code> ms.</p></td>
15919
15919
 
15920
15920
 
15921
15921
 
15922
+ <dl class="param-type">
15923
+ <dt>
15924
+ Type
15925
+ </dt>
15926
+ <dd>
15927
+
15928
+ <span class="param-type">Number</span>
15929
+
15930
+
15931
+ </dd>
15932
+ </dl>
15933
+
15922
15934
 
15923
15935
 
15924
15936
 
@@ -16790,7 +16802,7 @@ schedule <code>callback</code> to execute after <code>delay</code> ms.</p></td>
16790
16802
  <br class="clear">
16791
16803
 
16792
16804
  <footer>
16793
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.6</a> on Fri Nov 24 2023 15:08:23 GMT+0800 (GMT+08:00) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
16805
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.6</a> on Fri Nov 24 2023 17:11:24 GMT+0800 (GMT+08:00) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
16794
16806
  </footer>
16795
16807
 
16796
16808
  <script>prettyPrint();</script>
package/docs/index.html CHANGED
@@ -793,7 +793,7 @@ convert2BMP(canvas, width, height)</p>
793
793
  <br class="clear">
794
794
 
795
795
  <footer>
796
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.6</a> on Fri Nov 24 2023 15:08:23 GMT+0800 (GMT+08:00) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
796
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.6</a> on Fri Nov 24 2023 17:11:24 GMT+0800 (GMT+08:00) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
797
797
  </footer>
798
798
 
799
799
  <script>prettyPrint();</script>
@@ -15,20 +15,24 @@ function toPixel(e) {
15
15
  var _100 = 100;
16
16
 
17
17
  function toRealSize(e, t, i) {
18
- if (-1 !== e.indexOf("%")) {
19
- var r = parseFloat(e) / _100, n = "width" === t ? r * (i || window.innerWidth) : r * (i || window.innerHeight);
20
- return Math.floor(n);
18
+ if (!e) return e;
19
+ if (utils.isNumber(e)) return Number(e);
20
+ if (utils.isString(e)) {
21
+ if (-1 !== e.indexOf("%")) {
22
+ var r = parseFloat(e) / _100, n = "width" === t ? r * (i || window.innerWidth) : r * (i || window.innerHeight);
23
+ return Math.floor(n);
24
+ }
25
+ if (-1 !== e.indexOf("vw")) {
26
+ var o = parseFloat(e) / _100 * window.innerWidth;
27
+ return Math.floor(o);
28
+ }
29
+ if (-1 !== e.indexOf("vh")) {
30
+ var l = parseFloat(e) / _100 * window.innerHeight;
31
+ return Math.floor(l);
32
+ }
21
33
  }
22
- if (-1 !== e.indexOf("vw")) {
23
- var o = parseFloat(e) / _100 * window.innerWidth;
24
- return Math.floor(o);
25
- }
26
- if (-1 !== e.indexOf("vh")) {
27
- var l = parseFloat(e) / _100 * window.innerHeight;
28
- return Math.floor(l);
29
- }
30
- var a = parseFloat(e);
31
- return isNaN(a) ? 0 : a;
34
+ var u = parseFloat(e);
35
+ return isNaN(u) ? 0 : u;
32
36
  }
33
37
 
34
38
  module.exports = completeUnit, module.exports.toPixel = toPixel, module.exports.toRealSize = toRealSize;
package/lib/utils.js CHANGED
@@ -8,6 +8,8 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
8
8
  var t = getLength(e);
9
9
  return "number" == typeof t && t >= 0 && t <= MAX_ARRAY_INDEX;
10
10
  }, isNumber = function(e) {
11
+ if (isArray(e)) return !1;
12
+ if (isObject(e)) return !1;
11
13
  var t = /^(\-|\+)?([0-9]+(\.[0-9]+)?|Infinity)$/.test(e), n = "number" == typeof e && !isNaN(e);
12
14
  return t || n;
13
15
  }, isFloat = function(e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "amos-tool",
3
- "version": "1.6.5",
3
+ "version": "1.6.7",
4
4
  "description": "amos ui tool",
5
5
  "main": "index.js",
6
6
  "directories": {