Closed drinks closed 9 years ago
Hi there! I've been getting some unexpected results when types change between different flavors of object:
object
var dd = require('deep-diff'); dd([], {}) // => undefined dd({}, /surely these are different!/gi) // => undefined dd(['a','b','c'], {a:1, b:1, c:1}) // => [ { kind: 'D', // => path: [ 0 ], // => lhs: 'a' }, // => { kind: 'D', // => path: [ 1 ], // => lhs: 'b' }, // => { kind: 'D', // => path: [ 2 ], // => lhs: 'c' } ] dd({a:1}, [1]) // => [ { kind: 'D', // => path: [ 'a' ], // => lhs: 1 }, // => { kind: 'N', // => path: [ '0' ], // => rhs: 1 } ]
Here's a patch that inspects objects a little more closely and reports type changes such as {} -> [] as kind E.
{} -> []
E
Very nice. Thank you for taking the time to supplement the tests.
Absolutely, thanks for the merge!
Sure thing; It will be a few days before I update the release packages.
Hi there! I've been getting some unexpected results when types change between different flavors of
object
:Here's a patch that inspects
object
s a little more closely and reports type changes such as{} -> []
as kindE
.