gapstack
gapstack copied to clipboard
Custom Error Messages
Error messages need to be customisable.
- Add a definitive union literal of error types and attach them to LightTypeError throws
Provide a way to configure, ie:
- Add add .configure method to
ltwhich returns a newltwith mappings on - Add general mappings to the initial type creation like Zod:
lt.number({ required: 'Required' }) - Add per validator messages
- Add a validation abstraction which can be passed to .pipe with just a condition callback and a message