@@ -31,18 +31,27 @@ fs.writeFileSync('output.json', JSON.stringify(data, null, 2) + '\n');
3131Transforms the given value (string) to JSON. Don’t like the default
3232comment and property-value pair delimiters? Specify your own:
3333
34- ###### ` options `
35-
36- * ` comment ` (` string ` or ` boolean ` , default: ` '%' ` )
37- — Character to use for line-comments; ` false ` turns off comments;
38- * ` delimiter ` (` string ` , default: ` ':' ` )
39- — Character to use as delimiter between property-value pairs;
40- * ` forgiving ` (` string ` or ` boolean ` , default: ` false ` )
41- — When ` true ` , doesn’t throw for duplicate keys, when ` "fix" ` ,
42- doesn’t throw for property-value pairs and overwrites
43- (see [ errors] [ ] );
44- * ` log ` (` boolean ` , default: ` true ` )
45- — Whether to log when ` forgiving ` ignores an error.
34+ ##### ` options `
35+
36+ ###### ` options.comment `
37+
38+ Character to use for line-comments, ` false ` turns off comments (` string ` or
39+ ` boolean ` , default: ` '%' ` )
40+
41+ ###### ` options.delimiter `
42+
43+ Character to use as delimiter between property-value pairs (` string ` ,
44+ default: ` ':' ` )
45+
46+ ###### ` options.forgiving `
47+
48+ How relaxed to be (` string ` or ` boolean ` , default: ` false ` ). When ` true ` ,
49+ doesn’t throw for duplicate keys. When ` "fix" ` , doesn’t throw for
50+ property-value pairs and overwrites (see [ errors] [ ] ).
51+
52+ ###### ` options.log `
53+
54+ Whether to log when ` forgiving ` ignores an error (` boolean ` , default: ` true ` ).
4655
4756## Why
4857
@@ -134,11 +143,11 @@ Yields:
134143
135144Some errors are thrown when malformed “plain-text” is found, such as:
136145
137- * When lines both with and without colons exist;
138- * In arrays, when duplicate values exist (unless ` forgiving: true ` );
139- * In objects, when duplicate properties exist (unless ` forgiving: true ` ).
146+ * When lines both with and without colons exist
147+ * In arrays, when duplicate values exist (unless ` forgiving: true ` )
148+ * In objects, when duplicate properties exist (unless ` forgiving: true ` )
140149* In objects, when duplicate properties with different values exist
141- (unless ` forgiving: "fix" ` ).
150+ (unless ` forgiving: "fix" ` )
142151
143152## License
144153
0 commit comments