Hyperlinkv0.8.0-beta.28

SchemaAST

SchemaAST.decodeTofunctioneffect/SchemaAST.ts:3295
<A extends AST>(
  from: AST,
  to: A,
  transformation: SchemaTransformation.Transformation<any, any, any, any>
): A

Attaches a Transformation to the to AST, making it decode from the from AST and encode back to it.

Details

This is the low-level primitive behind Schema.transform and Schema.transformOrFail. It appends a Link to the to node's encoding chain.

  • Returns a new AST with the same type as to.
transformingLinkEncodingflip
export function decodeTo<A extends AST>(
  from: AST,
  to: A,
  transformation: SchemaTransformation.Transformation<any, any, any, any>
): A {
  return appendTransformation(from, transformation, to)
}
Referenced by 2 symbols