-
Notifications
You must be signed in to change notification settings - Fork 218
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
Is there a chance to obtain a diff between obj1 and obj2? #24
Comments
This would be fairly easy to add. I will provide you with a new function. var obj1 = { FirstName:"Albert", LastName:"Hinkey" };
var obj2 = { FirstName:"Albert", LastName:"Einstein" };
var patch = jsonpatch.compare( obj1, obj2 ); // will return [{op:"replace",path:"/LastName",value:"Einstein"}] |
That would be great, thanks! |
Any news? :-) |
Working on it right now! |
I added the new method Could you please test and let us know how it works for you? |
Yes it works! I tested it with information added, updated and deleted at various levels of an [object][Array][Array] variable! |
Great! I merged the changes to the |
Nice work! |
Bumped version number (0.3.7) |
My application need to get a diff between two different objects, obj1 and obj2 !
Is there a syntax to use it like that?
I don't have an "original object" that is modified at run-time, in order to "observe" it!
I load obj1 from a database and build obj2 from a form, and need to have the diff!
Thanks,
Teo
The text was updated successfully, but these errors were encountered: