code: function(errors, options) {
        errors = v.pruneEmptyErrors(errors, options);
        errors = v.expandMultipleErrors(errors, options);
        errors = v.convertErrorMessages(errors, options);
  
        var format = options.format || "grouped";
  
        if (typeof v.formatters[format] === 'function') {
          errors = v.formatters[format](errors);
        } else {
          throw new Error(v.format("Unknown format %{format}", options));
        }
  
        return v.isEmpty(errors) ? undefined : errors;
      }
docs: Takes the output from runValidations and converts it to the correct output format.