type SomePath = `company.employees.${number}.name`
type TuplifyPath<S extends string> =
S extends `${infer Left}.${infer Right}`
? [Left extends `${infer N}` ? N extends number ? N : Left : Left, ...TuplifyPath<Right>]
: [S];
type T = TuplifyPath<SomePath>
const t: T = ['company', 'employees', `${1}`, 'name']
I have been trying to figure out how to just pass 1 instead of ${1} and I am pretty sure infer could be used for that, though I don't really see it working 🥐