Type Alias AutocompletablePaths<T, Prefix>

AutocompletablePaths: T extends Primitive
| readonly unknown[]
    ? never
    : {
        [K in keyof T & string]:
            | `${Prefix}${K}`
            | (
                T[K] extends Primitive
                | readonly unknown[]
                    ? never
                    : AutocompletablePaths<T[K], `${Prefix}${K}.`>
            )
    }[keyof T & string]

Given an object type T, produces a union of string literal types representing all possible paths to primitive values within that object. Sadly, right now, the ts-essential paths property breaks when it comes to deeper nested objects

Type Parameters

  • T
  • Prefix extends string = ""