One of my functions organizes objects based on the length of an input array. For example:
fn(['a']) -> Record<string, string>
fn(['a', 'b']) -> Record<Record<string, string>>
I've defined the return type as:
type Ret = {
[k: string]: string | Ret;
}
However, this setup doesn't account for the depth of the object. If the input is a TypeScript tuple, then theoretically it should be possible to determine the depth of the return type. Is there currently a way to achieve this?