validate.js
function(errors, options) {
      options = options || {};

      var ret = []
        , prettify = options.prettify || v.prettify;
      errors.forEach(function(errorInfo) {
        var error = v.result(errorInfo.error,
            errorInfo.value,
            errorInfo.attribute,
            errorInfo.options,
            errorInfo.attributes,
            errorInfo.globalOptions);

        if (!v.isString(error)) {
          ret.push(errorInfo);
          return;
        }

        if (error[0] === '^') {
          error = error.slice(1);
        } else if (options.fullMessages !== false) {
          error = v.capitalize(prettify(errorInfo.attribute)) + " " + error;
        }
        error = error.replace(/\\\^/g, "^");
        error = v.format(error, {
          value: v.stringifyValue(errorInfo.value, options)
        });
        ret.push(v.extend({}, errorInfo, {error: error}));
      });
      return ret;
    }
function(errors, options) {
      options = options || {};

      var ret = []
        , prettify = options.prettify || v.prettify;
      errors.forEach(function(errorInfo) {
        var error = v.result(errorInfo.error,
            errorInfo.value,
            errorInfo.attribute,
            errorInfo.options,
            errorInfo.attributes,
            errorInfo.globalOptions);

        if (!v.isString(error)) {
          ret.push(errorInfo);
          return;
        }

        if (error[0] === '^') {
          error = error.slice(1);
        } else if (options.fullMessages !== false) {
          error = v.capitalize(prettify(errorInfo.attribute)) + " " + error;
        }
        error = error.replace(/\\\^/g, "^");
        error = v.format(error, {
          value: v.stringifyValue(errorInfo.value, options)
        });
        ret.push(v.extend({}, errorInfo, {error: error}));
      });
      return ret;
    }
function ( errors , options ) { options = options || { } ; var ret = [ ] , prettify = options . prettify || v . prettify ; errors . forEach ( function ( errorInfo ) { var error = v . result ( errorInfo . error , errorInfo . value , errorInfo . attribute , errorInfo . options , errorInfo . attributes , errorInfo . globalOptions ) ; if ( ! v . isString ( error ) ) { ret . push ( errorInfo ) ; return ; } if ( error [ 0 ] === '^' ) { error = error . slice ( 1 ) ; } else if ( options . fullMessages !== false ) { error = v . capitalize ( prettify ( errorInfo . attribute ) ) + " " + error ; } error = error . replace ( / \\\^ / g , "^" ) ; error = v . format ( error , { value : v . stringifyValue ( errorInfo . value , options ) } ) ; ret . push ( v . extend ( { } , errorInfo , { error : error } ) ) ; } ) ; return ret ; }
Converts the error mesages by prepending the attribute name unless the message is prefixed by ^
Converts the error mesages by prepending the attribute name unless the message is prefixed by ^