Skip to content

non-string validations - why not? #1949

Open
@danbars

Description

This is semi feature request semi philosophical question:
Why is validator.js targeted to string validations only?
Why not expend it to other type of validations such as arrays, numbers, etc?
Looking at it from practical perspective, if I want to validate a form, I'm going to need more than just string validations.
This means that if I use validator.js I'll have to combine it with additional library that will complement it. And then I'll have overlapping functionality because all other libraries also have at least some string validations.

Edit:
Some more related questions:

  1. Are there common use cases where only string validations are needed, without other types of validations?
  2. Is there any common practice combining validator.js with other libraries validation libraries?

My specific use case is: I'm writing a form-builder in Vue, and want to allow users to define validations. Some of it is indeed string, but some is not.

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions