index.mjs 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733
  1. import { unref } from 'vue-demi';
  2. function ownKeys(object, enumerableOnly) {
  3. var keys = Object.keys(object);
  4. if (Object.getOwnPropertySymbols) {
  5. var symbols = Object.getOwnPropertySymbols(object);
  6. enumerableOnly && (symbols = symbols.filter(function (sym) {
  7. return Object.getOwnPropertyDescriptor(object, sym).enumerable;
  8. })), keys.push.apply(keys, symbols);
  9. }
  10. return keys;
  11. }
  12. function _objectSpread2(target) {
  13. for (var i = 1; i < arguments.length; i++) {
  14. var source = null != arguments[i] ? arguments[i] : {};
  15. i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
  16. _defineProperty(target, key, source[key]);
  17. }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
  18. Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
  19. });
  20. }
  21. return target;
  22. }
  23. function _defineProperty(obj, key, value) {
  24. if (key in obj) {
  25. Object.defineProperty(obj, key, {
  26. value: value,
  27. enumerable: true,
  28. configurable: true,
  29. writable: true
  30. });
  31. } else {
  32. obj[key] = value;
  33. }
  34. return obj;
  35. }
  36. function isFunction(val) {
  37. return typeof val === 'function';
  38. }
  39. function isObject(o) {
  40. return o !== null && typeof o === 'object' && !Array.isArray(o);
  41. }
  42. function normalizeValidatorObject(validator) {
  43. return isFunction(validator.$validator) ? _objectSpread2({}, validator) : {
  44. $validator: validator
  45. };
  46. }
  47. function isPromise(object) {
  48. return isObject(object) && isFunction(object.then);
  49. }
  50. function unwrapValidatorResponse(result) {
  51. if (typeof result === 'object') return result.$valid;
  52. return result;
  53. }
  54. function unwrapNormalizedValidator(validator) {
  55. return validator.$validator || validator;
  56. }
  57. function withParams($params, $validator) {
  58. if (!isObject($params)) throw new Error(`[@vuelidate/validators]: First parameter to "withParams" should be an object, provided ${typeof $params}`);
  59. if (!isObject($validator) && !isFunction($validator)) throw new Error(`[@vuelidate/validators]: Validator must be a function or object with $validator parameter`);
  60. const validatorObj = normalizeValidatorObject($validator);
  61. validatorObj.$params = _objectSpread2(_objectSpread2({}, validatorObj.$params || {}), $params);
  62. return validatorObj;
  63. }
  64. function withMessage($message, $validator) {
  65. if (!isFunction($message) && typeof unref($message) !== 'string') throw new Error(`[@vuelidate/validators]: First parameter to "withMessage" should be string or a function returning a string, provided ${typeof $message}`);
  66. if (!isObject($validator) && !isFunction($validator)) throw new Error(`[@vuelidate/validators]: Validator must be a function or object with $validator parameter`);
  67. const validatorObj = normalizeValidatorObject($validator);
  68. validatorObj.$message = $message;
  69. return validatorObj;
  70. }
  71. function withAsync($validator) {
  72. let $watchTargets = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  73. const validatorObj = normalizeValidatorObject($validator);
  74. return _objectSpread2(_objectSpread2({}, validatorObj), {}, {
  75. $async: true,
  76. $watchTargets
  77. });
  78. }
  79. function forEach(validators) {
  80. return {
  81. $validator(collection) {
  82. for (var _len = arguments.length, others = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  83. others[_key - 1] = arguments[_key];
  84. }
  85. return unref(collection).reduce((previous, collectionItem, index) => {
  86. const collectionEntryResult = Object.entries(collectionItem).reduce((all, _ref) => {
  87. let [property, $model] = _ref;
  88. const innerValidators = validators[property] || {};
  89. const propertyResult = Object.entries(innerValidators).reduce((all, _ref2) => {
  90. let [validatorName, currentValidator] = _ref2;
  91. const validatorFunction = unwrapNormalizedValidator(currentValidator);
  92. const $response = validatorFunction.call(this, $model, collectionItem, index, ...others);
  93. const $valid = unwrapValidatorResponse($response);
  94. all.$data[validatorName] = $response;
  95. all.$data.$invalid = !$valid || !!all.$data.$invalid;
  96. all.$data.$error = all.$data.$invalid;
  97. if (!$valid) {
  98. let $message = currentValidator.$message || '';
  99. const $params = currentValidator.$params || {};
  100. if (typeof $message === 'function') {
  101. $message = $message({
  102. $pending: false,
  103. $invalid: !$valid,
  104. $params,
  105. $model,
  106. $response
  107. });
  108. }
  109. all.$errors.push({
  110. $property: property,
  111. $message,
  112. $params,
  113. $response,
  114. $model,
  115. $pending: false,
  116. $validator: validatorName
  117. });
  118. }
  119. return {
  120. $valid: all.$valid && $valid,
  121. $data: all.$data,
  122. $errors: all.$errors
  123. };
  124. }, {
  125. $valid: true,
  126. $data: {},
  127. $errors: []
  128. });
  129. all.$data[property] = propertyResult.$data;
  130. all.$errors[property] = propertyResult.$errors;
  131. return {
  132. $valid: all.$valid && propertyResult.$valid,
  133. $data: all.$data,
  134. $errors: all.$errors
  135. };
  136. }, {
  137. $valid: true,
  138. $data: {},
  139. $errors: {}
  140. });
  141. return {
  142. $valid: previous.$valid && collectionEntryResult.$valid,
  143. $data: previous.$data.concat(collectionEntryResult.$data),
  144. $errors: previous.$errors.concat(collectionEntryResult.$errors)
  145. };
  146. }, {
  147. $valid: true,
  148. $data: [],
  149. $errors: []
  150. });
  151. },
  152. $message: _ref3 => {
  153. let {
  154. $response
  155. } = _ref3;
  156. return $response ? $response.$errors.map(context => {
  157. return Object.values(context).map(errors => errors.map(error => error.$message)).reduce((a, b) => a.concat(b), []);
  158. }) : [];
  159. }
  160. };
  161. }
  162. const req = value => {
  163. value = unref(value);
  164. if (Array.isArray(value)) return !!value.length;
  165. if (value === undefined || value === null) {
  166. return false;
  167. }
  168. if (value === false) {
  169. return true;
  170. }
  171. if (value instanceof Date) {
  172. return !isNaN(value.getTime());
  173. }
  174. if (typeof value === 'object') {
  175. for (let _ in value) return true;
  176. return false;
  177. }
  178. return !!String(value).length;
  179. };
  180. const len = value => {
  181. value = unref(value);
  182. if (Array.isArray(value)) return value.length;
  183. if (typeof value === 'object') {
  184. return Object.keys(value).length;
  185. }
  186. return String(value).length;
  187. };
  188. function regex() {
  189. for (var _len = arguments.length, expr = new Array(_len), _key = 0; _key < _len; _key++) {
  190. expr[_key] = arguments[_key];
  191. }
  192. return value => {
  193. value = unref(value);
  194. return !req(value) || expr.every(reg => {
  195. reg.lastIndex = 0;
  196. return reg.test(value);
  197. });
  198. };
  199. }
  200. var common = /*#__PURE__*/Object.freeze({
  201. __proto__: null,
  202. forEach: forEach,
  203. len: len,
  204. normalizeValidatorObject: normalizeValidatorObject,
  205. regex: regex,
  206. req: req,
  207. unwrap: unref,
  208. unwrapNormalizedValidator: unwrapNormalizedValidator,
  209. unwrapValidatorResponse: unwrapValidatorResponse,
  210. withAsync: withAsync,
  211. withMessage: withMessage,
  212. withParams: withParams
  213. });
  214. var alpha$1 = regex(/^[a-zA-Z]*$/);
  215. var alpha = {
  216. $validator: alpha$1,
  217. $message: 'The value is not alphabetical',
  218. $params: {
  219. type: 'alpha'
  220. }
  221. };
  222. var alphaNum$1 = regex(/^[a-zA-Z0-9]*$/);
  223. var alphaNum = {
  224. $validator: alphaNum$1,
  225. $message: 'The value must be alpha-numeric',
  226. $params: {
  227. type: 'alphaNum'
  228. }
  229. };
  230. var numeric$1 = regex(/^\d*(\.\d+)?$/);
  231. var numeric = {
  232. $validator: numeric$1,
  233. $message: 'Value must be numeric',
  234. $params: {
  235. type: 'numeric'
  236. }
  237. };
  238. function between$1 (min, max) {
  239. return value => !req(value) || (!/\s/.test(value) || value instanceof Date) && +unref(min) <= +value && +unref(max) >= +value;
  240. }
  241. function between (min, max) {
  242. return {
  243. $validator: between$1(min, max),
  244. $message: _ref => {
  245. let {
  246. $params
  247. } = _ref;
  248. return `The value must be between ${$params.min} and ${$params.max}`;
  249. },
  250. $params: {
  251. min,
  252. max,
  253. type: 'between'
  254. }
  255. };
  256. }
  257. const emailRegex = /^(?:[A-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9]{2,}(?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i;
  258. var email$1 = regex(emailRegex);
  259. var email = {
  260. $validator: email$1,
  261. $message: 'Value is not a valid email address',
  262. $params: {
  263. type: 'email'
  264. }
  265. };
  266. function ipAddress$1 (value) {
  267. if (!req(value)) {
  268. return true;
  269. }
  270. if (typeof value !== 'string') {
  271. return false;
  272. }
  273. const nibbles = value.split('.');
  274. return nibbles.length === 4 && nibbles.every(nibbleValid);
  275. }
  276. const nibbleValid = nibble => {
  277. if (nibble.length > 3 || nibble.length === 0) {
  278. return false;
  279. }
  280. if (nibble[0] === '0' && nibble !== '0') {
  281. return false;
  282. }
  283. if (!nibble.match(/^\d+$/)) {
  284. return false;
  285. }
  286. const numeric = +nibble | 0;
  287. return numeric >= 0 && numeric <= 255;
  288. };
  289. var ipAddress = {
  290. $validator: ipAddress$1,
  291. $message: 'The value is not a valid IP address',
  292. $params: {
  293. type: 'ipAddress'
  294. }
  295. };
  296. function macAddress$1 () {
  297. let separator = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ':';
  298. return value => {
  299. separator = unref(separator);
  300. if (!req(value)) {
  301. return true;
  302. }
  303. if (typeof value !== 'string') {
  304. return false;
  305. }
  306. const parts = typeof separator === 'string' && separator !== '' ? value.split(separator) : value.length === 12 || value.length === 16 ? value.match(/.{2}/g) : null;
  307. return parts !== null && (parts.length === 6 || parts.length === 8) && parts.every(hexValid);
  308. };
  309. }
  310. const hexValid = hex => hex.toLowerCase().match(/^[0-9a-f]{2}$/);
  311. function macAddress (separator) {
  312. return {
  313. $validator: macAddress$1(separator),
  314. $message: 'The value is not a valid MAC Address',
  315. $params: {
  316. type: 'macAddress'
  317. }
  318. };
  319. }
  320. function maxLength$1 (length) {
  321. return value => !req(value) || len(value) <= unref(length);
  322. }
  323. function maxLength (max) {
  324. return {
  325. $validator: maxLength$1(max),
  326. $message: _ref => {
  327. let {
  328. $params
  329. } = _ref;
  330. return `The maximum length allowed is ${$params.max}`;
  331. },
  332. $params: {
  333. max,
  334. type: 'maxLength'
  335. }
  336. };
  337. }
  338. function minLength$1 (length) {
  339. return value => !req(value) || len(value) >= unref(length);
  340. }
  341. function minLength (min) {
  342. return {
  343. $validator: minLength$1(min),
  344. $message: _ref => {
  345. let {
  346. $params
  347. } = _ref;
  348. return `This field should be at least ${$params.min} characters long`;
  349. },
  350. $params: {
  351. min,
  352. type: 'minLength'
  353. }
  354. };
  355. }
  356. function required$1 (value) {
  357. if (typeof value === 'string') {
  358. value = value.trim();
  359. }
  360. return req(value);
  361. }
  362. var required = {
  363. $validator: required$1,
  364. $message: 'Value is required',
  365. $params: {
  366. type: 'required'
  367. }
  368. };
  369. const validate$1 = (prop, val) => prop ? req(typeof val === 'string' ? val.trim() : val) : true;
  370. function requiredIf$1(propOrFunction) {
  371. return function (value, parentVM) {
  372. if (typeof propOrFunction !== 'function') {
  373. return validate$1(unref(propOrFunction), value);
  374. }
  375. const result = propOrFunction.call(this, value, parentVM);
  376. return validate$1(result, value);
  377. };
  378. }
  379. function requiredIf (prop) {
  380. return {
  381. $validator: requiredIf$1(prop),
  382. $message: 'The value is required',
  383. $params: {
  384. type: 'requiredIf',
  385. prop
  386. }
  387. };
  388. }
  389. const validate = (prop, val) => !prop ? req(typeof val === 'string' ? val.trim() : val) : true;
  390. function requiredUnless$1(propOrFunction) {
  391. return function (value, parentVM) {
  392. if (typeof propOrFunction !== 'function') {
  393. return validate(unref(propOrFunction), value);
  394. }
  395. const result = propOrFunction.call(this, value, parentVM);
  396. return validate(result, value);
  397. };
  398. }
  399. function requiredUnless (prop) {
  400. return {
  401. $validator: requiredUnless$1(prop),
  402. $message: 'The value is required',
  403. $params: {
  404. type: 'requiredUnless',
  405. prop
  406. }
  407. };
  408. }
  409. function sameAs$1 (equalTo) {
  410. return value => unref(value) === unref(equalTo);
  411. }
  412. function sameAs (equalTo) {
  413. let otherName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'other';
  414. return {
  415. $validator: sameAs$1(equalTo),
  416. $message: _ref => {
  417. return `The value must be equal to the ${otherName} value`;
  418. },
  419. $params: {
  420. equalTo,
  421. otherName,
  422. type: 'sameAs'
  423. }
  424. };
  425. }
  426. const urlRegex = /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i;
  427. var url$1 = regex(urlRegex);
  428. var url = {
  429. $validator: url$1,
  430. $message: 'The value is not a valid URL address',
  431. $params: {
  432. type: 'url'
  433. }
  434. };
  435. function syncOr(validators) {
  436. return function () {
  437. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  438. args[_key] = arguments[_key];
  439. }
  440. return validators.reduce((valid, fn) => {
  441. if (unwrapValidatorResponse(valid)) return valid;
  442. return unwrapNormalizedValidator(fn).apply(this, args);
  443. }, false);
  444. };
  445. }
  446. function asyncOr(validators) {
  447. return function () {
  448. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  449. args[_key2] = arguments[_key2];
  450. }
  451. return validators.reduce(async (valid, fn) => {
  452. const r = await valid;
  453. if (unwrapValidatorResponse(r)) return r;
  454. return unwrapNormalizedValidator(fn).apply(this, args);
  455. }, Promise.resolve(false));
  456. };
  457. }
  458. function or$1() {
  459. for (var _len3 = arguments.length, validators = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  460. validators[_key3] = arguments[_key3];
  461. }
  462. const $async = validators.some(v => v.$async);
  463. const $watchTargets = validators.reduce((all, v) => {
  464. if (!v.$watchTargets) return all;
  465. return all.concat(v.$watchTargets);
  466. }, []);
  467. let $validator = () => false;
  468. if (validators.length) $validator = $async ? asyncOr(validators) : syncOr(validators);
  469. return {
  470. $async,
  471. $validator,
  472. $watchTargets
  473. };
  474. }
  475. function or () {
  476. return withParams({
  477. type: 'or'
  478. }, withMessage('The value does not match any of the provided validators', or$1(...arguments)));
  479. }
  480. function syncAnd(validators) {
  481. return function () {
  482. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  483. args[_key] = arguments[_key];
  484. }
  485. return validators.reduce((valid, fn) => {
  486. if (!unwrapValidatorResponse(valid)) return valid;
  487. return unwrapNormalizedValidator(fn).apply(this, args);
  488. }, true);
  489. };
  490. }
  491. function asyncAnd(validators) {
  492. return function () {
  493. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  494. args[_key2] = arguments[_key2];
  495. }
  496. return validators.reduce(async (valid, fn) => {
  497. const r = await valid;
  498. if (!unwrapValidatorResponse(r)) return r;
  499. return unwrapNormalizedValidator(fn).apply(this, args);
  500. }, Promise.resolve(true));
  501. };
  502. }
  503. function and$1() {
  504. for (var _len3 = arguments.length, validators = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  505. validators[_key3] = arguments[_key3];
  506. }
  507. const $async = validators.some(v => v.$async);
  508. const $watchTargets = validators.reduce((all, v) => {
  509. if (!v.$watchTargets) return all;
  510. return all.concat(v.$watchTargets);
  511. }, []);
  512. let $validator = () => false;
  513. if (validators.length) $validator = $async ? asyncAnd(validators) : syncAnd(validators);
  514. return {
  515. $async,
  516. $validator,
  517. $watchTargets
  518. };
  519. }
  520. function and () {
  521. return withParams({
  522. type: 'and'
  523. }, withMessage('The value does not match all of the provided validators', and$1(...arguments)));
  524. }
  525. function not$1 (validator) {
  526. return function (value, vm) {
  527. if (!req(value)) return true;
  528. const response = unwrapNormalizedValidator(validator).call(this, value, vm);
  529. if (!isPromise(response)) return !unwrapValidatorResponse(response);
  530. return response.then(r => !unwrapValidatorResponse(r));
  531. };
  532. }
  533. function not (validator) {
  534. return {
  535. $validator: not$1(validator),
  536. $message: `The value does not match the provided validator`,
  537. $params: {
  538. type: 'not'
  539. }
  540. };
  541. }
  542. function minValue$1 (min) {
  543. return value => !req(value) || (!/\s/.test(value) || value instanceof Date) && +value >= +unref(min);
  544. }
  545. function minValue (min) {
  546. return {
  547. $validator: minValue$1(min),
  548. $message: _ref => {
  549. let {
  550. $params
  551. } = _ref;
  552. return `The minimum value allowed is ${$params.min}`;
  553. },
  554. $params: {
  555. min,
  556. type: 'minValue'
  557. }
  558. };
  559. }
  560. function maxValue$1 (max) {
  561. return value => !req(value) || (!/\s/.test(value) || value instanceof Date) && +value <= +unref(max);
  562. }
  563. var maxValue = (max => ({
  564. $validator: maxValue$1(max),
  565. $message: _ref => {
  566. let {
  567. $params
  568. } = _ref;
  569. return `The maximum value allowed is ${$params.max}`;
  570. },
  571. $params: {
  572. max,
  573. type: 'maxValue'
  574. }
  575. }));
  576. var integer$1 = regex(/(^[0-9]*$)|(^-[0-9]+$)/);
  577. var integer = {
  578. $validator: integer$1,
  579. $message: 'Value is not an integer',
  580. $params: {
  581. type: 'integer'
  582. }
  583. };
  584. var decimal$1 = regex(/^[-]?\d*(\.\d+)?$/);
  585. var decimal = {
  586. $validator: decimal$1,
  587. $message: 'Value must be decimal',
  588. $params: {
  589. type: 'decimal'
  590. }
  591. };
  592. function createI18nMessage(_ref) {
  593. let {
  594. t,
  595. messagePath = _ref2 => {
  596. let {
  597. $validator
  598. } = _ref2;
  599. return `validations.${$validator}`;
  600. },
  601. messageParams = params => params
  602. } = _ref;
  603. return function withI18nMessage(validator) {
  604. let {
  605. withArguments = false,
  606. messagePath: localMessagePath = messagePath,
  607. messageParams: localMessageParams = messageParams
  608. } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  609. function message(props) {
  610. return t(localMessagePath(props), localMessageParams(_objectSpread2({
  611. model: props.$model,
  612. property: props.$property,
  613. pending: props.$pending,
  614. invalid: props.$invalid,
  615. response: props.$response,
  616. validator: props.$validator,
  617. propertyPath: props.$propertyPath
  618. }, props.$params)));
  619. }
  620. if (withArguments && typeof validator === 'function') {
  621. return function () {
  622. return withMessage(message, validator(...arguments));
  623. };
  624. }
  625. return withMessage(message, validator);
  626. };
  627. }
  628. export { alpha, alphaNum, and, between, createI18nMessage, decimal, email, common as helpers, integer, ipAddress, macAddress, maxLength, maxValue, minLength, minValue, not, numeric, or, required, requiredIf, requiredUnless, sameAs, url };