Socket
Socket
Sign inDemoInstall

fast-json-stringify

Package Overview
Dependencies
Maintainers
2
Versions
160
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fast-json-stringify - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

test/integer.test.js

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc