ctavan/express-validator — pull request #7 by orfaust (2012-04-03 21:31:59+00:00)
Title: get complete error objects

I managed to fix my previous pull request :)
usage example:

req.assert('email', 'required').notEmpty();
req.assert('email', 'valid email required').isEmail();
req.assert('password', '6 to 20 characters required').len(6, 20);

var errors = req.validationErrors();
var mappedErrors = req.validationErrors(true);

errors:

[
{param: "email", msg: "required"},
{param: "email", msg: "valid email required"},
{param: "password",msg: "6 to 20 characters required"}
]

mappedErrors:

{
email: "valid email required",
password: "6 to 20 characters required"
}

req.validationErrors() returns false if there are no errors