utils/validation.js
function parseValidateAttr(validateAttr, schema, validateFns) {

        // if an array, loop through and recurse
        if (_.isArray(validateAttr)) {
            _.each(validateAttr, function (validator) {
                parseValidateAttr(validator, schema, validateFns);
            });

            return;
        }

        // if validateAttr is a string, then assume it is field reference
        if (_.isString(validateAttr)) {
            _.extend(schema, getSchema(validateAttr));
        }
        else if (_.isFunction(validateAttr)) {
            validateFns.push(wrapFn(validateAttr));
        }
        else if (_.isObject(validateAttr)) {
            _.extend(schema,  validateAttr);
        }
    }
function parseValidateAttr(validateAttr, schema, validateFns) {

        // if an array, loop through and recurse
        if (_.isArray(validateAttr)) {
            _.each(validateAttr, function (validator) {
                parseValidateAttr(validator, schema, validateFns);
            });

            return;
        }

        // if validateAttr is a string, then assume it is field reference
        if (_.isString(validateAttr)) {
            _.extend(schema, getSchema(validateAttr));
        }
        else if (_.isFunction(validateAttr)) {
            validateFns.push(wrapFn(validateAttr));
        }
        else if (_.isObject(validateAttr)) {
            _.extend(schema,  validateAttr);
        }
    }
function parseValidateAttr ( validateAttr , schema , validateFns ) { // if an array, loop through and recurse if ( _ . isArray ( validateAttr ) ) { _ . each ( validateAttr , function ( validator ) { parseValidateAttr ( validator , schema , validateFns ) ; } ) ; return ; } // if validateAttr is a string, then assume it is field reference if ( _ . isString ( validateAttr ) ) { _ . extend ( schema , getSchema ( validateAttr ) ) ; } else if ( _ . isFunction ( validateAttr ) ) { validateFns . push ( wrapFn ( validateAttr ) ) ; } else if ( _ . isObject ( validateAttr ) ) { _ . extend ( schema , validateAttr ) ; } }
Take thing originally from the gh-validate attribute and turn it into an obj and fns array
@param validateAttr
@param schema
@param validateFns
Take thing originally from the gh - validate attribute and turn it into an obj and fns array