import { isChange , getChangeValue } from '../-private/change' ; method export default function getDeep < T extends Record < string , any > > ( root , path ) { let obj = root ; if ( path . indexOf ( '.' ) === - 1 ) { return obj [ path as string ] ; } const parts = typeof path === 'string' ? path . split ( '.' ) : path ; for ( let i = 0 ; i < parts . length ; i ++ ) { if ( obj === undefined || obj === null ) { return undefined ; } obj = obj [ parts [ i ] ] ; } return obj ; } method export function getSubObject < T extends Record < string , any > > ( root , path ) { let obj = root ; if ( path . indexOf ( '.' ) === - 1 ) { return obj [ path as string ] ; } const parts = typeof path === 'string' ? path . split ( '.' ) : path ; for ( let i = 0 ; i < parts . length ; i ++ ) { if ( obj === undefined || obj === null ) { return undefined ; } if ( isChange ( obj [ parts [ i ] ] ) ) { obj = getChangeValue ( obj [ parts [ i ] ] ) ; } else { obj = obj [ parts [ i ] ] ; } } return obj ; }