Skip to content

Type Alias: ValueAtPath<T, P>

ValueAtPath<T, P> = P extends [infer K, ...(infer Rest)] ? K extends keyof T ? Rest extends [] ? T[K] : ValueAtPath<T[K], Rest> : unknown : unknown

Defined in: selectors.ts:15

Recursively resolves the type of a deeply nested property based on a path array.

Type Parameters

T

T

The root object type (e.g., full state).

P

P extends readonly any[]

A string array representing the path to the nested value.

Released under the MIT License.