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

Function onSome

repos/effect/packages/effect/src/SchemaGetter.ts:404–408  ·  view source on GitHub ↗
(
  f: (e: E, options: SchemaAST.ParseOptions) => Effect.Effect<Option.Option<T>, SchemaIssue.Issue, R>
)

Source from the content-addressed store, hash-verified

402 * - When input is `None`, returns `None` (no-op).
403 * - When input is `Some(e)`, calls `f(e, options)` to produce the result.
404 * - `f` may return `None` to omit the value, or fail with an `Issue`.
405 *
406 * **Example** (Transforming only present values)
407 *
408 * ```ts import.meta.vitest
409 * import { Effect, Option, SchemaGetter } from "effect"
410 *
411 * const parseIfPresent = SchemaGetter.onSome<number, string>(

Callers 5

Option.tsFile · 0.70
checkEffectFunction · 0.70
transformOrFailFunction · 0.70
parseJsonFunction · 0.70
stringifyJsonFunction · 0.70

Calls 1

fFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…