@bbn/bbn 1.0.286 → 1.0.288

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.
@@ -8,6 +8,6 @@
8
8
  * @returns {}
9
9
  */
10
10
  export default function roundDecimal(value, decimals) {
11
- return Math.round(Math.pow(Math.pow(value, decimals), -decimals));
11
+ return Number(Math.round(parseFloat((value + 'e' + decimals) + 'e-' + decimals)));
12
12
  }
13
13
  ;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @method isHex
3
+ * @todo Add method description for isFunction
4
+ * @global
5
+ * @memberof bbn.fn
6
+ * @returns {Boolean}
7
+ */
8
+ export default function isHex(num: any): boolean;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @method isHex
3
+ * @todo Add method description for isFunction
4
+ * @global
5
+ * @memberof bbn.fn
6
+ * @returns {Boolean}
7
+ */
8
+ export default function isHex(num) {
9
+ return Boolean(num.match(/^0x[0-9a-f]+$/i));
10
+ }
11
+ ;
package/dist/fn.d.ts CHANGED
@@ -136,6 +136,7 @@ import isEmpty from './fn/type/isEmpty.js';
136
136
  import isEvent from './fn/type/isEvent.js';
137
137
  import isFocused from './fn/browser/isFocused.js';
138
138
  import isFunction from './fn/type/isFunction.js';
139
+ import isHex from './fn/type/isHex.js';
139
140
  import isHostname from './fn/type/isHostname.js';
140
141
  import isInside from './fn/html/isInside.js';
141
142
  import isInt from './fn/type/isInt.js';
@@ -373,6 +374,7 @@ declare const _default: {
373
374
  isEvent: typeof isEvent;
374
375
  isFocused: typeof isFocused;
375
376
  isFunction: typeof isFunction;
377
+ isHex: typeof isHex;
376
378
  isHostname: typeof isHostname;
377
379
  isInside: typeof isInside;
378
380
  isInt: typeof isInt;
package/dist/fn.js CHANGED
@@ -136,6 +136,7 @@ import isEmpty from './fn/type/isEmpty.js';
136
136
  import isEvent from './fn/type/isEvent.js';
137
137
  import isFocused from './fn/browser/isFocused.js';
138
138
  import isFunction from './fn/type/isFunction.js';
139
+ import isHex from './fn/type/isHex.js';
139
140
  import isHostname from './fn/type/isHostname.js';
140
141
  import isInside from './fn/html/isInside.js';
141
142
  import isInt from './fn/type/isInt.js';
@@ -373,6 +374,7 @@ export default {
373
374
  isEvent: isEvent,
374
375
  isFocused: isFocused,
375
376
  isFunction: isFunction,
377
+ isHex: isHex,
376
378
  isHostname: isHostname,
377
379
  isInside: isInside,
378
380
  isInt: isInt,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbn/bbn",
3
- "version": "1.0.286",
3
+ "version": "1.0.288",
4
4
  "description": "Javascript toolkit",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",