Socket
Socket
Sign inDemoInstall

json-parser

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-parser - npm Package Compare versions

Comparing version 1.1.4 to 1.1.5

11

index.js

@@ -81,3 +81,10 @@ 'use strict';

function walk () {
switch (type()) {
var tt = type();
var negative = '';
if (tt === '-') {
next();
tt = type();
negative = '-';
}
switch (tt) {
case '{':

@@ -95,3 +102,3 @@ next();

next();
return JSON.parse(value);
return JSON.parse(negative + value);
}

@@ -98,0 +105,0 @@

2

package.json
{
"name": "json-parser",
"version": "1.1.4",
"version": "1.1.5",
"description": "JSON parser to parse JSON object and MAINTAIN comments.",

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

@@ -76,2 +76,12 @@ 'use strict';

}
},
{
// #8
d: 'support negative numbers',
s: '{//a\n"a": -1}',
o: '{"a": -1}',
e: function (obj) {
expect(obj.a).to.equal(-1);
expect('// a' in obj).to.equal(true);
}
}

@@ -78,0 +88,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