How to use the prototype function from validator

Find comprehensive JavaScript validator.prototype code examples handpicked from public code repositorys.

25
26
27
28
29
30
31
32
33
34
*      birth : Date
*  });
*
* 2. type
*
*  all the type is define in node-validator,  Validator.prototype.is*
*
*  there are isDate, isEmail, isCreditCard, isUrl, etc
*
*  you can use capitalised string or lowercase string. e.g. 'date', 'Email', 'CreditCard', 'url'
fork icon4
star icon41
watch icon8

8
9
10
11
12
13
14
15
16
17
var jade = require('jade');
var fs = require('fs');
var Validator = require('validator').Validator;
var check = require('validator').check,
  sanitize = require('validator').sanitize
  Validator.prototype.error = function(msg) {
    this._errors.push(msg);
    return this;
  }
Validator.prototype.getErrors = function() {
fork icon0
star icon0
watch icon0