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 2.3.0 to 2.3.1

3

index.js

@@ -8,3 +8,2 @@ 'use strict'

var util = require('util')
var validate = require('./schema-validator')

@@ -838,3 +837,3 @@ var stringSimilarity = null

code += `
valid = ajv.validate(${util.inspect(i, { depth: null })}, obj)
valid = ajv.validate(${JSON.stringify(i)}, obj)
if (valid) {

@@ -841,0 +840,0 @@ `

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

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

@@ -212,1 +212,48 @@ 'use strict'

})
// https://github.com/fastify/fast-json-stringify/issues/279
test('object array with anyOf and symbol', (t) => {
t.plan(1)
const ArrayKind = Symbol('ArrayKind')
const ObjectKind = Symbol('LiteralKind')
const UnionKind = Symbol('UnionKind')
const LiteralKind = Symbol('LiteralKind')
const StringKind = Symbol('StringKind')
const schema = {
kind: ArrayKind,
type: 'array',
items: {
kind: ObjectKind,
type: 'object',
properties: {
name: {
kind: StringKind,
type: 'string'
},
option: {
kind: UnionKind,
anyOf: [
{
kind: LiteralKind,
type: 'string',
enum: ['Foo']
},
{
kind: LiteralKind,
type: 'string',
enum: ['Bar']
}
]
}
},
required: ['name', 'option']
}
}
const stringify = build(schema)
const value = stringify([
{ name: 'name-0', option: 'Foo' },
{ name: 'name-1', option: 'Bar' }
])
t.is(value, '[{"name":"name-0","option":"Foo"},{"name":"name-1","option":"Bar"}]')
})
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