src/validator.js
function (rulesArray) {
    var rules = [];

    for (var i = 0, len = rulesArray.length; i < len; i++) {
      if (typeof rulesArray[i] === 'object') {
        for (var rule in rulesArray[i]) {
          rules.push({
            name: rule,
            value: rulesArray[i][rule]
          });
        }
      } else {
        rules.push(rulesArray[i]);
      }
    }

    return rules;
  }
function (rulesArray) {
    var rules = [];

    for (var i = 0, len = rulesArray.length; i < len; i++) {
      if (typeof rulesArray[i] === 'object') {
        for (var rule in rulesArray[i]) {
          rules.push({
            name: rule,
            value: rulesArray[i][rule]
          });
        }
      } else {
        rules.push(rulesArray[i]);
      }
    }

    return rules;
  }
function ( rulesArray ) { var rules = [ ] ; for ( var i = 0 , len = rulesArray . length ; i < len ; i ++ ) { if ( typeof rulesArray [ i ] === 'object' ) { for ( var rule in rulesArray [ i ] ) { rules . push ( { name : rule , value : rulesArray [ i ] [ rule ] } ) ; } } else { rules . push ( rulesArray [ i ] ) ; } } return rules ; }
Prepare rules if it comes in Array. Check for objects. Need for type validation.

@param  {array} rulesArray
@return {array}
Prepare rules if it comes in Array . Check for objects . Need for type validation .