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.3 to 1.1.4

21

index.js

@@ -10,6 +10,25 @@ 'use strict';

function tokenize (code) {
return esprima.tokenize(code, {
var list = esprima.tokenize(code, {
comment: true,
loc: true
});
if (list.comment) {
return list;
}
var result = [];
var comments = [];
list.map(function (t) {
if (t.type === 'LineComment') {
t.type = 'Line';
comments.push(t);
} else if (t.type === 'BlockComment') {
t.type = 'Block';
comments.push(t);
} else {
result.push(t);
}
});
result.comments = comments;
return result;
}

@@ -16,0 +35,0 @@

4

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

@@ -36,4 +36,4 @@ "main": "index.js",

"dependencies": {
"esprima": "~2.6.0"
"esprima": "^2.7.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