validatorjs / validator.js

String validation
MIT License
23.01k stars 2.29k forks source link

Add New validateAll util functions #1618

Closed masoudDaliriyan closed 4 months ago

masoudDaliriyan commented 3 years ago

ValidateAll() function could take multiple validator and exec with one value

example:

import isPort from 'validator/lib/isEmail';
import isAlphanumeric from 'validator/lib/isAlphanumeric';
import validateAll from 'validator/utils/validateAll'

validateAll('8080' ,isPort ,isAlphanumeric) // true
validateAll('a-80-2' ,isPort ,isAlphanumeric) // false 

https://github.com/validatorjs/validator.js/pull/1619#issue-581401064

parasg1999 commented 3 years ago

I would like to work on this if taken further.

fedeci commented 3 years ago

PR raised at #1619 :)

rubiin commented 4 months ago

I dont think we need to support anything such. The library is modular and you can easily make a pipe operator if such thing is needed