Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

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 0.10.4 to 0.10.5

8

index.js

@@ -14,3 +14,3 @@ 'use strict'

code += `
const properties = ${JSON.stringify(schema.properties)}
const properties = ${JSON.stringify(schema.properties)} || {}
`

@@ -108,4 +108,4 @@ code += `

if (point === 34 || point === 92) {
result += str.slice(last, i) + '\\' + str[i]
last = i + 1
result += str.slice(last, i) + '\\'
last = i
}

@@ -269,3 +269,3 @@ }

Object.keys(schema.properties).forEach((key, i, a) => {
Object.keys(schema.properties || {}).forEach((key, i, a) => {
// Using obj.key !== undefined instead of obj.hasOwnProperty(prop) for perf reasons,

@@ -272,0 +272,0 @@ // see https://github.com/mcollina/fast-json-stringify/pull/3 for discussion.

{
"name": "fast-json-stringify",
"version": "0.10.4",
"version": "0.10.5",
"description": "Stringify your JSON at max speed",

@@ -30,3 +30,3 @@ "main": "index.js",

"pre-commit": "^1.1.3",
"standard": "^9.0.1",
"standard": "^10.0.0",
"tap": "^10.3.0"

@@ -33,0 +33,0 @@ },

@@ -183,1 +183,58 @@ 'use strict'

})
test('nested additionalProperties', (t) => {
t.plan(1)
const stringify = build({
title: 'additionalProperties',
type: 'array',
items: {
type: 'object',
properties: {
ap: {
type: 'object',
additionalProperties: { type: 'string' }
}
}
}
})
let obj = [{ ap: { value: 'string' } }]
t.equal('[{"ap":{"value":"string"}}]', stringify(obj))
})
test('very nested additionalProperties', (t) => {
t.plan(1)
const stringify = build({
title: 'additionalProperties',
type: 'array',
items: {
type: 'object',
properties: {
ap: {
type: 'object',
properties: {
nested: {
type: 'object',
properties: {
moarNested: {
type: 'object',
properties: {
finally: {
type: 'object',
additionalProperties: {
type: 'string'
}
}
}
}
}
}
}
}
}
}
})
let obj = [{ ap: { nested: { moarNested: { finally: { value: 'str' } } } } }]
t.equal('[{"ap":{"nested":{"moarNested":{"finally":{"value":"str"}}}}}]', stringify(obj))
})
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