as an example
const { foo, bar, bruno } = lala(['foo', 'bar']);
function lala(keys: string[]) {
return keys.reduce((withIds, key) => ({
...withIds,
[key]: 'some-new-value'
}), {} as Record<string, string>);
}
console.log(foo, bar, bruno); // some-new-value some-new-value undefined
I'm trying to make typescript (under VSCode) to wiggle the bruno variable, as it's not in the array
Is there a special trick / function for such action?