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

comment-json

Package Overview
Dependencies
Maintainers
1
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

comment-json - npm Package Compare versions

Comparing version 1.0.2 to 1.1.0

4

lib/parse.js

@@ -7,4 +7,4 @@ 'use strict';

function parse (code, reviver) {
return parser.parse(code, reviver);
function parse (code, reviver, removes_comments) {
return parser.parse(code, reviver, removes_comments);
}
{
"name": "comment-json",
"version": "1.0.2",
"version": "1.1.0",
"description": "Parse and stringify JSON file with comments",

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

@@ -43,6 +43,8 @@ [![NPM version](https://badge.fury.io/js/comment-json.svg)](http://badge.fury.io/js/comment-json)

## json.parse(string, [reviver])
## json.parse(string, [reviver], [removes_comments])
The arguments are the same as the vanilla [`JSON.parse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse).
The arguments are the same as the vanilla [`JSON.parse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse), except for `removes_comments`:
- removes_comments `Boolean` If true, the comments won't be maintained, which is often used when we want to get a clean object.
Above all, `json.parse()` is not a parser with 100% accuracy to output an AST which describes every detail of the commented json, including the locations of every comments, whitespaces, etc.

@@ -49,0 +51,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