import { isNullish } from './nullish' ; /**
 * hidden
 */ export function equalObjects ( obj1 , obj2 ) { const keys1 = Object . keys ( obj1 ) ; return ( Object . keys ( obj1 ) . length === Object . keys ( obj2 ) . length && keys1 . every ( key => equal ( obj1 [ key ] , obj2 [ key ] ) ) ) ; } /**
 * hidden
 */ export function equal < T > ( item1 , item2 ) { if ( Array . isArray ( item1 ) && Array . isArray ( item2 ) ) { return equalArrays ( item1 as any [ ] , item2 as any [ ] ) ; } if ( typeof item1 === 'object' && typeof item2 === 'object' && ! isNullish ( item1 ) && ! isNullish ( item2 ) ) { return equalObjects ( item1 , item2 ) ; } return item1 === item2 ; } /**
 * hidden
 */ export function equalArrays < T > ( arr1 , arr2 ) { return ( arr1 . length === arr2 . length && arr1 . every ( ( item1 , i ) => equal ( item1 , arr2 [ i ] ) ) ) ; }