MCPcopy
hub / github.com/Effect-TS/effect / fromNullable

Function fromNullable

packages/effect/src/Option.ts:684–686  ·  view source on GitHub ↗
(
  nullableValue: A
)

Source from the content-addressed store, hash-verified

682 * @since 2.0.0
683 */
684export const fromNullable = <A>(
685 nullableValue: A
686): Option<NonNullable<A>> => (nullableValue == null ? none() : some(nullableValue as NonNullable<A>))
687
688/**
689 * Lifts a function that returns `null` or `undefined` into the `Option`

Callers 2

liftNullableFunction · 0.70
Option.tsFile · 0.70

Calls 2

noneFunction · 0.85
someFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…