-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can find element with #32
Comments
Update, Maybe it is worth treating the internal functionality to trigger a copy operation followed by a remove operation inside the replace function of the jsonpatch library rather than the current code:
|
It would be helpful to have test case I can just run. If you could include that I'll try it out and try to figure out the issue |
Thanks I appreciate it. The repo I am using is https://github.com/Truemedia/slush-blueprints. I need to finish a few commits before you will be able to run the command where this error resides but I will update this issue when I have (should be next day or so). The command I run when this library is installed is: If you look for anything from this section of code:
This is where the error is triggered from if you uncomment the replace line, and comment out the copy and remove operations. |
Ok I have now updated the repo I mentioned. You will need to clone the master branch and use npm link for the local copy. If you have any issues let me know. |
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:
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:
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.
The text was updated successfully, but these errors were encountered: