Skip to content

getNestedValue

getNestedValue<T>(obj, path): any

Defined in: datagrid/core/column-creation/utils.ts:30

Retrieves a nested value from an object using dot notation path.

Type Parameters

T

Parameters

obj

T

The object to retrieve the value from.

path

string

The dot notation path specifying the nested value.

Returns

any

The value found at the given path in the object.

Example

getNestedValue({ user: { profile: { name: 'John' } } }, 'user.profile.name'); // 'John'