Skip to content

Commit 4f9b320

Browse files
committed
Refactor readme.md
1 parent c5677d3 commit 4f9b320

File tree

1 file changed

+25
-16
lines changed

1 file changed

+25
-16
lines changed

readme.md

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,27 @@ fs.writeFileSync('output.json', JSON.stringify(data, null, 2) + '\n');
3131
Transforms the given value (string) to JSON. Don’t like the default
3232
comment 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

135144
Some 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

Comments
 (0)