- get<T, K, D>(object, key, defaultValue?): IfCouldBe<T, Nil, D> | WithDefault<NonNullable<T>[K], D>
Type Parameters
- T
- K extends string | number | symbol
- D = undefined
Parameters
- object: T
- key: K
Optional
defaultValue: D
Returns IfCouldBe<T, Nil, D> | WithDefault<NonNullable<T>[K], D>
- get<D>(object, path, defaultValue?): D
Parameters
- object: object
- path: []
Optional
defaultValue: D
Returns D
- get<T, K1, D>(object, path, defaultValue?): IfCouldBe<T, Nil, D> | WithDefault<NonNullable<T>[K1], D>
Type Parameters
- T
- K1 extends string | number | symbol
- D = undefined
Parameters
- object: T
- path: readonly [K1]
Optional
defaultValue: D
Returns IfCouldBe<T, Nil, D> | WithDefault<NonNullable<T>[K1], D>
- get<T, K1, K2, D>(object, path, defaultValue?): IfCouldBe<T, Nil, D> | WithDefault<NonNullable<T>[K1][K2], D>
Type Parameters
- T
- K1 extends string | number | symbol
- K2 extends string | number | symbol
- D = undefined
Parameters
- object: T
- path: readonly [K1, K2]
Optional
defaultValue: D
Returns IfCouldBe<T, Nil, D> | WithDefault<NonNullable<T>[K1][K2], D>
- get<T, K1, K2, K3, D>(object, path, defaultValue?): IfCouldBe<T, Nil, D> | WithDefault<NonNullable<T>[K1][K2][K3], D>
Type Parameters
- T
- K1 extends string | number | symbol
- K2 extends string | number | symbol
- K3 extends string | number | symbol
- D = undefined
Parameters
- object: T
- path: readonly [K1, K2, K3]
Optional
defaultValue: D
Returns IfCouldBe<T, Nil, D> | WithDefault<NonNullable<T>[K1][K2][K3], D>
- get<T, K1, K2, K3, K4, D>(object, path, defaultValue?): IfCouldBe<T, Nil, D> | WithDefault<NonNullable<T>[K1][K2][K3][K4], D>
Type Parameters
- T
- K1 extends string | number | symbol
- K2 extends string | number | symbol
- K3 extends string | number | symbol
- K4 extends string | number | symbol
- D = undefined
Parameters
- object: T
- path: readonly [K1, K2, K3, K4]
Optional
defaultValue: D
Returns IfCouldBe<T, Nil, D> | WithDefault<NonNullable<T>[K1][K2][K3][K4], D>
- get(object, path, defaultValue?): any
Parameters
- object: object | Nil
- path: readonly PropertyKey[]
Optional
defaultValue: any
Returns any
Gets the value at
path
ofobject
. If the resolved value isundefined
, thedefaultValue
is returned in its place.Differences from lodash:
path
Contribution to minified bundle size, when it is the only function imported: