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

Function make

packages/effect/src/SchemaTransformation.ts:232–240  ·  view source on GitHub ↗
(options: {
  readonly decode: SchemaGetter.Getter<T, E, RD>
  readonly encode: SchemaGetter.Getter<E, T, RE>
})

Source from the content-addressed store, hash-verified

230 * @since 3.10.0
231 */
232export const make = <T, E, RD = never, RE = never>(options: {
233 readonly decode: SchemaGetter.Getter<T, E, RD>
234 readonly encode: SchemaGetter.Getter<E, T, RE>
235}): Transformation<T, E, RD, RE> => {
236 if (isTransformation(options)) {
237 return options as any
238 }
239 return new Transformation(options.decode, options.encode)
240}
241
242/**
243 * Creates a `Transformation` from effectful decode and encode functions that

Callers

nothing calls this directly

Calls 1

isTransformationFunction · 0.85

Tested by

no test coverage detected