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

is-my-json-valid

Package Overview
Dependencies
Maintainers
7
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-my-json-valid - npm Package Compare versions

Comparing version 2.20.2 to 2.20.3

29

index.js

@@ -48,9 +48,2 @@ var genobj = require('generate-object-property')

var formatName = function(field) {
field = JSON.stringify(field)
var pattern = /\[([^\[\]"]+)\]/
while (pattern.test(field)) field = field.replace(pattern, '."+$1+"')
return field
}
var types = {}

@@ -127,6 +120,25 @@

var syms = {}
var allocated = []
var gensym = function(name) {
return name+(syms[name] = (syms[name] || 0)+1)
var res = name+(syms[name] = (syms[name] || 0)+1)
allocated.push(res)
return res
}
var formatName = function(field) {
var s = JSON.stringify(field)
try {
var pattern = /\[([^\[\]"]+)\]/
while (pattern.test(s)) s = s.replace(pattern, replacer)
return s
} catch (_) {
return JSON.stringify(field)
}
function replacer (match, v) {
if (allocated.indexOf(v) === -1) throw new Error('Unreplaceable')
return '." + ' + v + ' + "'
}
}
var reversePatterns = {}

@@ -145,2 +157,3 @@ var patterns = function(p) {

vars.push(v+v[0])
allocated.push(v)
return v

@@ -147,0 +160,0 @@ }

{
"name": "is-my-json-valid",
"version": "2.20.2",
"version": "2.20.3",
"license": "MIT",

@@ -5,0 +5,0 @@ "repository": "mafintosh/is-my-json-valid",

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