Function getProperty
-
getProperty<T extends object, const P extends PropertyPath>(
data: T,
path: P,
options?: { hasOwnOnly?: boolean },
): DeepAccess<T, P>Type Parameters
- T extends object
Root object type.
- const P extends PropertyPath
Property path type.
Parameters
Returns DeepAccess<T, P>
The resolved property value, or
undefinedwhen the path cannot be resolved. - T extends object
Returns the value resolved by a property path while preserving present
undefinedandnullvalues.Unlike safeAccess, this function returns a present nullish property unchanged. A missing or invalid path returns
undefined; use hasProperty when that result must be distinguished from a presentundefinedproperty. Array indexes require numeric keys through an exact array property-key path.