1 declare namespace stripJsonComments {
4 Replace comments with whitespace instead of stripping them entirely.
8 readonly whitespace?: boolean;
13 Strip comments from JSON. Lets you use comments in your JSON files!
15 It will replace single-line comments `//` and multi-line comments `/**\/` with whitespace. This allows JSON error positions to remain as close as possible to the original source.
17 @param jsonString - Accepts a string with JSON.
18 @returns A JSON string without comments.
27 JSON.parse(stripJsonComments(json));
28 //=> {unicorn: 'cake'}
31 declare function stripJsonComments(
33 options?: stripJsonComments.Options
36 export = stripJsonComments;