-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for paths with escaped dots in path.
There are valid JSON keys which can contain a nested '.' in them. However, this module would not handle those properly, except in a limited set of conditions. This commit adds support for these paths when they are properly escaped using a '\' character. However, this does slightly change the base functionality for the module where a value with the same key path as a top-level key with the nested value's key path will now read the nested value, unless the provided path has appropriate escaping on the key path. For example... with the example doc: { 'a.b' : 2, a : { b : 3 } } evaluatePath(doc, 'a.b') will now return 3 and evaluatePath(doc, 'a\\.b') will now return 2 Related to mrodrig/json-2-csv#184
- Loading branch information
Showing
3 changed files
with
88 additions
and
5 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters