fast-json-stringify
Advanced tools
Comparing version 1.0.0 to 1.1.0
47
index.js
@@ -297,8 +297,19 @@ 'use strict' | ||
code += ` | ||
${addComma} | ||
var t = Number(obj[keys[i]]) | ||
if (isLong && isLong(obj[keys[i]]) || !isNaN(t)) { | ||
json += $asString(keys[i]) + ':' + $asInteger(obj[keys[i]]) | ||
} | ||
` | ||
if (isLong) { | ||
code += ` | ||
if (isLong(obj[keys[i]]) || !isNaN(t)) { | ||
${addComma} | ||
json += $asString(keys[i]) + ':' + $asInteger(obj[keys[i]]) | ||
} | ||
` | ||
} else { | ||
code += ` | ||
if (!isNaN(t)) { | ||
${addComma} | ||
json += $asString(keys[i]) + ':' + t | ||
} | ||
` | ||
} | ||
} else if (type === 'number') { | ||
@@ -373,7 +384,20 @@ code += ` | ||
var rendered = false | ||
if (isLong && isLong(obj['${key}'])) { | ||
${addComma} | ||
json += '${$asString(key)}:' + obj['${key}'].toString() | ||
rendered = true | ||
} else { | ||
` | ||
if (isLong) { | ||
code += ` | ||
if (isLong(obj['${key}'])) { | ||
${addComma} | ||
json += '${$asString(key)}:' + obj['${key}'].toString() | ||
rendered = true | ||
} else { | ||
var t = Number(obj['${key}']) | ||
if (!isNaN(t)) { | ||
${addComma} | ||
json += '${$asString(key)}:' + t | ||
rendered = true | ||
} | ||
} | ||
` | ||
} else { | ||
code += ` | ||
var t = Number(obj['${key}']) | ||
@@ -385,4 +409,5 @@ if (!isNaN(t)) { | ||
} | ||
} | ||
` | ||
} | ||
code += ` | ||
if (rendered) { | ||
@@ -389,0 +414,0 @@ ` |
{ | ||
"name": "fast-json-stringify", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Stringify your JSON at max speed", | ||
@@ -13,3 +13,3 @@ "main": "index.js", | ||
"type": "git", | ||
"url": "git+https://github.com/mcollina/fast-json-stringify.git" | ||
"url": "git+https://github.com/fastify/fast-json-stringify.git" | ||
}, | ||
@@ -25,10 +25,11 @@ "keywords": [ | ||
"bugs": { | ||
"url": "https://github.com/mcollina/fast-json-stringify/issues" | ||
"url": "https://github.com/fastify/fast-json-stringify/issues" | ||
}, | ||
"homepage": "https://github.com/mcollina/fast-json-stringify#readme", | ||
"homepage": "https://github.com/fastify/fast-json-stringify#readme", | ||
"devDependencies": { | ||
"benchmark": "^2.1.4", | ||
"is-my-json-valid": "^2.17.1", | ||
"long": "^3.2.0", | ||
"long": "^4.0.0", | ||
"pre-commit": "^1.2.2", | ||
"proxyquire": "^1.8.0", | ||
"standard": "^10.0.3", | ||
@@ -35,0 +36,0 @@ "tap": "^11.0.0", |
Sorry, the diff of this file is not supported yet
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
67630
22
2403
8