MCPcopy Create free account
hub / github.com/effect-app/libs / firstSomeOf

Function firstSomeOf

repos/effect/packages/effect/src/Option.ts:774–784  ·  view source on GitHub ↗
(
  collection: C
)

Source from the content-addressed store, hash-verified

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`
779 * as a valid `Some`.
780 *
781 * **When to use**
782 *
783 * Use when you want to treat only `undefined` as absent while preserving `null`
784 * as a meaningful value.
785 *
786 * **Details**
787 *

Callers

nothing calls this directly

Calls 2

isSomeFunction · 0.85
noneFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…