export function getEnumAsObject < T > ( enumArray , getKey ) { return enumArray . reduce < Record < string , T > > ( ( accumulator , x ) => { accumulator [ getKey ( x ) ] = x ; return accumulator ; } , { } ) ; }