Socket
Socket
Sign inDemoInstall

fast-json-stringify

Package Overview
Dependencies
11
Maintainers
9
Versions
157
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.14.0 to 5.14.1

2

index.js

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

if (key === '$ref' && value.charAt(0) === '#') {
if (key === '$ref' && typeof value === 'string' && value.charAt(0) === '#') {
value = schemaId + value

@@ -444,0 +444,0 @@ }

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

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

@@ -720,1 +720,37 @@ 'use strict'

})
test('do not crash with $ref prop', (t) => {
t.plan(1)
const schema = {
title: 'object with $ref',
type: 'object',
properties: {
outside: {
$ref: '#/$defs/outside'
}
},
$defs: {
inside: {
type: 'object',
properties: {
$ref: {
type: 'string'
}
}
},
outside: {
allOf: [{
$ref: '#/$defs/inside'
}]
}
}
}
const stringify = build(schema)
const value = stringify({
outside: {
$ref: 'true'
}
})
t.equal(value, '{"outside":{"$ref":"true"}}')
})
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc