Function getPropertyDescriptor
-
getPropertyDescriptor(
data: object,
path: PropertyPath,
options?: { hasOwnOnly?: boolean },
): PropertyDescriptorParameters
- data: object
Object to inspect.
- path: PropertyPath
Dotted or exact property-key path.
Optionaloptions: { hasOwnOnly?: boolean }Property lookup options.
-
OptionalhasOwnOnly?: booleanWhether every path segment must be an own property; default:
false.
-
Returns PropertyDescriptor
The terminal property descriptor, or
undefinedwhen the path cannot be resolved. - data: object
Returns the own property descriptor that defines the final segment of a property path.
Intermediate values are read as necessary to continue traversal, but the final property value is not read. Getter accessors at the terminal segment are therefore not invoked. When inherited lookup is enabled, the descriptor is returned from the prototype object that owns the final property.