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

Function transform

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

Source from the content-addressed store, hash-verified

438 * @since 3.10.0
439 */
440export function transform<T, E>(options: {
441 readonly decode: (input: E) => T
442 readonly encode: (input: T) => E
443}): Transformation<T, E> {
444 return new Transformation(
445 SchemaGetter.transform(options.decode),
446 SchemaGetter.transform(options.encode)
447 )
448}
449
450/**
451 * Creates a `Transformation` where decode and encode operate on `Option`

Callers 6

errorFromJsonErrorFunction · 0.70
defectFromJsonFunction · 0.70
optionFromNullOrFunction · 0.70
optionFromUndefinedOrFunction · 0.70
optionFromNullishOrFunction · 0.70

Calls 1

transformMethod · 0.65

Tested by

no test coverage detected