Say I have:
const generate = (array: string[]) => {
const obj: any = {};
array.map(a => a.toUpperCase()].forEach(a => obj[a] = a);
return obj;
}
So that I can do:
const constants = generate(['foo', 'bar']);
constants.FOO;
constants.BAR;
Is there anyway to define the type so that constants.BAZ for example errors out?