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

Add strict max & min number validations #128

Open
d-campbell-bs opened this issue Jul 26, 2022 · 0 comments
Open

Add strict max & min number validations #128

d-campbell-bs opened this issue Jul 26, 2022 · 0 comments
Labels

Comments

@d-campbell-bs
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
When validating numbers, the current implementations of isMinNumber and isMaxNumber do not support strict inequality, meaning that the limit will always be a valid value.

Describe the solution you'd like
I'd like to have the possibility to declare a strict minimum or maximum value for which the equality will result in an invalid field.

Describe alternatives you've considered
I see two ways of handling this:

  • add a parameter to the current isMinNumber & isMaxNumber. I can see a call to the validation be something like isMinNumber(0, {strict: true}) with the strict mode being set to false by default.
  • add a different validation that will handle this case. It would basically use the same code as the current versions but with a strict inequality instead.
@ivan-dalmet ivan-dalmet added the v1 label Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants