github.com/whiteand/ts-quartet ↗

Typescript version of quartet

An animated visualization of whiteand/ts-quartet's Git history from May 2019 to November 2020, built by 5 contributors. The codebase reached 1,713 lines, mostly TypeScript. The video runs 28 seconds.

Render your own repo

Turn any GitHub repository into a video like this — free sample in seconds.

Visualize your own →

Open this visualization on its own page →

Language

TypeScript

Contributors

5

Lines of Code

1,713

From

2019-05-15

To

2020-11-19

Advertisement

About whiteand/ts-quartet

Quartet 11 is a lightweight TypeScript data validation library that compiles declarative schemas into fast validation functions. At just 6.76 KB minified and gzipped with no dependencies, it offers a straightforward approach to validating JavaScript values against type definitions.

The library uses a declarative syntax where primitive values serve as their own schemas, and objects define validation rules through their structure. Users can compose complex validators by combining built-in schemas like `v.string`, `v.number`, and `v.arrayOf()` with custom logic via methods like `v.and()`, `v.custom()`, and `v.not()`. Special features include support for object rest patterns to validate dynamic properties, pair schemas for validating array elements with their indices, and optional explanations that detail exactly where validation failed and why.

Performance is a key strength—benchmarks show Quartet 11 validates nearly three times faster than Ajv, a popular JSON schema validator. The library serves developers building APIs, validating third-party responses, or ensuring type safety at runtime, particularly in projects where bundle size and validation speed matter.

Advertisement

Share this video