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

Function onSome

packages/effect/src/SchemaGetter.ts:424–428  ·  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

422 * @since 4.0.0
423 */
424export function onSome<T, E, R = never>(
425 f: (e: E, options: SchemaAST.ParseOptions) => Effect.Effect<Option.Option<T>, SchemaIssue.Issue, R>
426): Getter<T, E, R> {
427 return new Getter((oe, options) => Option.isNone(oe) ? Effect.succeedNone : f(oe.value, options))
428}
429
430/**
431 * Creates a getter that validates a value using an effectful check function.

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