core.js
function(flat) {
    return this.transform(function(acc, val, key) {
      var json = val.toJSON();
      acc[key] = flat && _.isArray(json) ? json[0] : json
    }, {});
  }
function(flat) {
    return this.transform(function(acc, val, key) {
      var json = val.toJSON();
      acc[key] = flat && _.isArray(json) ? json[0] : json
    }, {});
  }
function ( flat ) { return this . transform ( function ( acc , val , key ) { var json = val . toJSON ( ) ; acc [ key ] = flat && _ . isArray ( json ) ? json [ 0 ] : json } , { } ) ; }
Creates a JSON object of the validations, if `true` is passed - it will flatten the error into a single value per item.
Creates a JSON object of the validations if true is passed - it will flatten the error into a single value per item .