-
Notifications
You must be signed in to change notification settings - Fork 215
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
Copy operation doesn't deep clone, only references #177
Comments
Why is that a problem? |
It may be for someone expecting resulting object to be a JSON tree. You cannot use JSON syntax to create reference, you can only create two identical nodes. let obj = {
foo: {
bar: 'baz'
}
};
jsonpatch.applyOperation(obj, {op: 'copy', path: 'copied', from: 'foo'}); at this point your object looks like: obj:
foo: {
bar: 'baz'
},
foo: {
bar: 'baz'
}
}; with current implementation
changes also I think that's a difference between "copy" and "attach" https://tools.ietf.org/html/rfc6902#section-4.5:
"Value" not "reference". |
Closing as fixed in #134 |
No description provided.
The text was updated successfully, but these errors were encountered: