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

Function transformOptional

packages/effect/src/SchemaTransformation.ts:388–396  ·  view source on GitHub ↗
(options: {
  readonly decode: (input: Option.Option<E>) => Option.Option<T>
  readonly encode: (input: Option.Option<T>) => Option.Option<E>
})

Source from the content-addressed store, hash-verified

386 * @since 4.0.0
387 */
388export function transformOptional<T, E>(options: {
389 readonly decode: (input: Option.Option<E>) => Option.Option<T>
390 readonly encode: (input: Option.Option<T>) => Option.Option<E>
391}): Transformation<T, E> {
392 return new Transformation(
393 SchemaGetter.transformOptional(options.decode),
394 SchemaGetter.transformOptional(options.encode)
395 )
396}
397
398/**
399 * Transforms strings by trimming whitespace on decode.

Callers 2

optionFromOptionalKeyFunction · 0.70
optionFromOptionalFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected