More information needed on Manual Validation parameters
See original GitHub issueI come from a php background, where the validation libraries I’m used to, just return true or false (which is awesome), then I do whatever I want from there. So, I opted to use the “Manual validation” here (isEmail precisely), and it worked as expected. (I’m using in a Nativescript application BTW)
Problem is with the second parameter, “options”, whose properties are not mentioned at all in the documentation.
I just ended up setting allow_display_name, allow_utf8_local_part and require_tld to true without even knowing what they mean.
I’d appreciate if these properties (and others like allow_negative_sign_placeholder, host_whitelist and host_blacklist) are explained.
EDIT::
I tried to use the decorators way as shown in the first example, and it worked. BUT console.log("validation failed. errors: ", errors) just outputs ‘validation failed. errors: [object Object]’ in the terminal. So, I really want to stick with the “Manual validation"
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (5 by maintainers)

Top Related StackOverflow Question
try to install newer version of node
My background is also php, and don’t afraid of asynchronous nature of nodejs platform. There are a lot of benefits in using them. Go ahead and use code this way:
Using async/await syntax mades code look and understand better. In the case if you still want to use sync validation you can use
validateSyncmethod:but keep in mind that in this case you can loose extra functionality that custom validators can provide. But its actually not a problem if you don’t create custom validators.
Regarding you comment about undocumented options. You can find documentation in validator package which is used by this library.
btw really good validation library never return you just
true or false. True or false used in the trivial validation cases. The really powerful validation frameworks in php also return array of validation error details.