export const pathExists = ( object , ... args ) : boolean => { return getAtPath ( object , ... args ) . exists ; } ; export const getAtPath = ( obj , ... args ) : any => { for ( let i = 0 ; i < args . length ; i ++ ) { if ( ! obj || ! ( args [ i ] in obj ) ) { return { exists : false , value : void 0 } ; } obj = obj [ args [ i ] ] ; } return { exists : true , value : obj , } ; } ;