Closed dkaleshkoska closed 2 years ago
thank you for the report, you may find details of the fix in the reference PR above. I have published a new version with the fix to npm as v1.1.2 🙂
note: there was an issue with publishing v1.1.1, so please use v1.1.2
I have used JSONPatchQuery to remove multiple nodes at once.
Input JSON:
Operations:
My expected result is:
However, I don't get this result because there is a bug in the apply function. Most likely the problem is that you are modifying the same document object, that is being checked for the different paths. This is particularly problematic for the remove operation. A potential fix would be to create a clone of the document object, make the modifications there and then return that object.