Hasty Briefsbeta

A lightweight TypeScript library for assertion-based runtime data validation

17 days ago
  • #runtime
  • #validation
  • #TypeScript
  • decode-kit is a lightweight, zero-dependency TypeScript library for runtime data validation.
  • It performs assertion-based validation, refining TypeScript types in-place without cloning or transforming data.
  • The library is designed for performance-critical applications, offering minimal runtime overhead.
  • Validation is fail-fast, stopping at the first error and throwing a DecoderError with detailed failure information.
  • Supports validation for strings, numbers, booleans, literals, null, undefined, ISO 8601 datetimes, arrays, and objects.
  • Includes utilities for creating union type decoders and extracting output types from decoders.
  • API inspired by Decoders library, with a focus on performance and efficiency.