strnum 2.1.0 → 2.1.2

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.
@@ -0,0 +1,5 @@
1
+ If you believe you have found a security vulnerability in this repository which can be potentially harful for the users in anyway, please do not report security vulnerabilities through public GitHub issues. Instead, please report it to us as described below.
2
+
3
+ ## Security contact information
4
+
5
+ To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.
package/CHANGELOG.md CHANGED
@@ -1,4 +1,7 @@
1
1
 
2
+ **2.1.1 / 2025-05-15**
3
+ - remove unnecessary check to remove lint error
4
+
2
5
  **2.1.0 / 2025-05-01**
3
6
  - fix e-notation
4
7
  - to return string when invalid enotation is found. Eg `E24`
package/README.md CHANGED
@@ -95,3 +95,9 @@ leadingZeros: true, //when number with leading zeros like 08 should be parsed. 0
95
95
  eNotation: true, //when number with eNotation or number parsed in eNotation should be considered
96
96
  skipLike: /regex/ //when string should not be parsed when it matches the specified regular expression
97
97
  ```
98
+
99
+
100
+ # Try out our other work
101
+
102
+ WishIn - You need it if negative thoughts take over all the time <br>
103
+ <a href="https://play.google.com/store/apps/details?id=com.solothought.wishin"> <img src="https://solothought.com/products/assets/images/wishin/YouTubeThumbnail.png" width="500px"/> </a>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "strnum",
3
- "version": "2.1.0",
3
+ "version": "2.1.2",
4
4
  "description": "Parse String to Number based on configuration",
5
5
  "type": "module",
6
6
  "main": "strnum.js",
package/strnum.js CHANGED
@@ -25,7 +25,7 @@ export default function toNumber(str, options = {}){
25
25
  return parse_int(trimmedStr, 16);
26
26
  // }else if (options.oct && octRegex.test(str)) {
27
27
  // return Number.parseInt(val, 8);
28
- }else if (trimmedStr.search(/.+[eE].+/)!== -1) { //eNotation
28
+ }else if (trimmedStr.includes('e') || trimmedStr.includes('E')) { //eNotation
29
29
  return resolveEnotation(str,trimmedStr,options);
30
30
  // }else if (options.parseBin && binRegex.test(str)) {
31
31
  // return Number.parseInt(val, 2);
@@ -52,7 +52,7 @@ export default function toNumber(str, options = {}){
52
52
  const num = Number(trimmedStr);
53
53
  const parsedStr = String(num);
54
54
 
55
- if( num === 0 || num === -0) return num;
55
+ if( num === 0) return num;
56
56
  if(parsedStr.search(/[eE]/) !== -1){ //given number is long and parsed to eNotation
57
57
  if(options.eNotation) return num;
58
58
  else return str;