Releases: jg-rp/json-p3
Releases · jg-rp/json-p3
Version 0.2.0
Breaking Changes
- Rename
JSONPathEnvironment.filterRegistertoJSONPathEnvironment.functionRegister. - Removed
JSONPathEnvironment.optionsin favour of equivalent environment properties. For example,JSONPathEnvironment.options.maxIntIndexis nowJSONPathEnvironment.maxIntIndex.
Fixes
- Fixed well-typedness checks on function calls. Previously we were throwing a
JSONPathTypErrorfor some valid queries. - Fixed parsing of function calls with comparison expressions as arguments.
- Fixed a bug with unbalanced parentheses detection in JSONPath expressions when parsing nested function calls. In some cases we were not throwing a
JSONPathSyntaxErrorwhen a function was not closed, but an inner function was.
Features
- Implemented Relative JSON Pointers. Use the
to(rel)method ofJSONPointer, whererelis a relative JSON pointer string and a newJSONPointeris returned. - Guard against recursive data structures by implementing the
JSONPathEnvironment.maxRecursionDepthoption. When using the recursive descent selector (..), if the maximum recursion depth is reached, aJSONPathRecursionLimitErroris thrown. - Added
JSONPathEnvironment.match()andJSONPath.match(), which returns aJSONPathNodefor the first value matching a query, orundefinedif there are no matches.
Version 0.1.1
Fixes
- Fix number literals with an implicit exponent sign. Previously we would see a
JSONPathSyntaxErrorfor1e2, but not for1e+2or1e-2. Now1e2is equivalent to1e+2.