-
Notifications
You must be signed in to change notification settings - Fork 23
Description
Hi,
Sorry I left an issue before without a response due to dealing with other projects, but after playing around with this library more I can verify the problem.
I am trying to move one piece of JSON to another location in the same doc. While this has been working for the most part one particular operation seems to fail.
See the following:
[ { op: 'move',
from: '/14',
path: '/250/nested_classes/0/nested_classes/' } ]
I am performing this on a variable called doc.
If I do the following:
console.log(doc[250]['nested_classes'][0]['nested_classes']);
I get square brackets because that is an array, which is fine that's what I want and I just want to insert the moved data into that array so that it becomes the first item.
The data from this:
console.log(doc[14]);
I get:
{ class_name: 'CreditCard',
sub_class: 'PaymentMethod',
properties: {},
nested_classes: [] }
I have used this same logic for an existing node in my doc and it works completely fine, but I have no idea why it does not work in this scenario when I can see both paths exist.
Is this some kind of hard to find bug in the library, or some issue with how my paths have been typed?
Really appreciate any help with this, thanks.