obj desc method let _this = null ; const object = ( _this = { shallowCompare : function ( firstObj , secondObj ) : boolean { for ( let key in firstObj ) { if ( ! firstObj . hasOwnProperty ( key ) || ! secondObj . hasOwnProperty ( key ) || firstObj [ key ] !== secondObj [ key ] ) { return false ; } } return true ; } , deepCompare : function ( firstObj , secondObj ) : boolean { const firstEntries = Object . entries ( firstObj ) ; const secondEntries = Object . entries ( secondObj ) ; if ( firstEntries . length !== secondEntries . length ) { return false ; } for ( let [ key ] of firstEntries ) { const firstValue = firstObj [ key ] ; const secondValue = secondObj [ key ] ; if ( typeof firstValue !== typeof secondValue ) { return false ; } else if ( typeof firstValue === 'object' && firstValue !== null ) { if ( ! _this . deepCompare ( firstValue , secondValue ) ) { return false ; } } else { if ( firstValue !== secondValue ) { return false ; } } } return true ; } , has : function ( object , key ) : boolean { return object [ key ] !== undefined ; } } ) ; export default object ; export const shallowCompare = object . shallowCompare ; export const deepCompare = object . deepCompare ; export const has = object . has ;