The type of the input value (excluding null/undefined)
The type of the value returned by the mapping function
The result of applying mapFn
to value
if value is not
null/undefined; otherwise undefined
Applies a function to a value if the value is not null
or undefined
. If
the value is null
or undefined
, it returns undefined
.
This function provides a safe way to transform nullable values without explicit null checks. It's similar to Optional.map() but works directly with TypeScript's nullable types. Supports both regular and curried usage for functional composition.
The type of the input value (excluding null/undefined)
The type of the value returned by the mapping function
The result of applying mapFn
to value
if value is not
null/undefined; otherwise undefined
Applies a function to a value if the value is not
null
orundefined
. If the value isnull
orundefined
, it returnsundefined
.This function provides a safe way to transform nullable values without explicit null checks. It's similar to Optional.map() but works directly with TypeScript's nullable types. Supports both regular and curried usage for functional composition.