@bbn/bbn 1.0.395 → 1.0.396

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/dist/_.js CHANGED
@@ -1,4 +1,3 @@
1
- import checkType from './fn/type/checkType.js';
2
1
  /**
3
2
  * Translate an expression using the object bbn.lng
4
3
  *
@@ -19,7 +18,16 @@ export default function _() {
19
18
  if (!tmp) {
20
19
  tmp = type === 'd' ? 0 : '';
21
20
  }
22
- checkType(tmp, type === 'd' ? 'number' : 'string', bbn._("The value you gave did not correspond, check the loggg"));
21
+ var curType = typeof tmp;
22
+ if ((type === 'd') && (curType !== 'number')) {
23
+ tmp = parseFloat(tmp);
24
+ if (isNaN(tmp)) {
25
+ tmp = 0;
26
+ }
27
+ }
28
+ else if ((type === 's') && (curType !== 'string')) {
29
+ tmp = '' + tmp;
30
+ }
23
31
  return tmp;
24
32
  });
25
33
  }