I want to run type transform like this:
type Source = [['foo', string], ['bar', number], ['baz', boolean]]
type Result = {
foo: string,
bar: number,
baz: boolean
}
I've came up with a working solution, but I feel like it's a bit overcomplicated, and there should be a better way to do this. Am I right, or my solution is good enough?
Besides, my solution gives Record<'foo', string> & Record<'bar', number> & Record<'baz', boolean> instead of Result type, maybe that is another room for improvement