Tags: gxdvip/gjson
Tags
Update the match package This commit updates the match package to v1.0.3, which includes a fix to an issue where a pattern with lots of repetitive stars will increasingly slow down a Match operation. Fixes tidwall#195
Fix bounds out of range panic This commit fixes an issues where gjson panics when the input json or path ends in incomplete quoted string. fixes tidwall#192
Better safe integer range for numbers This commit optimizes the safe float to int conversion function by using the full -9007199254740991 to 9007199254740991 range as suggested at: https://tc39.es/ecma262/#sec-number.min_safe_integer closes tidwall#174
Added new modifiers
`@flatten` Flattens an array with child arrays.
[1,[2],[3,4],[5,[6,7]]] -> [1,2,3,4,5,[6,7]]
The {"deep":true} arg can be provide for deep flattening.
[1,[2],[3,4],[5,[6,7]]] -> [1,2,3,4,5,6,7]
The original json is returned when the json is not an array.
`@join` Joins multiple objects into a single object.
[{"first":"Tom"},{"last":"Smith"}] -> {"first","Tom","last":"Smith"}
The arg can be "true" to specify that duplicate keys should be preserved.
[{"first":"Tom","age":37},{"age":41}] -> {"first","Tom","age":37,"age":41}
Without preserved keys:
[{"first":"Tom","age":37},{"age":41}] -> {"first","Tom","age":41}
The original json is returned when the json is not an object.
`@valid` Ensures that the json is valid before moving on. An
empty string is returned when the json is not valid, otherwise
it returns the original json.