code: function(field, format, options) {
      options = options || {}
  
      if (Array.isArray(field)) {
        return this.validateFieldsHelper(field, [format], this.validatesFormatOf)
      }
  
      return this.validates(field, function() {
        var valid = false
        var value = this[field]
  
        switch (format) {
          case 'email':
            valid = validator.isEmail(value + '')
            break
  
          case 'url':
            valid = validator.isURL(value + '')
            break
  
          case 'ip':
            valid = validator.isIP(value + '')
            break
  
          case 'uuid':
            valid = validator.isUUID(value + '')
            break
  
          case 'date':
            valid = value instanceof Date
            break
  
          case null:
            valid = value === null || validator.isEmpty(value + '')
            break
          default:
            valid = validator.matches(value + '', format)
            break
        }
  
        if (value === null && options.allow_null) return true
  
        if (!valid) this.errors.add(field, 'not a valid format')
        return valid
      })
    }
docs: This validator checks the format of a field.
  Valid format types are:
  * `email`
  * `url`
  * `ip`
  * `uuid`
  * `date`
  * null
  * Regular expression
  
  @memberof Definition
  @method validatesFormatOf
  @param {array} fields - The fields to validate
  @param {(string|RegExp|null)} format - The format type
  @param {object} options - The options hash
  @param {boolean} options.allow_null - Skip validation if value is null
  
  @return {Definition}