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

Function transform

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

Source from the content-addressed store, hash-verified

333 * @since 3.10.0
334 */
335export function transform<T, E>(options: {
336 readonly decode: (input: E) => T
337 readonly encode: (input: T) => E
338}): Transformation<T, E> {
339 return new Transformation(
340 SchemaGetter.transform(options.decode),
341 SchemaGetter.transform(options.encode)
342 )
343}
344
345/**
346 * 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