59. implement MapStringUnionToObjectUnion<U>
シェアしよう
- 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
// }