Open tregua87 opened 4 months ago
cjson_0
is a dictionary, I would expect the functioncJSON_DeleteItemFromArray
checks the fieldcJSON->type
. Or it is an intended behavior?
It's not clear whether it is intended behavior,. It seems like a flaw to me, but it's now ingrained behavior so probably risk to change it without risking breaking some existing user code.
Interesting that get_array_item()
will return a child object from a parent given an index, but never cares whether it's an array. It just returns the n-th child in the list of children. But get_array_item
is only ever called by array-related functions. Same for add_item_to_array
. I didn't check all of them, but the array-specific functions I looked at all would also operate on any object with children.
I noticed the function
cJSON_DeleteItemFromArray
does not distinguish between arrays and dicts. Check this example:Produces this output.
cjson_0
is a dictionary, I would expect the functioncJSON_DeleteItemFromArray
checks the fieldcJSON->type
. Or it is an intended behavior?