Nest an object structure based on a list of keys.
A tuple of string keys representing the nesting levels
The type to assign at the deepest level
Will recursively create nested objects for each key in the list, assigning the final type T at the deepest level.
T
Note that if no keys are provided, this turns into < K, T > => T
< K, T > => T
type RestaurantMenu = ChainMapped< [ 'night' | 'day', 'entry' | 'main' | 'dessert' ], () => void >// {// night: { entry: () => void; main: () => void; dessert: () => void };// day: { entry: () => void; main: () => void; dessert: () => void };// } Copy
type RestaurantMenu = ChainMapped< [ 'night' | 'day', 'entry' | 'main' | 'dessert' ], () => void >// {// night: { entry: () => void; main: () => void; dessert: () => void };// day: { entry: () => void; main: () => void; dessert: () => void };// }
Nest an object structure based on a list of keys.