feat: implement deleting object keys/array elements at a path
This implements a 'delete' operation, removing the object key or array element referred to by a JSON Pointer path. While changing keys/elements is possible using get_mut
, it is not possible to remove elemennts through get_mut. My solution moves the path traversing to get_mut_toks
which takes an iterator. The existing get_mut
simply calls into that with an iterator over the full path (and shouldn't be any slower than it was before). The new delete
will call into get_mut_toks
with an iterator over the path without the last element, obtaining the parent to remove the element/key from. Then it will perform the deletion, returning the deleted item in the process.