Package: effect
Module: UndefinedOr
Returns the defined value, or throws the value produced by onUndefined
when the input is undefined.
When to use
Use when you need fail-fast unwrapping of an A | undefined value and want
to provide the thrown error for the undefined case.
Details
Defined values are returned unchanged. When the input is undefined,
onUndefined is called and its result is thrown.
See
getOrThrow for the default-error siblingmatch for handling defined and undefined cases without throwingSignature
declare const getOrThrowWith: { (onUndefined: () => unknown): <A>(self: A | undefined) => A; <A>(self: A | undefined, onUndefined: () => unknown): A; }
Since v4.0.0