Open v-mwalk opened 3 months ago
A filter erroneously using a single equals in a comparison filter modifies the filtering property in the target object.
const originalJSON = { testing: [ { test: "hello1", prop1: "bye1", prop2: "day1" }, { test: "hello2", prop1: "bye2", prop2: "day2" }, { test: "hello3", prop1: "bye3", prop2: "day3" }, ], }; const filteredJSON = JSONPath({path: '$.testing[?(@.test="hello2"].prop1',json: originalJSON, resultType" 'all'}); // Note single equals in filter // // originalJSON now contains; // testing: [ // { test: "hello2", prop1: "bye1", prop2: "day1" }, // { test: "hello2", prop1: "bye2", prop2: "day2" }, // { test: "hello2", prop1: "bye3", prop2: "day3" }, // ], // }; // //
As the filter is errored, would expect an exception to be thrown, for handling by the caller.
Can also be repo'd at jsonpath.com evaluator
Describe the bug
A filter erroneously using a single equals in a comparison filter modifies the filtering property in the target object.
Code sample or steps to reproduce
Expected behavior
As the filter is errored, would expect an exception to be thrown, for handling by the caller.
Environment (IMPORTANT)
Desktop**
Additional context
Can also be repo'd at jsonpath.com evaluator