Reason with TypeScript code via type introspection, powered by Tree-Sitter.
Introspection helps avoid the problem of slow types introduced by libraries like Zod and TypeBox. It allows you to determine the type of a value at runtime, rather than inferring it at compile time. This can lead to more efficient and dynamic type handling in your TypeScript projects.
{
"imports": {
"typescript-type-introspector": "https://deno.land/x/introspector"
}
}
TypeBox objects are JSON Schema objects with extra in-memory magic!
A fun way to think about TypeBox is that it does for JSON Schema what drizzle does for SQL - it’s a nice, TypeScript-friendly builder syntax for an existing spec that tries to expose all of the spec’s power. That’s not all TypeBox is - it has an extremely fast built-in type checker, it can create example values based on schemas, and a lot more.
Introspection helps avoid the problem of slow types introduced by libraries like Zod and TypeBox. It allows you to determine the type of a value at runtime, rather than inferring it at compile time. This can lead to more efficient and dynamic type handling in your TypeScript projects.
Instantiate a TypeBox schema at runtime using introspection via
@sinclair/typebox/compiler
.
Make sure to install Deno: https://deno.land/manual/getting_started/installation.
Run the tests:
deno task dev
Format the project:
deno fmt
Check for common errors:
deno lint
Developed with 🧪 @FartLabs