TypeScript schema rewriter
@traversable/schema
is a general purpose schema rewriting tool.
At the time of writing, it is home to the fastest deep equal and fastest deep clone functions in the JavaScript ecosystem.
You can learn more about why they're so fast, and how the benchmarks were conducted, below:
- Blog post: Building JavaScript's fastest deep equals function
- Blog post: Building JavaScript's fastest deep clone function
A schema is a syntax tree. ASTs lend themselves to (re)-interpretation. If you're not treating your TypeScript schemas like ASTs, you're missing out.
@traversable/schema
makes it easy to do anything with a TypeScript schema.
The idea of term rewriting comes from the programming language community. Languages like Racket and Lean invert control and give users a first-class API for rewriting and extending the language.
Unfortunately, we don't have that kind of power in TypeScript because we're limited by the target language (JavaScript). And frankly, given how flexible JavaScript already is, exposing that kind of API would be a recipe for disaster.
We do however have schemas, and schemas are basically ASTs.
- 📦
@traversable/[email protected]
: Production-grade ArkType schema-rewriters - 🔬
@traversable/[email protected]
: Configurable ArkType schema-generator (for fuzz testing) - 🌳
@traversable/[email protected]
: ArkType Functor (for recursion schemes) - 📦
@traversable/[email protected]
: Production-grade JSON Schema schema-rewriters - 🔬
@traversable/[email protected]
: Configurable JSON Schema schema-generator (for fuzz testing) - 🌳
@traversable/[email protected]
: JSON Schema Functor (for recursion schemes) - 📦
@traversable/[email protected]
: Production-grade TypeBox schema-rewriters - 🔬
@traversable/[email protected]
: Configurable TypeBox schema-generator (for fuzz testing) - 🌳
@traversable/[email protected]
: ArkType Functor (for recursion schemes) - 📦
@traversable/[email protected]
: Production-grade Valibot schema-rewriters - 🔬
@traversable/[email protected]
: Configurable Valibot schema-generator (for fuzz testing) - 🌳
@traversable/[email protected]
: Valibot Functor (for recursion schemes) - 📦
@traversable/[email protected]
: Production-grade zod schema-rewriters - 🔬
@traversable/[email protected]
: Configurable zod schema-generator (for fuzz testing) - 🌳
@traversable/[email protected]
: zod Functor (for recursion schemes)
@traversable/[email protected]
@traversable/[email protected]
@traversable/[email protected]
@traversable/[email protected]
@traversable/[email protected]
@traversable/[email protected]
@traversable/[email protected]
@traversable/[email protected]
@traversable/[email protected]
@traversable/[email protected]
@traversable/[email protected]