Suretype is a JSON validator targeting TypeScript and JSON Schema. It is ridiculously type-safe when used in TypeScript, which is good for accuracy, but also for aiding IDE auto-complete. It's as easy as Joi, but ~70x faster. It's (at least) as typesafe as Superstruct, but ~100x faster. ~2500x faster than Zod and ~1600x faster than ow. It supports most (if not all) of JSON schema, and nothing beyond that, so that the validator schemas written in TypeScript (or JavaScript) can be ensured to be convertible into JSON schema. This also prevents sure type from becoming feature-bloated, it has a small and extremely simple API.

Features

  • Compile a validator function (using the very fast Ajv)
  • Extract the corresponding JSON Schema
  • Deduce a TypeScript type corresponding to the validator schema (at compile-time!)
  • Examples available
  • Type-guarded validator
  • Type-ensured validator
  • Validate or ensure without compiling

Project Samples

Project Activity

See All Activity >

Categories

JSON

Follow Suretype

Suretype Web Site

Other Useful Business Software
Build on Google Cloud with $300 in Free Credit Icon
Build on Google Cloud with $300 in Free Credit

New to Google Cloud? Get $300 in free credit to explore Compute Engine, BigQuery, Cloud Run, Vertex AI, and 150+ other products.

Start your next project with $300 in free Google Cloud credit. Spin up VMs, run containers, query exabytes in BigQuery, or build AI apps with Vertex AI and Gemini. Once your credits are used, keep building with 20+ products with free monthly usage, including Compute Engine, Cloud Storage, GKE, and Cloud Run functions. Sign up to start building right away.
Start Free Trial
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Suretype!

Additional Project Details

Programming Language

TypeScript

Related Categories

TypeScript JSON Software

Registered

2023-10-27