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

Function transformOptional

packages/effect/src/SchemaGetter.ts:597–599  ·  view source on GitHub ↗
(f: (oe: Option.Option<E>) => Option.Option<T>)

Source from the content-addressed store, hash-verified

595 * @since 4.0.0
596 */
597export function transformOptional<T, E>(f: (oe: Option.Option<E>) => Option.Option<T>): Getter<T, E> {
598 return new Getter((oe) => Effect.succeed(f(oe)))
599}
600
601/**
602 * Creates a getter that always returns `None`, effectively omitting the value from output.

Callers 1

transformFunction · 0.70

Calls 2

fFunction · 0.50
succeedMethod · 0.45

Tested by

no test coverage detected