Lift a nullable value into an Option: null/undefined becomes none, anything else becomes some.
null
undefined
const email = fromNullable(user.email) // Option<string> const first = fromNullable(items.find((i) => i.active)) Copy
const email = fromNullable(user.email) // Option<string> const first = fromNullable(items.find((i) => i.active))
Lift a nullable value into an Option:
null/undefinedbecomes none, anything else becomes some.