util-helpers 4.19.0 → 4.19.1

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/esm/VERSION.js CHANGED
@@ -1,4 +1,4 @@
1
- var VERSION = "4.19.0";
1
+ var VERSION = "4.19.1";
2
2
  var VERSION$1 = VERSION;
3
3
 
4
4
  export { VERSION$1 as default };
package/esm/index.js CHANGED
@@ -57,6 +57,6 @@ export { default as findTreeSelect } from './findTreeSelect.js';
57
57
  export { setDisableWarning } from './utils/config.js';
58
58
  export { default as VERSION } from './VERSION.js';
59
59
 
60
- var version = "4.19.0";
60
+ var version = "4.19.1";
61
61
 
62
62
  export { version };
package/esm/round.js CHANGED
@@ -1,16 +1,8 @@
1
- import { isNaN } from 'ut2';
2
- import divide from './divide.js';
3
- import times from './times.js';
4
- import { transformEffectiveNumber } from './utils/math.util.js';
1
+ import { round } from 'ut2';
5
2
 
6
- function round(num, precision) {
3
+ function _round(num, precision) {
7
4
  if (precision === void 0) { precision = 0; }
8
- num = transformEffectiveNumber(num);
9
- if (isNaN(num)) {
10
- return Number.NaN;
11
- }
12
- var base = Math.pow(10, precision);
13
- return divide(Math.round(times(num, base)), base);
5
+ return round(num, precision);
14
6
  }
15
7
 
16
- export { round as default };
8
+ export { _round as default };
package/lib/VERSION.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var VERSION = "4.19.0";
3
+ var VERSION = "4.19.1";
4
4
  var VERSION$1 = VERSION;
5
5
 
6
6
  module.exports = VERSION$1;
package/lib/index.js CHANGED
@@ -59,7 +59,7 @@ var findTreeSelect = require('./findTreeSelect.js');
59
59
  var config = require('./utils/config.js');
60
60
  var VERSION = require('./VERSION.js');
61
61
 
62
- exports.version = "4.19.0";
62
+ exports.version = "4.19.1";
63
63
 
64
64
  exports.isMobile = isMobile;
65
65
  exports.isTelephone = isTelephone;
package/lib/round.js CHANGED
@@ -1,18 +1,10 @@
1
1
  'use strict';
2
2
 
3
3
  var ut2 = require('ut2');
4
- var divide = require('./divide.js');
5
- var times = require('./times.js');
6
- var math_util = require('./utils/math.util.js');
7
4
 
8
- function round(num, precision) {
5
+ function _round(num, precision) {
9
6
  if (precision === void 0) { precision = 0; }
10
- num = math_util.transformEffectiveNumber(num);
11
- if (ut2.isNaN(num)) {
12
- return Number.NaN;
13
- }
14
- var base = Math.pow(10, precision);
15
- return divide(Math.round(times(num, base)), base);
7
+ return ut2.round(num, precision);
16
8
  }
17
9
 
18
- module.exports = round;
10
+ module.exports = _round;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "util-helpers",
3
- "version": "4.19.0",
3
+ "version": "4.19.1",
4
4
  "description": "一个基于业务场景的工具方法库",
5
5
  "main": "lib/index.js",
6
6
  "module": "esm/index.js",
@@ -93,6 +93,6 @@
93
93
  },
94
94
  "dependencies": {
95
95
  "tslib": "^2.5.0",
96
- "ut2": "^1.0.2"
96
+ "ut2": "^1.0.5"
97
97
  }
98
98
  }
package/types/round.d.ts CHANGED
@@ -14,5 +14,5 @@
14
14
  * round(4060, -2); // 4100
15
15
  *
16
16
  */
17
- declare function round(num: string | number, precision?: number): number;
18
- export default round;
17
+ declare function _round(num: string | number, precision?: number): number;
18
+ export default _round;