prop
prop<
S>(): <K>(key) =>Optional<S,NonNullable<S[K]>>
Defined in: Core/Optional.ts:61
Creates an Optional that focuses on an optional property of an object.
Only keys whose type includes undefined (i.e. field?: T) are accepted.
Call with the structure type first, then the key.
Type Parameters
Section titled “Type Parameters”S
Returns
Section titled “Returns”<
K>(key):Optional<S,NonNullable<S[K]>>
Type Parameters
Section titled “Type Parameters”K extends string | number | symbol
Parameters
Section titled “Parameters”K
Returns
Section titled “Returns”Optional<S, NonNullable<S[K]>>