gapstack icon indicating copy to clipboard operation
gapstack copied to clipboard

Custom Error Messages

Open Nick-Lucas opened this issue 2 years ago • 0 comments

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 lt which returns a new lt with 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

Nick-Lucas avatar Feb 18 '23 23:02 Nick-Lucas