strnum 1.1.0 → 2.0.0
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/CHANGELOG.md +3 -0
- package/package.json +3 -2
- package/strnum.js +1 -2
- package/strnum.test.js +1 -1
- package/test.js +0 -6
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "strnum",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Parse String to Number based on configuration",
|
|
5
|
+
"type": "module",
|
|
5
6
|
"main": "strnum.js",
|
|
6
7
|
"scripts": {
|
|
7
8
|
"test": "jasmine strnum.test.js"
|
|
@@ -19,6 +20,6 @@
|
|
|
19
20
|
"author": "Amit Gupta (https://amitkumargupta.work/)",
|
|
20
21
|
"license": "MIT",
|
|
21
22
|
"devDependencies": {
|
|
22
|
-
"jasmine": "^
|
|
23
|
+
"jasmine": "^5.6.0"
|
|
23
24
|
}
|
|
24
25
|
}
|
package/strnum.js
CHANGED
|
@@ -13,7 +13,7 @@ const consider = {
|
|
|
13
13
|
//skipLike: /regex/
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
function toNumber(str, options = {}){
|
|
16
|
+
export default function toNumber(str, options = {}){
|
|
17
17
|
options = Object.assign({}, consider, options );
|
|
18
18
|
if(!str || typeof str !== "string" ) return str;
|
|
19
19
|
|
|
@@ -103,4 +103,3 @@ function parse_int(numStr, base){
|
|
|
103
103
|
else if(window && window.parseInt) return window.parseInt(numStr, base);
|
|
104
104
|
else throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")
|
|
105
105
|
}
|
|
106
|
-
module.exports = toNumber
|
package/strnum.test.js
CHANGED