Comparing version
**2.0.0 / 2025-02-20** | ||
- Migrating to ESM modules. No functional change | ||
**1.1.0 / 2025-02-20** | ||
- fix (#9): support missing floating point and e notations |
{ | ||
"name": "strnum", | ||
"version": "1.1.0", | ||
"version": "2.0.0", | ||
"description": "Parse String to Number based on configuration", | ||
"type": "module", | ||
"main": "strnum.js", | ||
@@ -22,4 +23,4 @@ "scripts": { | ||
"devDependencies": { | ||
"jasmine": "^3.10.0" | ||
"jasmine": "^5.6.0" | ||
} | ||
} |
@@ -16,3 +16,3 @@ const hexRegex = /^[-+]?0x[a-fA-F0-9]+$/; | ||
function toNumber(str, options = {}){ | ||
export default function toNumber(str, options = {}){ | ||
options = Object.assign({}, consider, options ); | ||
@@ -107,2 +107,1 @@ if(!str || typeof str !== "string" ) return str; | ||
} | ||
module.exports = toNumber |
@@ -1,2 +0,2 @@ | ||
const toNumber = require("./strnum"); | ||
import toNumber from "./strnum.js"; | ||
@@ -3,0 +3,0 @@ describe("Should convert all the valid numeric strings to number", () => { |
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
0
-100%Yes
NaN18128
-0.53%7
-12.5%259
-1.89%