flitbit / diff

Javascript utility for calculating deep difference, capturing changes, and applying changes across objects; for nodejs and the browser.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ignore order of keys?

scramble45 opened this issue · comments

Is there a way to ignore the order of keys? I don't care about the order in which keys reside in the array of objects only that those keys exists and their values exists across both array of objects.

Something like this exists in the python version.
https://github.com/seperman/deepdiff#ignore-order

var t1 = {1:1, 2:2, 3:3, 4:{"a":"hello", "b":[1, 2, 3]}}
var t2 = {1:1, 2:2, 3:3, 4:{"a":"hello", "b":[1, 3, 2, 3]}}
var diff = DeepDiff(t1, t2, ignore_order:true)
console.log(diff)

I've the same problem, any news about this ? Thank you

@jsfuchs contributed some code that I finally got merged and tested. I'm pretty sure it was broken for a while after first merging... in any case, look at the tests here for an example.