You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First off, thanks for this library! I'm interested using this library to determine whether two nested objects are structurally equal. In other words, I'd like to compare hashes computed with the excludeValues: true option, but that takes into account whether nested objects have the same keys.
e.g.
var baz = {
foo: {
innerkey1: 'baz'
}
}
var fizz = {
foo: {
innerkey2: 'fizz'
}
}
The current behaviour has hash(baz, {excludeValues: true}) === hash(fizz, {excludeValues: true}), but for my use case i need them to be not equal, since they have different nested keys.
If this is a use case this library would like to support I'd be interested in working on a PR for it.
Thanks
The text was updated successfully, but these errors were encountered:
No, that's not quite what I'm getting at. Another way to say it is that hash(obj1) === hash(obj2) if and only if all of the keys in obj1 appear in obj2, both top-level keys and any keys in nested objects.
Oh – so, exclude each value in an object only if that value itself is not an object? Yeah, that seems to make sense, and you can definitely work on a PR if you’d like (or wait for me to do that).
Hello,
First off, thanks for this library! I'm interested using this library to determine whether two nested objects are structurally equal. In other words, I'd like to compare hashes computed with the
excludeValues: true
option, but that takes into account whether nested objects have the same keys.e.g.
The current behaviour has
hash(baz, {excludeValues: true}) === hash(fizz, {excludeValues: true})
, but for my use case i need them to be not equal, since they have different nested keys.If this is a use case this library would like to support I'd be interested in working on a PR for it.
Thanks
The text was updated successfully, but these errors were encountered: