export const pick = ( obj , ... args ) => ( { ... args . reduce ( ( res , key ) => ( { ... res , [ key ] : obj [ key ] } ) , { } ) } ) ; export function isObject ( item ) { return ( item && typeof item === "object" && ! Array . isArray ( item ) ) ; } export function mergeDeep < T > ( target , source ) { const output = Object . assign ( { } , target ) ; if ( isObject ( target ) && isObject ( source ) ) { Object . keys ( source ) . forEach ( key => { if ( isObject ( source [ key ] ) ) { if ( ! ( key in target ) ) Object . assign ( output , { [ key ] : source [ key ] } ) ; else ( output as any ) [ key ] = mergeDeep ( ( target as any ) [ key ] , source [ key ] ) ; } else { Object . assign ( output , { [ key ] : source [ key ] } ) ; } } ) ; } return output ; } export function getValueInPath ( o , path ) { if ( typeof o === "object" ) { if ( path in o ) { return ( o as any ) [ path ] ; } if ( path . includes ( "." ) ) { const pathSegments = path . split ( "." ) ; return getValueInPath ( ( o as any ) [ pathSegments [ 0 ] ] , pathSegments . slice ( 1 ) . join ( "." ) ) ; } } return undefined ; }