/**
 * Retrieve the value for the specified path
 *
 * Note that dot is _not_ allowed to specify a deeper key, it will assume that
 * the dot is part of the key itself.
 */ export function get < CFG extends { [ k ] : any ; } , A extends keyof CFG , B extends keyof CFG [ A ] , C extends keyof CFG [ A ] [ B ] , D extends keyof CFG [ A ] [ B ] [ C ] , E extends keyof CFG [ A ] [ B ] [ C ] [ D ] > ( obj , path ) ; export function get < CFG extends { [ k ] : any ; } , A extends keyof CFG , B extends keyof CFG [ A ] , C extends keyof CFG [ A ] [ B ] , D extends keyof CFG [ A ] [ B ] [ C ] > ( obj , path ) ; export function get < CFG extends { [ k ] : any ; } , A extends keyof CFG , B extends keyof CFG [ A ] , C extends keyof CFG [ A ] [ B ] > ( obj , path ) ; export function get < CFG extends { [ k ] : any ; } , A extends keyof CFG , B extends keyof CFG [ A ] > ( obj , path ) ; export function get < CFG extends { [ k ] : any ; } , A extends keyof CFG > ( obj , path ) ; export function get < CFG extends { [ k ] : any ; } > ( obj , path ) { if ( typeof path === 'string' ) { if ( path . includes ( '.' ) ) { throw new Error ( 'Using dots in `get` with a string is not allowed, use array instead' ) ; } return obj [ path ] ; } for ( const key of path ) { obj = obj [ key ] ; } return obj ; }