effect-io-ai

Package: effect
Module: SchemaAST

SchemaAST.toType

Strips all encoding transformations from an AST, returning the decoded (type-level) representation.

Details

Example (Getting the type AST)

import { Schema, SchemaAST } from "effect"

const schema = Schema.NumberFromString
const typeAst = SchemaAST.toType(schema.ast)
console.log(typeAst._tag) // "Number"

See

Signature

declare const toType: <A extends AST>(ast: A) => A

Source

Since v4.0.0