src/definition/validator/validate.js
function validate(property, validators) {
    //console.log("validate", property, validators);
    let errors = [], res, validator;
    if (validators) {
        for (let i = 0, _len = validators.length; i < _len; i++) {
            validator = validators[i];
            res = validateProperty(property, validator);
            if (!isNull(res) && !isUndefined(res)) {
                errors.push(res);
            }
        }
    }
    //Check what's the good type to return.
    return {
        name: property.name,
        value: property.value,
        isValid: 0 === errors.length,
        errors: errors
    };
}
function validate(property, validators) {
    //console.log("validate", property, validators);
    let errors = [], res, validator;
    if (validators) {
        for (let i = 0, _len = validators.length; i < _len; i++) {
            validator = validators[i];
            res = validateProperty(property, validator);
            if (!isNull(res) && !isUndefined(res)) {
                errors.push(res);
            }
        }
    }
    //Check what's the good type to return.
    return {
        name: property.name,
        value: property.value,
        isValid: 0 === errors.length,
        errors: errors
    };
}
function validate ( property , validators ) { //console.log("validate", property, validators); let errors = [ ] , res , validator ; if ( validators ) { for ( let i = 0 , _len = validators . length ; i < _len ; i ++ ) { validator = validators [ i ] ; res = validateProperty ( property , validator ) ; if ( ! isNull ( res ) && ! isUndefined ( res ) ) { errors . push ( res ) ; } } } //Check what's the good type to return. return { name : property . name , value : property . value , isValid : 0 === errors . length , errors : errors } ; }
Validae a property given validators.
@param  {object} property   - Property to validate which should be as follows: `{name: "field_name",value: "field_value", validators: [{...}] }`.
@param  {array} validators - The validators to apply on the property.
@return {object} - The validation status.
Validae a property given validators .