example throws import type { Theme } from '../types' ; export const valueFromObject = < T = Theme . ThemeInterface > ( key , obj ) : any => key . split ( '.' ) . reduce ( ( reduced , index ) => reduced [ index ] , obj ) ;