Skip to content

Commit 2a997d6

Browse files
committed
docs: add details on escapeHeaderNestedDots
1 parent 00d9227 commit 2a997d6

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,27 @@ Returns the CSV `string` or rejects with an `Error` if there was an issue.
6262
* Default: `\n`
6363
* `emptyFieldValue` - Any - Value that, if specified, will be substituted in for field values that are `undefined`, `null`, or an empty string.
6464
* Default: none
65+
* `escapeHeaderNestedDots` - Boolean - Should nested dots in header keys be escaped?
66+
* Default: `true`
67+
* Example:
68+
```json
69+
[
70+
{
71+
"a.a": "1"
72+
}
73+
]
74+
```
75+
* `true` will generate the following CSV:
76+
```csv
77+
a\.a
78+
1
79+
```
80+
* `false` will generate the following CSV:
81+
```csv
82+
a.a
83+
1
84+
```
85+
* Note: This may result in CSV output that does not map back exactly to the original JSON.
6586
* `excelBOM` - Boolean - Should a unicode character be prepended to allow Excel to open a UTF-8 encoded file with non-ASCII characters present.
6687
* `excludeKeys` - Array - Specify the keys that should be excluded from the output. Provided keys will also be used as a RegExp to help exclude keys under a specified prefix, such as all keys of Objects in an Array when `expandArrayObjects` is `true`.
6788
* Default: `[]`

0 commit comments

Comments
 (0)