function is ( x , y ) { if ( x === y ) { return x !== 0 || y !== 0 || 1 / x === 1 / y ; } else { return x !== x && y !== y ; } } function shallowEqual ( objA , objB ) { if ( is ( objA , objB ) ) { return true ; } if ( typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null ) { return false ; } const keysA = Object . keys ( objA ) ; const keysB = Object . keys ( objB ) ; if ( keysA . length !== keysB . length ) { return false ; } for ( const element of keysA ) { if ( ! Object . prototype . hasOwnProperty . call ( objB , element ) || ! is ( objA [ element ] , objB [ element ] ) ) { return false ; } } return true ; } export { shallowEqual } ;