Skip to content

@epikodelabs/actionstack


@epikodelabs/actionstack / getProperty

Function: getProperty()

Call Signature

getProperty<TObj>(obj, path): TObj

Defined in: utils.ts:11

Retrieves a property from an object based on a path.

Type Parameters

TObj

TObj

Parameters

obj

TObj

The object to retrieve the property from.

path

"*"

The path to the property (e.g., "key" or ["user", "name"]).

Returns

TObj

The value of the property or undefined if the path is invalid.

Call Signature

getProperty<TObj, K>(obj, path): NonNullable<TObj>[K] | undefined

Defined in: utils.ts:12

Retrieves a property from an object based on a path.

Type Parameters

TObj

TObj

K

K extends string | number | symbol

Parameters

obj

TObj

The object to retrieve the property from.

path

K

The path to the property (e.g., "key" or ["user", "name"]).

Returns

NonNullable<TObj>[K] | undefined

The value of the property or undefined if the path is invalid.

Call Signature

getProperty<TObj>(obj, path): unknown

Defined in: utils.ts:16

Retrieves a property from an object based on a path.

Type Parameters

TObj

TObj

Parameters

obj

TObj

The object to retrieve the property from.

path

The path to the property (e.g., "key" or ["user", "name"]).

"*" | PropertyPath

Returns

unknown

The value of the property or undefined if the path is invalid.

Released under the MIT License.