MCPcopy Create free account
hub / github.com/Effect-TS/effect / fromNullishOr

Function fromNullishOr

packages/effect/src/Option.ts:773–775  ·  view source on GitHub ↗
(
  a: A
)

Source from the content-addressed store, hash-verified

771 * @since 4.0.0
772 */
773export const fromNullishOr = <A>(
774 a: A
775): Option<NonNullable<A>> => (a == null ? none() : some(a as NonNullable<A>))
776
777/**
778 * Converts a possibly `undefined` value into an `Option`, leaving `null`

Callers 2

liftNullishOrFunction · 0.70
Option.tsFile · 0.70

Calls 2

noneFunction · 0.70
someFunction · 0.70

Tested by

no test coverage detected