Skip to main content

createObjectLens()

createObjectLens<T>(input, path): object

A lens to get and set values in an object, that fails silently if the path does not exist.

Type Parameters

Type ParameterDefault type

T

unknown

Parameters

ParameterType

input

Record<string, unknown>

path

(string | number)[]

Returns

object

NameType

get()

() => null | T

set()

(value) => boolean