Version 2.1.0
Changes
- Fixed
JSONPathQuery
serialization.JSONPathQuery.toString()
was not handling name selectors containing'
or\
, and was a bit vague about the format serialized paths would use.JSONPathQuery.toString()
now accepts an options object with a singleform
option.form
can be one of"pretty"
(the default) or"canonical"
. The canonical format uses bracket notation and single quotes, whereas the pretty format uses shorthand notation where possible and double quotes. See issue #30 and PR #32. - Added
JSONPathNode.getPath(options?)
, which returns a string representation of the node's location. As above, theform
option can be one of"pretty"
(the default) or"canonical"
. - Deprecated
JSONPathNode.path
in favour ofJSONPathNode.getPath(options?)
. - Changed the string representation of filter selectors. Both canonical and pretty formats now only include parentheses where necessary.