import { Get, IsAny, Paths, Simplify } from 'type-fest'; export type StringKeyof = IsAny extends true ? string : Exclude, symbol | number>; export type PathToObject = Simplify<{ [K in T[number] as K extends `${infer X}.${string}` ? X : K]: K extends `${infer X}.${infer Y}` ? PathToObject<[Y], Get> : Get; }>;