Skip to content

Commit

Permalink
Add support for keys with nested dots.
Browse files Browse the repository at this point in the history
Through modifications to `doc-path` and `deeks` dependency underlying
code, I've worked to add support for the keys with nested dots in the
JSON key path and conversion back to CSV. This was achieved through the
`deeks` module's new `escapeNestedDots` option which will now be set to
`true`. Additionally, support for this escaping was added to `doc-path`
so that the correct values are retrieved and can also be correctly set
for csv2json. This commit adds the option specification for the `deeks`
module, and once the dependency modules are released, another commit
will be pushed which will update the dependency module versions to the
newest releases which add support.

Fixes #184
  • Loading branch information
mrodrig committed May 26, 2021
1 parent 2183282 commit 18bf0a2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/json2csv.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ const Json2Csv = function(options) {
expandingWithoutUnwinding = options.expandArrayObjects && !options.unwindArrays,
deeksOptions = {
expandArrayObjects: expandingWithoutUnwinding,
ignoreEmptyArraysWhenExpanding: expandingWithoutUnwinding
ignoreEmptyArraysWhenExpanding: expandingWithoutUnwinding,
escapeNestedDots: true
};

/** HEADER FIELD FUNCTIONS **/
Expand Down

0 comments on commit 18bf0a2

Please sign in to comment.