What problem does it solve?
TypeScript-based input validation for API requests and video data structures. Use this when validating request bodies in Express handlers, implementing type guards, or validating RenderRequest and RecapBook data. Ensures type safety at API boundaries.
Core Features & Use Cases
- TypeScript Type Guards: Use TypeScript types and type guards for compile-time and runtime validation
- Server-Side Validation: All API endpoints must validate request bodies against defined types
- Fail Early: Validate input at API boundary; reject invalid requests before processing
- Specific Error Messages: Return clear, field-specific errors: { error: 'Invalid month', field: 'month' }
- Request Body Validation: Validate RenderRequest fields (month 1-12, year valid, books array structure)
- Type Safety: Define interfaces in src/lib/types.ts and enforce at API boundaries
- Business Rule Validation: Validate video constraints (frame counts, durations, book data completeness)
- No Client-Side Validation: This is a server-to-server API; all validation happens server-side
Quick Start
Validate a sample RenderRequest payload against the defined types to verify server-side validation behavior.