fast-json-stringify
Advanced tools
Comparing version 5.6.0 to 5.6.1
@@ -53,13 +53,10 @@ 'use strict' | ||
asNumber (i) { | ||
if (typeof i !== 'number') { | ||
i = Number(i) | ||
} | ||
// NaN !== NaN | ||
if (i !== i) { // eslint-disable-line no-self-compare | ||
const num = Number(i) | ||
if (Number.isNaN(num)) { | ||
throw new Error(`The value "${i}" cannot be converted to a number.`) | ||
} else if (!Number.isFinite(num)) { | ||
return null | ||
} else { | ||
return '' + num | ||
} | ||
if (i === Infinity || i === -Infinity) { | ||
return 'null' | ||
} | ||
return '' + i | ||
} | ||
@@ -66,0 +63,0 @@ |
{ | ||
"name": "fast-json-stringify", | ||
"version": "5.6.0", | ||
"version": "5.6.1", | ||
"description": "Stringify your JSON at max speed", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
351447
80
13046