mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-03 16:47:49 +00:00
Fix _.isEquals() for wrapped objects
This caught me out when writing some unit tests that use _.isEquals(). They were all passing even though I knew they shouldn't be, and I realised I was checking equality with a wrapped object that I'd forgotten to unwrap.
This commit is contained in:
@@ -519,6 +519,9 @@
|
||||
|
||||
// Perform a deep comparison to check if two objects are equal.
|
||||
_.isEqual = function(a, b) {
|
||||
// Unwrap any wrapped objects
|
||||
if (a && a._chain) a = a.value();
|
||||
if (b && b._chain) b = b.value();
|
||||
// Check object identity.
|
||||
if (a === b) return true;
|
||||
// Different types?
|
||||
|
||||
Reference in New Issue
Block a user