param value export function deepClone ( value ) { return JSON . parse ( JSON . stringify ( value ) ) ; } param value export function isObjectLike ( value ) { return value !== null && typeof value === "object" ; } param object param path export function has < T > ( object , path ) { const newPath = Array . isArray ( path ) ? path : path . split ( "." ) ; let current = object ; for ( const key of newPath ) { if ( ! isObjectLike ( current ) ) { return false ; } if ( ! ( key in current ) ) { return false ; } current = ( current as any ) [ key ] ; } return true ; } param object param path param defaultValue export function get < T > ( object , path , defaultValue ? ) { const newPath = Array . isArray ( path ) ? path : path . split ( "." ) ; let current = object ; for ( const key of newPath ) { if ( ! isObjectLike ( current ) ) { return defaultValue ; } if ( ! ( key in current ) ) { return defaultValue ; } current = ( current as any ) [ key ] ; } return current === undefined ? defaultValue : current ; } param object param path param value export function set ( object , path , value ) { let current = object ; const newPath = Array . isArray ( path ) ? path : path . split ( "." ) ; for ( let i = 0 ; i < newPath . length ; ++ i ) { if ( i === newPath . length - 1 ) { current [ newPath [ i ] ] = value ; } else { current = current [ newPath [ i ] ] ; } } } param value returns export function isNil ( value ) { return value === null || value === undefined ; }