🚀 Socket Launch Week 🚀 Day 5: Introducing Socket Fix.Learn More
Socket
Sign inDemoInstall
Socket

strnum

Package Overview
Dependencies
Maintainers
0
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

strnum - npm Package Compare versions

Comparing version

to
2.0.0

3

CHANGELOG.md
**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

5

package.json
{
"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", () => {