Releases: jg-rp/json-p3
Releases · jg-rp/json-p3
Version 2.2.2
Version 2.2.1
Fixes
- Update iregexp-check to fix regex range quantifiers with multiple digits. See issue 40.
Version 2.2.0
Fixes
- Fixed a bug where the non-standard current key identifier (
#) would be accepted when extra JSONPath syntax is disabled.
Features
- Added the
hasfunction extension (docs).
Version 2.1.1
Fixes
- Fixed parsing of filter queries containing multiple consecutive bracketed segments. Previously we were failing to parse queries like
$[?@[0][1]].
Version 2.1.0
Changes
- Fixed
JSONPathQueryserialization.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 singleformoption.formcan 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, theformoption can be one of"pretty"(the default) or"canonical". - Deprecated
JSONPathNode.pathin favour ofJSONPathNode.getPath(options?). - Changed the string representation of filter selectors. Both canonical and pretty formats now only include parentheses where necessary.
Version 2.0.0
Breaking changes
These API changes should only affect you if you're customizing the JSONPath parser, defining custom JSONPath selectors or inspecting JSONPath.selectors (now JSONPathQuery.segments). Otherwise query parsing and evaluation remains unchanged. See issue 11 for more information.
- Renamed
JSONPathtoJSONPathQueryto match terminology from RFC 9535. - Refactored
JSONPathQueryto be composed ofJSONPathSegments, each of which is composed of one or more instances ofJSONPathSelector. - Changed abstract method
JSONPathSelector.resolveandJSONPathSelector.lazyResolveto accept a single node argument instead of an array or iterator of nodes. Both still return zero or more nodes.
Version 1.3.5
Fixes
- Fixed a JSON Patch bug where we would not allow moving or copying to the end of an array using the special JSON Pointer token
-.
Version 1.3.4
Fixes
- Fixed decoding of JSONPath escape sequences (those found in name selectors and string literals). Previously we were relying on
JSON.parse()to unescape strings, now we have our ownunescapeString()function that rejects invalid code points and surrogate pairs. See jsonpath-compliance-test-suite #87. - Fixed default minimum integer boundary for JSONPath indexes and slice steps. We were off by one.
- Fixed parsing of JSONPath integer literals with an exponent and an upper case 'e'. We now allow 'e' to be upper case.
- Fixed handling of trailing commas in JSONPath bracketed segments. We now raise a syntax error.
- Fixed handling of invalid JSONPath integer and float literals with extra minus signs, leading zeros or too many zeros. We now raise a syntax error in such cases.
Version 1.3.3
Fixes
- Fixed handling of JSONPath filter expression literals. We now throw a
JSONPathSyntaxErrorif a filter expression contains a literal (string, int, float, boolean, null) that is not part of a comparison or function expression. See jsonpath-compliance-test-suite #81.
Version 1.3.2
Fixes
- Fixed more I-Regexp to RegExp pattern mapping. See jsonpath-compliance-test-suite#77.
- We now check that regular expression patterns passed to
matchandsearchare valid according to RFC 9485. The standard behavior is to silently returnfalsefrom these filter function if the pattern is invalid. ThethrowErrorsoption can be passed toMatchand/orSearchto throw an error instead, and theiRegexpCheckoption can be set tofalseto disable I-Regexp checks.