Skip to content

Add strict max & min number validations #128

Open
@d-campbell-bs

Description

@d-campbell-bs

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions