1export function choose<U, T extends Record<string, U>>( 2 value: keyof T, 3 choices: T, 4): U { 5 return choices[value] 6}