-
Notifications
You must be signed in to change notification settings - Fork 217
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
Wrong patch when substituting an object for an array? #31
Comments
The same thing happens in reverse, too. var x = jsonpatch.compare(['jack'], {});
// no good
x === [{
op: "remove"
path: "/0"
}]; and for an even bigger hint at what the issue is: var x = jsonpatch.compare([], {});
x === []; Deep down this library thinks that arrays and objects are the same thing! This likely stems from the fact that it only worries about the keys, which fails to differentiate arrays and objects in these edge cases. |
@Starcounter-Jack @warpech are either of you around? I'll make up a PR sooner rather than later if you'll have time to review it. |
Will be fixed in #205 |
Shouldn't be the empty object replaced with the array? the value is no longer an object.
The text was updated successfully, but these errors were encountered: