i'm building static dictionaries where keys are enums, and values are functions. Then i use Object.entries to iterate on the dictionary ; when doing so, the dictionary changes from { key1: (arg: T1) => void, key2: (arg: T2) => void } to [key1 | key2, (arg: T1) => void | (arg: T2) => void][] and the constraint of key1 -> T1 + key2 -> T2 is merged in a union type, which creates type annoyance.
How to change the algorithm not to have this issue anymore?
The Playground lets you write TypeScript or JavaScript online in a safe and sharable way.