.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / strip-json-comments / index.d.ts
1 declare namespace stripJsonComments {
2         interface Options {
3                 /**
4                 Replace comments with whitespace instead of stripping them entirely.
5
6                 @default true
7                 */
8                 readonly whitespace?: boolean;
9         }
10 }
11
12 /**
13 Strip comments from JSON. Lets you use comments in your JSON files!
14
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.
16
17 @param jsonString - Accepts a string with JSON.
18 @returns A JSON string without comments.
19
20 @example
21 ```
22 const json = `{
23         // Rainbows
24         "unicorn": "cake"
25 }`;
26
27 JSON.parse(stripJsonComments(json));
28 //=> {unicorn: 'cake'}
29 ```
30 */
31 declare function stripJsonComments(
32         jsonString: string,
33         options?: stripJsonComments.Options
34 ): string;
35
36 export = stripJsonComments;