ansuko 1.3.8 → 1.3.10

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/index.d.ts CHANGED
@@ -55,7 +55,7 @@ declare const isEmpty: (value: unknown) => boolean;
55
55
  * @example toNumber('abc') // null
56
56
  * @category Core Functions
57
57
  */
58
- declare const toNumber: (value: unknown, toFixed?: number) => number | null;
58
+ declare const toNumber: (value: unknown, toFixed?: unknown) => number | null;
59
59
  /**
60
60
  * Converts various inputs to boolean. Numbers: 0 -> false, non-zero -> true.
61
61
  * Strings: 'true'|'t'|'y'|'yes'|'ok' -> true; 'false'|'f'|'n'|'no'|'ng' -> false.
package/dist/index.js CHANGED
@@ -163,8 +163,9 @@ const toNumber = (value, toFixed) => {
163
163
  if (_.isNaN(v)) {
164
164
  return null;
165
165
  }
166
- if (toFixed !== undefined) {
167
- return parseFloat(v.toFixed(toFixed));
166
+ if (!_.isNil(toFixed)) {
167
+ const f = _.toNumber(toFixed);
168
+ return parseFloat(v.toFixed(f));
168
169
  }
169
170
  return v;
170
171
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ansuko",
3
- "version": "1.3.8",
3
+ "version": "1.3.10",
4
4
  "description": "A modern JavaScript/TypeScript utility library that extends lodash with practical, intuitive behaviors. Fixes lodash quirks, adds Promise support, Japanese text processing, and GeoJSON utilities.",
5
5
  "keywords": [
6
6
  "lodash",