Deeply picks a nested property from an object type along the specified key path.
Supports union of paths to pick multiple nested properties.
When one path is a prefix of another (e.g., ['a'] | ['a', 'b']), the shorter path
takes precedence and the entire subtree is included.
Type Parameters
T
The object type to pick from.
PathextendsreadonlyPropertyKey[]
A tuple representing the key path, or a union of such tuples.
Returns
A new object type containing only the properties along the specified path(s).
Deeply picks a nested property from an object type along the specified key path. Supports union of paths to pick multiple nested properties. When one path is a prefix of another (e.g.,
['a'] | ['a', 'b']), the shorter path takes precedence and the entire subtree is included.