benjamine / jsondiffpatch

Diff & patch JavaScript objects
MIT License
4.78k stars 466 forks source link

Clarification on objectHash #302

Open skelter opened 3 years ago

skelter commented 3 years ago

As I understand it, objectHash is to calculate something not for full equality, but for something identity-ish, such that the children can participate in a meaningful diff?

DaTebe commented 3 years ago

I used this option to calculate full equality by ordering object keys lexicographical and calculating a hash over the stringified Object.

I'm not the author, but I guess the use case of checking "identity-ish" is more common?