Package: effect
Module: Option
Extracts the value from a Some, or returns undefined for None.
When to use
Use when you need to pass absent Option values to APIs that expect
undefined.
Details
Some → the inner valueNone → undefinedExample (Unwrapping to undefined)
import { Option } from "effect"
console.log(Option.getOrUndefined(Option.some(1)))
// Output: 1
console.log(Option.getOrUndefined(Option.none()))
// Output: undefined
See
getOrNull to return null insteadgetOrElse for a custom fallbackSignature
declare const getOrUndefined: <A>(self: Option<A>) => A | undefined
Since v2.0.0