export function shallowEqual < T extends { [ key ] : unknown ; } > ( objA , objB , compareObjects ? , compareValues ? , compareContext ? ) { var ret = compareObjects ? compareObjects . call ( compareContext , objA , objB ) : undefined ; if ( ret !== undefined ) { return ! ! ret ; } if ( objA === objB ) { return true ; } if ( ! objA || typeof objA !== "object" ) { return false ; } if ( ! objB || typeof objB !== "object" ) { return false ; } var keysA = Object . keys ( objA ) ; var keysB = Object . keys ( objB ) ; if ( keysA . length !== keysB . length ) { return false ; } var bHasOwnProperty = Object . prototype . hasOwnProperty . bind ( objB ) ; for ( var idx = 0 ; idx < keysA . length ; idx ++ ) { var key = keysA [ idx ] ; if ( ! bHasOwnProperty ( key ) ) { return false ; } var valueA = objA [ key ] ; var valueB = objB [ key ] ; ret = compareValues ? compareValues . call ( compareContext , valueA , valueB , key ) : undefined ; if ( ret === false || ( ret === undefined && valueA !== valueB ) ) { return false ; } } return true ; } ;