Valibot Schema Validation

Valibot Schema Validation

valibot.dev

2

About this website

Valibot is an open-source schema validation library for TypeScript created by Fabian Hiller, designed with bundle size, type safety, and developer experience as primary priorities. The library features a modular API design where individual validation functions can be imported separately, resulting in a minimum bundle size of less than seven hundred bytes when tree-shaken, compared to larger monolithic validation libraries that ship their entire codebase regardless of which functions are used. Valibot supports almost any TypeScript type from primitive values like strings, numbers, and booleans to complex nested objects, arrays, tuples, unions, intersections, and recursive structures. The schema definitions provide automatic static type inference, generating both input and output TypeScript types from a single schema definition without manual type annotations. The validation pipeline processes data through configurable steps including parsing, transforming, validating, and pipe composition, with built-in validators for email, URL, UUID, IP address, credit card number, date, ISBN, and dozens of other formats. The transformation functions enable data normalization including trimming, lowercasing, number parsing, date parsing, and custom transformation logic. Valibot achieves one hundred percent test coverage across all functions and supports both synchronous and asynchronous validation, with detailed error reporting including specific issue types, paths, and messages for each validation failure.

Tags & Categories

Statistics

2
Views
0
Clicks
0
Like
0
Dislike

Comments

Log In to post a comment

No comments yet. Be the first!