The value to be wrapped in a Maybe instance.
A Maybe instance representing the provided value.
maybe
const port = maybe(process.env.PORT)
.map(value => Number(value))
.map(value => Number.isNaN(value) ? 3000 : value)
.unwrap();
Generated using TypeDoc
Creates a Maybe instance from a value, allowing safe and functional handling of potentially nullable or undefined values.