<commit_before>// All the validation types and the method name to validate
var V = require('validator');

// Add isString method to Validator object
V.isString = function (value) {
  return (typeof value === 'string');
};

// Add isBoolean method to Validator object
V.isBoolean = function (value) {
  return (typeof value === 'boolean');
};

// Add isBoolean method to Validator object
V.isDate = function (value) {
  return (V.isRFC3339(value) || V.isISO8601(value));
};

module.exports = {
  'alpha': {
    method: 'isAlpha'
  },
  'alphanumeric': {
    method: 'isAlphanumeric'
  },
  'ascii': {
    method: 'isAscii'
  },
  'base64': {
    method: 'isBase64'
  },
  'boolean': {
    method: 'isBoolean'
  },
  'country2': {
    method: 'isISO31661Alpha2'
  },
  'country3': {
    method: 'isISO31661Alpha3'
  },
  'creditcard': {
    method: 'isCreditCard'
  },
  'date': {
    method: 'isDate'
  },
  'email': {
    method: 'isEmail'
  },
  'empty': {
    method: 'isEmpty'
  },
  'escape': {
    method: 'escape'
  },
  'fqdn': {
    method: 'isFQDN'
  },
  'float': {
    method: 'isFloat',
    sanitizer: V.toFloat
  },
  'hex': {
    method: 'isHexadecimal'
  },
  'hexcolor': {
    method: 'isHexColor'
  },
  'int': {
    method: 'isInt',
    sanitizer: V.toInt
  },
  'ip': {
    method: 'isIP'
  },
  'iprange': {
    method: 'isIPRange'
  },
  'isbn': {
    method: 'isISBN'
  },
  'issn': {
    method: 'isISSN'
  },
  'isin': {
    method: 'isISIN'
  },
  'isrc': {
    method: 'isISRC'
  },
  'json': {
    method: 'isJSON'
  },
  'jwt': {
    method: 'isJWT'
  },
  'latlon': {
    method: 'isLatLong'
  },
  'lower': {
    method: 'isLowercase'
  },
  'ltrim': {
    method: 'ltrim'
  },
  'macaddress': {
    method: 'isMACAddress'
  },
  'md5': {
    method: 'isMD5'
  },
  'mobilephone': {
    method: 'isMobilePhone'
  },
  'mongoid': {
    method: 'isMongoId'
  },
  'numeric': {
    method: 'isNumeric'
  },
  'port': {
    method: 'isPort'
  },
  'rtrim': {
    method: 'rtrim'
  },
  'string': {
    sanitizer: 'toString'
  },
  'toboolean': {
    sanitizer: 'toBoolean'
  },
  'todate': {
    method: 'isISO8601',
    sanitizer: V.toDate,
    type: 'date'
  },
  'toemail': {
    method: 'isEmail',
    sanitizer: V.normalizeEmail,
    type: 'email'
  },
  'tolower': {
    method: 'isString',
    sanitizer: toLowerCase,
    type: 'string'
  },
  'toupper': {<commit_msg>Updated validator and added several validations<commit_after>// All the validation types and the method name to validate
var V = require('validator');

// Add isString method to Validator object
V.isString = function (value) {
  return (typeof value === 'string');
};

// Add isBoolean method to Validator object
V.isBoolean = function (value) {
  return (typeof value === 'boolean');
};

// Add isBoolean method to Validator object
V.isDate = function (value) {
  return (V.isRFC3339(value) || V.isISO8601(value));
};

module.exports = {
  'alpha': {
    method: 'isAlpha'
  },
  'alphanumeric': {
    method: 'isAlphanumeric'
  },
  'ascii': {
    method: 'isAscii'
  },
  'base64': {
    method: 'isBase64'
  },
  'boolean': {
    method: 'isBoolean'
  },
  'country2': {
    method: 'isISO31661Alpha2'
  },
  'country3': {
    method: 'isISO31661Alpha3'
  },
  'creditcard': {
    method: 'isCreditCard'
  },
  'date': {
    method: 'isDate'
  },
  'email': {
    method: 'isEmail'
  },
  'empty': {
    method: 'isEmpty'
  },
  'escape': {
    method: 'escape'
  },
  'fqdn': {
    method: 'isFQDN'
  },
  'float': {
    method: 'isFloat',
    sanitizer: V.toFloat
  },
  'hex': {
    method: 'isHexadecimal'
  },
  'hexcolor': {
    method: 'isHexColor'
  },
  'int': {
    method: 'isInt',
    sanitizer: V.toInt
  },
  'ip': {
    method: 'isIP'
  },
  'iprange': {
    method: 'isIPRange'
  },
  'isbn': {
    method: 'isISBN'
  },
  'issn': {
    method: 'isISSN'
  },
  'isin': {
    method: 'isISIN'
  },
  'isrc': {
    method: 'isISRC'
  },
  'json': {
    method: 'isJSON'
  },
  'jwt': {
    method: 'isJWT'
  },
  'latlon': {
    method: 'isLatLong'
  },
  'lower': {
    method: 'isLowercase'
  },
  'ltrim': {
    method: 'ltrim'
  },
  'macaddress': {
    method: 'isMACAddress'
  },
  'md5': {
    method: 'isMD5'
  },
  'mobilephone': {
    method: 'isMobilePhone'
  },
  'mongoid': {
    method: 'isMongoId'
  },
  'numeric': {
    method: 'isNumeric'
  },
  'port': {
    method: 'isPort'
  },
  'rtrim': {
    method: 'rtrim'
  },
  'string': {
    sanitizer: 'toString'
  },
  'toboolean': {
    sanitizer: 'toBoolean'
  },
  'todate': {
    method: 'isDate',
    sanitizer: V.toDate,
    type: 'date'
  },
  'toemail': {
    method: 'isEmail',
    sanitizer: V.normalizeEmail,
    type: 'email'
  },
  'tolower': {
    method: 'isString',
    sanitizer: toLowerCase,
    type: 'string'
  },
  'toupper': {
{'fraction_non_alphanumeric': 0.18953031243534038, 'fraction_numerical': 0.012414649286157667, 'mean_word_length': 2.5913818722139674, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7112575', 'n_tokens_mistral': 1990, 'n_tokens_neox': 1955, 'n_words': 385}