Skip to content

traversable/schema

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1,422 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation


แฏ“๐˜๐—ฟ๐—ฎ๐˜ƒ๐—ฒ๐—ฟ๐˜€๐—ฎ๐—ฏ๐—น๐—ฒ/๐˜€๐—ฐ๐—ต๐—ฒ๐—บ๐—ฎ


TypeScript schema rewriter

TypeScript ย  License ย  Documentation ย 
Tree-shakable ย  ESM Supported ย  CJS Supported ย 


Overview

@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:

Design

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.

What's a "schema rewriter"?

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.

Integrations

Libraries

Prior art