decode-kit: A Lightweight TypeScript Runtime Data Validation Library
2025-08-25
decode-kit is a lightweight, zero-dependency TypeScript library for validating arbitrary runtime data. It uses assertion-based validation that refines your types in-place—no cloning, no transformations, and minimal runtime overhead. decode-kit validates your data and narrows its type directly; your original values remain unchanged. It employs a fail-fast approach, throwing a detailed error on the first validation failure, including the location and expected schema. Supporting various data types (strings, numbers, booleans, arrays, objects) with configurable rules, decode-kit outperforms libraries like Zod due to its in-place type assertion, making it ideal for performance-critical applications.
Development