index.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  1. "use strict";
  2. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  3. Object.defineProperty(exports, "__esModule", {
  4. value: true
  5. });
  6. exports.default = void 0;
  7. var _toDate = _interopRequireDefault(require("./lib/toDate"));
  8. var _toFloat = _interopRequireDefault(require("./lib/toFloat"));
  9. var _toInt = _interopRequireDefault(require("./lib/toInt"));
  10. var _toBoolean = _interopRequireDefault(require("./lib/toBoolean"));
  11. var _equals = _interopRequireDefault(require("./lib/equals"));
  12. var _contains = _interopRequireDefault(require("./lib/contains"));
  13. var _matches = _interopRequireDefault(require("./lib/matches"));
  14. var _isEmail = _interopRequireDefault(require("./lib/isEmail"));
  15. var _isURL = _interopRequireDefault(require("./lib/isURL"));
  16. var _isMACAddress = _interopRequireDefault(require("./lib/isMACAddress"));
  17. var _isIP = _interopRequireDefault(require("./lib/isIP"));
  18. var _isIPRange = _interopRequireDefault(require("./lib/isIPRange"));
  19. var _isFQDN = _interopRequireDefault(require("./lib/isFQDN"));
  20. var _isDate = _interopRequireDefault(require("./lib/isDate"));
  21. var _isTime = _interopRequireDefault(require("./lib/isTime"));
  22. var _isBoolean = _interopRequireDefault(require("./lib/isBoolean"));
  23. var _isLocale = _interopRequireDefault(require("./lib/isLocale"));
  24. var _isAlpha = _interopRequireWildcard(require("./lib/isAlpha"));
  25. var _isAlphanumeric = _interopRequireWildcard(require("./lib/isAlphanumeric"));
  26. var _isNumeric = _interopRequireDefault(require("./lib/isNumeric"));
  27. var _isPassportNumber = _interopRequireDefault(require("./lib/isPassportNumber"));
  28. var _isPort = _interopRequireDefault(require("./lib/isPort"));
  29. var _isLowercase = _interopRequireDefault(require("./lib/isLowercase"));
  30. var _isUppercase = _interopRequireDefault(require("./lib/isUppercase"));
  31. var _isIMEI = _interopRequireDefault(require("./lib/isIMEI"));
  32. var _isAscii = _interopRequireDefault(require("./lib/isAscii"));
  33. var _isFullWidth = _interopRequireDefault(require("./lib/isFullWidth"));
  34. var _isHalfWidth = _interopRequireDefault(require("./lib/isHalfWidth"));
  35. var _isVariableWidth = _interopRequireDefault(require("./lib/isVariableWidth"));
  36. var _isMultibyte = _interopRequireDefault(require("./lib/isMultibyte"));
  37. var _isSemVer = _interopRequireDefault(require("./lib/isSemVer"));
  38. var _isSurrogatePair = _interopRequireDefault(require("./lib/isSurrogatePair"));
  39. var _isInt = _interopRequireDefault(require("./lib/isInt"));
  40. var _isFloat = _interopRequireWildcard(require("./lib/isFloat"));
  41. var _isDecimal = _interopRequireDefault(require("./lib/isDecimal"));
  42. var _isHexadecimal = _interopRequireDefault(require("./lib/isHexadecimal"));
  43. var _isOctal = _interopRequireDefault(require("./lib/isOctal"));
  44. var _isDivisibleBy = _interopRequireDefault(require("./lib/isDivisibleBy"));
  45. var _isHexColor = _interopRequireDefault(require("./lib/isHexColor"));
  46. var _isRgbColor = _interopRequireDefault(require("./lib/isRgbColor"));
  47. var _isHSL = _interopRequireDefault(require("./lib/isHSL"));
  48. var _isISRC = _interopRequireDefault(require("./lib/isISRC"));
  49. var _isIBAN = _interopRequireWildcard(require("./lib/isIBAN"));
  50. var _isBIC = _interopRequireDefault(require("./lib/isBIC"));
  51. var _isMD = _interopRequireDefault(require("./lib/isMD5"));
  52. var _isHash = _interopRequireDefault(require("./lib/isHash"));
  53. var _isJWT = _interopRequireDefault(require("./lib/isJWT"));
  54. var _isJSON = _interopRequireDefault(require("./lib/isJSON"));
  55. var _isEmpty = _interopRequireDefault(require("./lib/isEmpty"));
  56. var _isLength = _interopRequireDefault(require("./lib/isLength"));
  57. var _isByteLength = _interopRequireDefault(require("./lib/isByteLength"));
  58. var _isUUID = _interopRequireDefault(require("./lib/isUUID"));
  59. var _isMongoId = _interopRequireDefault(require("./lib/isMongoId"));
  60. var _isAfter = _interopRequireDefault(require("./lib/isAfter"));
  61. var _isBefore = _interopRequireDefault(require("./lib/isBefore"));
  62. var _isIn = _interopRequireDefault(require("./lib/isIn"));
  63. var _isLuhnNumber = _interopRequireDefault(require("./lib/isLuhnNumber"));
  64. var _isCreditCard = _interopRequireDefault(require("./lib/isCreditCard"));
  65. var _isIdentityCard = _interopRequireDefault(require("./lib/isIdentityCard"));
  66. var _isEAN = _interopRequireDefault(require("./lib/isEAN"));
  67. var _isISIN = _interopRequireDefault(require("./lib/isISIN"));
  68. var _isISBN = _interopRequireDefault(require("./lib/isISBN"));
  69. var _isISSN = _interopRequireDefault(require("./lib/isISSN"));
  70. var _isTaxID = _interopRequireDefault(require("./lib/isTaxID"));
  71. var _isMobilePhone = _interopRequireWildcard(require("./lib/isMobilePhone"));
  72. var _isEthereumAddress = _interopRequireDefault(require("./lib/isEthereumAddress"));
  73. var _isCurrency = _interopRequireDefault(require("./lib/isCurrency"));
  74. var _isBtcAddress = _interopRequireDefault(require("./lib/isBtcAddress"));
  75. var _isISO = require("./lib/isISO6346");
  76. var _isISO2 = _interopRequireDefault(require("./lib/isISO6391"));
  77. var _isISO3 = _interopRequireDefault(require("./lib/isISO8601"));
  78. var _isRFC = _interopRequireDefault(require("./lib/isRFC3339"));
  79. var _isISO31661Alpha = _interopRequireDefault(require("./lib/isISO31661Alpha2"));
  80. var _isISO31661Alpha2 = _interopRequireDefault(require("./lib/isISO31661Alpha3"));
  81. var _isISO4 = _interopRequireDefault(require("./lib/isISO4217"));
  82. var _isBase = _interopRequireDefault(require("./lib/isBase32"));
  83. var _isBase2 = _interopRequireDefault(require("./lib/isBase58"));
  84. var _isBase3 = _interopRequireDefault(require("./lib/isBase64"));
  85. var _isDataURI = _interopRequireDefault(require("./lib/isDataURI"));
  86. var _isMagnetURI = _interopRequireDefault(require("./lib/isMagnetURI"));
  87. var _isMailtoURI = _interopRequireDefault(require("./lib/isMailtoURI"));
  88. var _isMimeType = _interopRequireDefault(require("./lib/isMimeType"));
  89. var _isLatLong = _interopRequireDefault(require("./lib/isLatLong"));
  90. var _isPostalCode = _interopRequireWildcard(require("./lib/isPostalCode"));
  91. var _ltrim = _interopRequireDefault(require("./lib/ltrim"));
  92. var _rtrim = _interopRequireDefault(require("./lib/rtrim"));
  93. var _trim = _interopRequireDefault(require("./lib/trim"));
  94. var _escape = _interopRequireDefault(require("./lib/escape"));
  95. var _unescape = _interopRequireDefault(require("./lib/unescape"));
  96. var _stripLow = _interopRequireDefault(require("./lib/stripLow"));
  97. var _whitelist = _interopRequireDefault(require("./lib/whitelist"));
  98. var _blacklist = _interopRequireDefault(require("./lib/blacklist"));
  99. var _isWhitelisted = _interopRequireDefault(require("./lib/isWhitelisted"));
  100. var _normalizeEmail = _interopRequireDefault(require("./lib/normalizeEmail"));
  101. var _isSlug = _interopRequireDefault(require("./lib/isSlug"));
  102. var _isLicensePlate = _interopRequireDefault(require("./lib/isLicensePlate"));
  103. var _isStrongPassword = _interopRequireDefault(require("./lib/isStrongPassword"));
  104. var _isVAT = _interopRequireDefault(require("./lib/isVAT"));
  105. function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
  106. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
  107. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  108. var version = '13.11.0';
  109. var validator = {
  110. version: version,
  111. toDate: _toDate.default,
  112. toFloat: _toFloat.default,
  113. toInt: _toInt.default,
  114. toBoolean: _toBoolean.default,
  115. equals: _equals.default,
  116. contains: _contains.default,
  117. matches: _matches.default,
  118. isEmail: _isEmail.default,
  119. isURL: _isURL.default,
  120. isMACAddress: _isMACAddress.default,
  121. isIP: _isIP.default,
  122. isIPRange: _isIPRange.default,
  123. isFQDN: _isFQDN.default,
  124. isBoolean: _isBoolean.default,
  125. isIBAN: _isIBAN.default,
  126. isBIC: _isBIC.default,
  127. isAlpha: _isAlpha.default,
  128. isAlphaLocales: _isAlpha.locales,
  129. isAlphanumeric: _isAlphanumeric.default,
  130. isAlphanumericLocales: _isAlphanumeric.locales,
  131. isNumeric: _isNumeric.default,
  132. isPassportNumber: _isPassportNumber.default,
  133. isPort: _isPort.default,
  134. isLowercase: _isLowercase.default,
  135. isUppercase: _isUppercase.default,
  136. isAscii: _isAscii.default,
  137. isFullWidth: _isFullWidth.default,
  138. isHalfWidth: _isHalfWidth.default,
  139. isVariableWidth: _isVariableWidth.default,
  140. isMultibyte: _isMultibyte.default,
  141. isSemVer: _isSemVer.default,
  142. isSurrogatePair: _isSurrogatePair.default,
  143. isInt: _isInt.default,
  144. isIMEI: _isIMEI.default,
  145. isFloat: _isFloat.default,
  146. isFloatLocales: _isFloat.locales,
  147. isDecimal: _isDecimal.default,
  148. isHexadecimal: _isHexadecimal.default,
  149. isOctal: _isOctal.default,
  150. isDivisibleBy: _isDivisibleBy.default,
  151. isHexColor: _isHexColor.default,
  152. isRgbColor: _isRgbColor.default,
  153. isHSL: _isHSL.default,
  154. isISRC: _isISRC.default,
  155. isMD5: _isMD.default,
  156. isHash: _isHash.default,
  157. isJWT: _isJWT.default,
  158. isJSON: _isJSON.default,
  159. isEmpty: _isEmpty.default,
  160. isLength: _isLength.default,
  161. isLocale: _isLocale.default,
  162. isByteLength: _isByteLength.default,
  163. isUUID: _isUUID.default,
  164. isMongoId: _isMongoId.default,
  165. isAfter: _isAfter.default,
  166. isBefore: _isBefore.default,
  167. isIn: _isIn.default,
  168. isLuhnNumber: _isLuhnNumber.default,
  169. isCreditCard: _isCreditCard.default,
  170. isIdentityCard: _isIdentityCard.default,
  171. isEAN: _isEAN.default,
  172. isISIN: _isISIN.default,
  173. isISBN: _isISBN.default,
  174. isISSN: _isISSN.default,
  175. isMobilePhone: _isMobilePhone.default,
  176. isMobilePhoneLocales: _isMobilePhone.locales,
  177. isPostalCode: _isPostalCode.default,
  178. isPostalCodeLocales: _isPostalCode.locales,
  179. isEthereumAddress: _isEthereumAddress.default,
  180. isCurrency: _isCurrency.default,
  181. isBtcAddress: _isBtcAddress.default,
  182. isISO6346: _isISO.isISO6346,
  183. isFreightContainerID: _isISO.isFreightContainerID,
  184. isISO6391: _isISO2.default,
  185. isISO8601: _isISO3.default,
  186. isRFC3339: _isRFC.default,
  187. isISO31661Alpha2: _isISO31661Alpha.default,
  188. isISO31661Alpha3: _isISO31661Alpha2.default,
  189. isISO4217: _isISO4.default,
  190. isBase32: _isBase.default,
  191. isBase58: _isBase2.default,
  192. isBase64: _isBase3.default,
  193. isDataURI: _isDataURI.default,
  194. isMagnetURI: _isMagnetURI.default,
  195. isMailtoURI: _isMailtoURI.default,
  196. isMimeType: _isMimeType.default,
  197. isLatLong: _isLatLong.default,
  198. ltrim: _ltrim.default,
  199. rtrim: _rtrim.default,
  200. trim: _trim.default,
  201. escape: _escape.default,
  202. unescape: _unescape.default,
  203. stripLow: _stripLow.default,
  204. whitelist: _whitelist.default,
  205. blacklist: _blacklist.default,
  206. isWhitelisted: _isWhitelisted.default,
  207. normalizeEmail: _normalizeEmail.default,
  208. toString: toString,
  209. isSlug: _isSlug.default,
  210. isStrongPassword: _isStrongPassword.default,
  211. isTaxID: _isTaxID.default,
  212. isDate: _isDate.default,
  213. isTime: _isTime.default,
  214. isLicensePlate: _isLicensePlate.default,
  215. isVAT: _isVAT.default,
  216. ibanLocales: _isIBAN.locales
  217. };
  218. var _default = validator;
  219. exports.default = _default;
  220. module.exports = exports.default;
  221. module.exports.default = exports.default;