import deepEquals from "react-fast-compare" ; type Dict = { [ key ] : any ; } ; export namespace Equals { export function shallow ( a , b ) { if ( a === b ) { return true ; } const aKeys = Object . keys ( a ) ; const bKeys = Object . keys ( b ) ; if ( aKeys . length !== bKeys . length ) { return false ; } for ( let idx = 0 ; idx < aKeys . length ; ++ idx ) { if ( aKeys [ idx ] !== bKeys [ idx ] ) { return false ; } } for ( const key of aKeys ) { if ( a [ key ] !== b [ key ] ) { return false ; } } return true ; } export function deep ( a , b ) { return deepEquals ( a , b ) ; } }