}
jv jv_delpaths(jv object, jv paths) {
+ if (jv_get_kind(paths) != JV_KIND_ARRAY) {
+ jv_free(object);
+ jv_free(paths);
+ return jv_invalid_with_msg(jv_string("Paths must be specified as an array"));
+ }
paths = jv_sort(paths, jv_copy(paths));
jv_array_foreach(paths, i, elem) {
if (jv_get_kind(elem) != JV_KIND_ARRAY) {
[1,2,3]
[1,2,3]
+try delpaths(0) catch .
+{}
+"Paths must be specified as an array"
+
del(.), del(empty), del((.foo,.bar,.baz) | .[2,3,0]), del(.foo[0], .bar[0], .foo, .baz.bar[0].x)
{"foo": [0,1,2,3,4], "bar": [0,1]}
null