code: function castString(format, value) {
    if (!isString(value)) {
      return ERROR
    }
    if (format === 'uri') {
      if (!isURL(value, {require_protocol: true})) {
        return ERROR
      }
    } else if (format === 'email') {
      if (!isEmail(value)) {
        return ERROR
      }
    } else if (format === 'uuid') {
      if (!isUUID(value)) {
        return ERROR
      }
    } else if (format === 'binary') {
      if (!value.endsWith('==') || !isBase64(value)) {
        return ERROR
      }
    }
    return value
  }
docs: Module API