59. implement MapStringUnionToObjectUnion<U>

TypeScript

  - accepted / - tried

Implement MapStringUnionToObjectUnion<U> to map a string union to an object union as below.

type A = MapStringUnionToObjectUnion<'1'>// {//   value: '1'// } type B = MapStringUnionToObjectUnion<'1' | '2'>// {//   value: '1'// } |// {//   value: '2// }

Let's try to solve this problem within 10 minutes.