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

Function fromNullOr

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

Source from the content-addressed store, hash-verified

866 * @since 4.0.0
867 */
868export const fromNullOr = <A>(
869 a: A
870): Option<Exclude<A, null>> => (a === null ? none() : some(a as Exclude<A, null>))
871
872/**
873 * Lifts a function that may return `null` or `undefined` into one that returns

Callers

nothing calls this directly

Calls 2

noneFunction · 0.70
someFunction · 0.70

Tested by

no test coverage detected