Skip to content

get

get<T>(params): unknown

Defined in: objects/get/index.ts:23

Reads a nested value from an object using dot-notation path.

T

GetParams<T>

The parameters object

unknown

The value at path, or defaultValue if the path is unreachable

get({ obj: { address: { city: "São Paulo" } }, path: "address.city" });
// => "São Paulo"
get({ obj: { a: 1 }, path: "a.b", defaultValue: "BR" });
// => "BR"

read nested, dot notation, deep access, safe access, property path, lodash get