devtypes - v2.0.0
    Preparing search index...

    Type Alias Paths<T, D>

    Paths: [D] extends [never]
        ? never
        : T extends object
            ? {
                [K in keyof T]-?: K extends string
                | number
                    ? T[K] extends readonly any[]
                        ? K
                        : T[K] extends object
                            ? K
                            | Join<K, Paths<(...)[(...)], (...)[(...)]>>
                            : K
                    : never
            }[keyof T]
            : ""

    Build all nested property paths using dot notation.

    Type Parameters

    • T

      Object type to analyze

    • D extends number = 5

      Maximum recursion depth (defaults to 5)

    Generates a union of valid access paths up to a configurable recursion depth. Path order is not guaranteed.

    Arrays are treated as terminal values and do not have indexed paths.

    type User = { id: number; profile: { name: string; address: { city: string } } };
    type PathList = Paths< User >;
    // 'id' | 'profile' | 'profile.name' | 'profile.address' | 'profile.address.city'