comment-json
Advanced tools
Comparing version 1.0.2 to 1.1.0
@@ -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 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21431
156