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/arktype@0.0.9
: Production-grade ArkType schema-rewriters - 🔬
@traversable/arktype-test@0.0.7
: Configurable ArkType schema-generator (for fuzz testing) - 🌳
@traversable/arktype-types@0.0.7
: ArkType Functor (for recursion schemes) - 📦
@traversable/json-schema@0.0.9
: Production-grade JSON Schema schema-rewriters - 🔬
@traversable/json-schema-test@0.0.9
: Configurable JSON Schema schema-generator (for fuzz testing) - 🌳
@traversable/json-schema-types@0.0.9
: JSON Schema Functor (for recursion schemes) - 📦
@traversable/typebox@0.0.13
: Production-grade TypeBox schema-rewriters - 🔬
@traversable/typebox-test@0.0.8
: Configurable TypeBox schema-generator (for fuzz testing) - 🌳
@traversable/typebox-types@0.0.7
: ArkType Functor (for recursion schemes) - 📦
@traversable/valibot@0.0.5
: Production-grade Valibot schema-rewriters - 🔬
@traversable/valibot-test@0.0.4
: Configurable Valibot schema-generator (for fuzz testing) - 🌳
@traversable/valibot-types@0.0.4
: Valibot Functor (for recursion schemes) - 📦
@traversable/zod@0.0.20
: Production-grade zod schema-rewriters - 🔬
@traversable/zod-test@0.0.9
: Configurable zod schema-generator (for fuzz testing) - 🌳
@traversable/zod-types@0.0.8
: zod Functor (for recursion schemes)
@traversable/json@0.0.40
@traversable/registry@0.0.38
@traversable/schema@0.0.51
@traversable/schema-codec@0.0.21
@traversable/schema-compiler@0.0.18
@traversable/schema-errors@0.0.17
@traversable/schema-deep-equal@0.0.7
@traversable/schema-seed@0.0.40
@traversable/schema-to-json-schema@0.0.38
@traversable/schema-to-string@0.0.38
@traversable/schema-to-validator@0.0.6