export const deepEqual = ( a , b ) : boolean => { if ( a === b ) return true ; if ( a && b && typeof a == 'object' && typeof b == 'object' ) { if ( a . constructor !== b . constructor ) return false ; let i ; let len ; let key ; if ( Array . isArray ( a ) ) { len = a . length ; if ( len != b . length ) return false ; for ( i = len ; i -- > 0 ; ) { if ( ! deepEqual ( a [ i ] , b [ i ] ) ) return false ; } return true ; } const keys = Object . keys ( a ) ; len = keys . length ; if ( len !== Object . keys ( b ) . length ) return false ; for ( i = len ; i -- > 0 ; ) { if ( ! hasOwn . call ( b , keys [ i ] ! ) ) return false ; } for ( i = len ; i -- > 0 ; ) { key = keys [ i ] ! ; if ( ! deepEqual ( a [ key ] , b [ key ] ) ) return false ; } return true ; } return a !== a && b !== b ; } ; const hasOwn = Object . prototype . hasOwnProperty ;