TS-Scribe - v0.6.2
    Preparing search index...

    Type Alias DeepGet<T, P>

    DeepGet: P extends []
        ? T
        : P extends [
            infer K extends string | number,
            ...(infer Rest extends ReadonlyArray<string | number>),
        ]
            ? DeepGet<Step<T, K>, Rest>
            : never

    Resolves the type at the end of a path tuple P walked into T.

    Useful when you want to derive the return type of a getIn call without calling the function itself.

    Type Parameters

    • T

      Root object type.

    • P extends ReadonlyArray<string | number>

      Tuple of string / number keys describing the path.

    type Result = DeepGet<typeof data, ['user', 'profile', 'name']>;
    // string