Skip to content

Commit 4699284

Browse files
committed
[function] improve equalityDeep
1 parent f1d7109 commit 4699284

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

function.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,12 @@ export const equalityFlat = (a, b) => a === b || (a != null && b != null && a.co
6868
* @return {boolean}
6969
*/
7070
export const equalityDeep = (a, b) => {
71-
if (a == null || b == null) {
72-
return equalityStrict(a, b)
73-
}
74-
if (a.constructor !== b.constructor) {
75-
return false
76-
}
7771
if (a === b) {
7872
return true
7973
}
74+
if (a == null || b == null || a.constructor !== b.constructor) {
75+
return false
76+
}
8077
switch (a.constructor) {
8178
case ArrayBuffer:
8279
a = new Uint8Array(a)

0 commit comments

Comments
 (0)