Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Error Messages #24

Open
Nick-Lucas opened this issue Feb 18, 2023 · 0 comments
Open

Custom Error Messages #24

Nick-Lucas opened this issue Feb 18, 2023 · 0 comments
Labels
enhancement New feature or request Package: LightType

Comments

@Nick-Lucas
Copy link
Owner

Nick-Lucas commented Feb 18, 2023

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 Nick-Lucas added Package: LightType enhancement New feature or request labels Feb 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Package: LightType
Projects
None yet
Development

No branches or pull requests

1 participant