src/core/validator.js
function getValidationsStack (validations, fields, data, messages, formatter) {
  return Object
    .keys(fields)
    .reduce((flatValidations, field) => {
      fields[field].map((rule) => {
        flatValidations.push(validationFn(validations, rule, field, data, messages, formatter))
      })
      return flatValidations
    }, [])
}
function getValidationsStack (validations, fields, data, messages, formatter) {
  return Object
    .keys(fields)
    .reduce((flatValidations, field) => {
      fields[field].map((rule) => {
        flatValidations.push(validationFn(validations, rule, field, data, messages, formatter))
      })
      return flatValidations
    }, [])
}
function getValidationsStack ( validations , fields , data , messages , formatter ) { return Object . keys ( fields ) . reduce ( ( flatValidations , field ) => { fields [ field ] . map ( ( rule ) => { flatValidations . push ( validationFn ( validations , rule , field , data , messages , formatter ) ) } ) return flatValidations } , [ ] ) }
This method loops over the fields and returns a flat stack of
validations for each field and multiple rules on that field.

Also all validation methods are wrapped inside a Lazy promise,
so they are executed when `.then` or `.catch` is called on
them.

@method getValidationsStack

@param {Object}  validations  - Object of available validations
@param {Object}  data         - Data to validate
@param {Object}  fields       - Fields and their rules
@param {Object}  messages     - Custom messages
@param {Object}  formatter    - Formatter to be used

@returns {Promise[]} An array of lazy promises
This method loops over the fields and returns a flat stack of validations for each field and multiple rules on that field .