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 1.9.0 to 1.9.1

12

index.js

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

if (merged.if && merged.then) {
innerR = addIfThenElse(merged, name, externalSchema, fullSchema)
innerR = addIfThenElse(merged, name + 'Then', externalSchema, fullSchema)
code += innerR.code

@@ -527,3 +527,3 @@ laterCode = innerR.laterCode

r = buildInnerObject(merged, name, externalSchema, fullSchema)
r = buildInnerObject(merged, name + 'Then', externalSchema, fullSchema)
code += r.code

@@ -543,3 +543,3 @@ laterCode += r.laterCode

if (merged.if && merged.then) {
innerR = addIfThenElse(merged, name, externalSchema, fullSchema)
innerR = addIfThenElse(merged, name + 'Else', externalSchema, fullSchema)
code += innerR.code

@@ -549,3 +549,3 @@ laterCode += innerR.laterCode

r = buildInnerObject(merged, name, externalSchema, fullSchema)
r = buildInnerObject(merged, name + 'Else', externalSchema, fullSchema)
code += r.code

@@ -562,4 +562,4 @@ laterCode += r.laterCode

function toJSON (variableName) {
return `typeof ${variableName}.toJSON === 'function'
? ${variableName}.toJSON()
return `typeof ${variableName}.toJSON === 'function'
? ${variableName}.toJSON()
: ${variableName}

@@ -566,0 +566,0 @@ `

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

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -36,3 +36,13 @@ 'use strict'

'hi': { 'type': 'string' },
'hello': { 'type': 'number' }
'hello': { 'type': 'number' },
'list': {
'type': 'array',
'items': {
'type': 'object',
'properties': {
'name': { 'type': 'string' },
'value': { 'type': 'string' }
}
}
}
}

@@ -138,2 +148,7 @@ }

const nestedDeepElseSchema = {
'type': 'object',
'additionalProperties': schema
}
const fooBarInput = {

@@ -170,2 +185,5 @@ kind: 'foobar',

}
const deepFoobarInput = {
foobar: fooBarInput
}
const foobarOutput = JSON.stringify({

@@ -190,2 +208,5 @@ kind: 'foobar',

})
const deepFoobarOutput = JSON.stringify({
foobar: JSON.parse(foobarOutput)
})

@@ -241,2 +262,8 @@ t.test('if-then-else', t => {

expected: alphabetOutput
},
{
name: 'deep then - else',
schema: nestedDeepElseSchema,
input: deepFoobarInput,
expected: deepFoobarOutput
}

@@ -243,0 +270,0 @@ ]

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