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

Function appendTransformation

packages/effect/src/SchemaAST.ts:4493–4502  ·  view source on GitHub ↗
(
  from: AST,
  transformation:
    | SchemaTransformation.Transformation<any, any, any, any>
    | SchemaTransformation.Middleware<any, any, any, any, any, any>,
  to: A
)

Source from the content-addressed store, hash-verified

4491}
4492
4493function appendTransformation<A extends AST>(
4494 from: AST,
4495 transformation:
4496 | SchemaTransformation.Transformation<any, any, any, any>
4497 | SchemaTransformation.Middleware<any, any, any, any, any, any>,
4498 to: A
4499): A {
4500 const link = new Link(from, transformation)
4501 return replaceEncoding(to, to.encoding ? [...to.encoding, link] : [link])
4502}
4503
4504/**
4505 * Maps over the array but will return the original array if no changes occur.

Callers 3

middlewareDecodingFunction · 0.85
middlewareEncodingFunction · 0.85
decodeToFunction · 0.85

Calls 1

replaceEncodingFunction · 0.85

Tested by

no test coverage detected