How to use the toString function from validator

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

405
406
407
408
409
410
411
412
413
};

validator.extend = function (name, fn) {
    validator[name] = function () {
        var args = Array.prototype.slice.call(arguments);
        args[0] = validator.toString(args[0]);
        return fn.apply(validator, args);
    };
};
fork icon3
star icon57
watch icon9

+ 31 other calls in file

75
76
77
78
79
80
81
82
83
84
    }
    return true;
};

validator.isIP = function (str, version) {
    version = validator.toString(version);
    if (!version) {
        return validator.isIP(str, 4) || validator.isIP(str, 6);
    } else if (version === '4') {
        if (!ipv4Maybe.test(str)) {
fork icon2
star icon3
watch icon4

+ 5 other calls in file

586
587
588
589
590
591
592
593
594
595
    }
    return str !== '0' && str !== 'false' && str !== '';
};

validator.equals = function (str, comparison) {
    return str === validator.toString(comparison);
};

validator.contains = function (str, elem) {
    return str.indexOf(validator.toString(elem)) >= 0;
fork icon0
star icon2
watch icon1

+ 4 other calls in file