vee-validate 2.2.11 → 2.2.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/dist/locale/ar.js +1 -1
  2. package/dist/locale/az.js +1 -1
  3. package/dist/locale/bg.js +1 -1
  4. package/dist/locale/ca.js +1 -1
  5. package/dist/locale/cs.js +1 -1
  6. package/dist/locale/da.js +1 -1
  7. package/dist/locale/de.js +1 -1
  8. package/dist/locale/el.js +1 -1
  9. package/dist/locale/en.js +1 -1
  10. package/dist/locale/es.js +1 -1
  11. package/dist/locale/et.js +1 -1
  12. package/dist/locale/eu.js +1 -1
  13. package/dist/locale/fa.js +1 -1
  14. package/dist/locale/fi.js +1 -1
  15. package/dist/locale/fr.js +1 -1
  16. package/dist/locale/he.js +1 -1
  17. package/dist/locale/hi.js +1 -1
  18. package/dist/locale/hr.js +1 -1
  19. package/dist/locale/hu.js +1 -1
  20. package/dist/locale/id.js +1 -1
  21. package/dist/locale/it.js +1 -1
  22. package/dist/locale/ja.js +1 -1
  23. package/dist/locale/ka.js +1 -1
  24. package/dist/locale/ko.js +1 -1
  25. package/dist/locale/lt.js +1 -1
  26. package/dist/locale/lv.js +1 -1
  27. package/dist/locale/mn.js +1 -1
  28. package/dist/locale/ms_MY.js +1 -1
  29. package/dist/locale/nb_NO.js +1 -1
  30. package/dist/locale/ne.js +1 -1
  31. package/dist/locale/nl.js +1 -1
  32. package/dist/locale/nn_NO.js +1 -1
  33. package/dist/locale/pl.js +1 -1
  34. package/dist/locale/pt_BR.js +1 -1
  35. package/dist/locale/pt_PT.js +1 -1
  36. package/dist/locale/ro.js +1 -1
  37. package/dist/locale/ru.js +1 -1
  38. package/dist/locale/sk.js +1 -1
  39. package/dist/locale/sl.js +1 -1
  40. package/dist/locale/sq.js +1 -1
  41. package/dist/locale/sr.js +1 -1
  42. package/dist/locale/sr_Latin.js +1 -1
  43. package/dist/locale/sv.js +1 -1
  44. package/dist/locale/tr.js +1 -1
  45. package/dist/locale/uk.js +1 -1
  46. package/dist/locale/vi.js +1 -1
  47. package/dist/locale/zh_TW.js +1 -1
  48. package/dist/rules.esm.js +154 -152
  49. package/dist/vee-validate.esm.js +203 -200
  50. package/dist/vee-validate.js +204 -201
  51. package/dist/vee-validate.min.js +1 -1
  52. package/dist/vee-validate.minimal.esm.js +14 -15
  53. package/dist/vee-validate.minimal.js +14 -15
  54. package/dist/vee-validate.minimal.min.js +1 -1
  55. package/package.json +15 -15
  56. package/types/vee-validate.d.ts +1 -0
package/dist/rules.esm.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vee-validate v2.2.11
2
+ * vee-validate v2.2.15
3
3
  * (c) 2019 Abdelrahman Awad
4
4
  * @license MIT
5
5
  */
@@ -410,7 +410,7 @@ function parseTimezone (timezoneString) {
410
410
  if (token) {
411
411
  hours = parseInt(token[2], 10);
412
412
 
413
- if (!validateTimezone(hours)) {
413
+ if (!validateTimezone()) {
414
414
  return NaN
415
415
  }
416
416
 
@@ -2086,7 +2086,7 @@ function dateTimeLongFormatter (pattern, formatLong, options) {
2086
2086
  var timePattern = matchResult[2];
2087
2087
 
2088
2088
  if (!timePattern) {
2089
- return dateLongFormatter(pattern, formatLong, options)
2089
+ return dateLongFormatter(pattern, formatLong)
2090
2090
  }
2091
2091
 
2092
2092
  var dateTimeFormat;
@@ -2108,8 +2108,8 @@ function dateTimeLongFormatter (pattern, formatLong, options) {
2108
2108
  }
2109
2109
 
2110
2110
  return dateTimeFormat
2111
- .replace('{{date}}', dateLongFormatter(datePattern, formatLong, options))
2112
- .replace('{{time}}', timeLongFormatter(timePattern, formatLong, options))
2111
+ .replace('{{date}}', dateLongFormatter(datePattern, formatLong))
2112
+ .replace('{{time}}', timeLongFormatter(timePattern, formatLong))
2113
2113
  }
2114
2114
 
2115
2115
  var longFormatters = {
@@ -2645,40 +2645,6 @@ function isBefore (dirtyDate, dirtyDateToCompare, dirtyOptions) {
2645
2645
  return date.getTime() < dateToCompare.getTime()
2646
2646
  }
2647
2647
 
2648
- /**
2649
- * @name isDate
2650
- * @category Common Helpers
2651
- * @summary Is the given value a date?
2652
- *
2653
- * @description
2654
- * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
2655
- *
2656
- * @param {*} value - the value to check
2657
- * @param {Options} [options] - the object with options. Unused; present for FP submodule compatibility sake. See [Options]{@link https://date-fns.org/docs/Options}
2658
- * @returns {boolean} true if the given value is a date
2659
- * @throws {TypeError} 1 arguments required
2660
- *
2661
- * @example
2662
- * // For a valid date:
2663
- * var result = isDate(new Date())
2664
- * //=> true
2665
- *
2666
- * @example
2667
- * // For an invalid date:
2668
- * var result = isDate(new Date(NaN))
2669
- * //=> true
2670
- *
2671
- * @example
2672
- * // For some value:
2673
- * var result = isDate('2014-02-31')
2674
- * //=> false
2675
- *
2676
- * @example
2677
- * // For an object:
2678
- * var result = isDate({})
2679
- * //=> false
2680
- */
2681
-
2682
2648
  /**
2683
2649
  * @name isEqual
2684
2650
  * @category Common Helpers
@@ -4401,8 +4367,6 @@ function cleanEscapedString$1(input) {
4401
4367
  return input.match(escapedStringRegExp$1)[1].replace(doubleQuoteRegExp$1, "'")
4402
4368
  }
4403
4369
 
4404
- // This file is generated automatically by `scripts/build/indices.js`. Please, don't change it.
4405
-
4406
4370
  //
4407
4371
 
4408
4372
  /**
@@ -4471,6 +4435,7 @@ var alpha = {
4471
4435
  da: /^[A-ZÆØÅ]*$/i,
4472
4436
  de: /^[A-ZÄÖÜß]*$/i,
4473
4437
  es: /^[A-ZÁÉÍÑÓÚÜ]*$/i,
4438
+ fa: /^[ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰپژگچکی]*$/,
4474
4439
  fr: /^[A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]*$/i,
4475
4440
  it: /^[A-Z\xC0-\xFF]*$/i,
4476
4441
  lt: /^[A-ZĄČĘĖĮŠŲŪŽ]*$/i,
@@ -4494,6 +4459,7 @@ var alphaSpaces = {
4494
4459
  da: /^[A-ZÆØÅ\s]*$/i,
4495
4460
  de: /^[A-ZÄÖÜß\s]*$/i,
4496
4461
  es: /^[A-ZÁÉÍÑÓÚÜ\s]*$/i,
4462
+ fa: /^[ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰپژگچکی\s]*$/,
4497
4463
  fr: /^[A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ\s]*$/i,
4498
4464
  it: /^[A-Z\xC0-\xFF\s]*$/i,
4499
4465
  lt: /^[A-ZĄČĘĖĮŠŲŪŽ\s]*$/i,
@@ -4517,6 +4483,7 @@ var alphanumeric = {
4517
4483
  da: /^[0-9A-ZÆØÅ]$/i,
4518
4484
  de: /^[0-9A-ZÄÖÜß]*$/i,
4519
4485
  es: /^[0-9A-ZÁÉÍÑÓÚÜ]*$/i,
4486
+ fa: /^[٠١٢٣٤٥٦٧٨٩0-9ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰپژگچکی]*$/,
4520
4487
  fr: /^[0-9A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]*$/i,
4521
4488
  it: /^[0-9A-Z\xC0-\xFF]*$/i,
4522
4489
  lt: /^[0-9A-ZĄČĘĖĮŠŲŪŽ]*$/i,
@@ -4540,6 +4507,7 @@ var alphaDash = {
4540
4507
  da: /^[0-9A-ZÆØÅ_-]*$/i,
4541
4508
  de: /^[0-9A-ZÄÖÜß_-]*$/i,
4542
4509
  es: /^[0-9A-ZÁÉÍÑÓÚÜ_-]*$/i,
4510
+ fa: /^[٠١٢٣٤٥٦٧٨٩0-9ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰپژگچکی_-]*$/,
4543
4511
  fr: /^[0-9A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ_-]*$/i,
4544
4512
  it: /^[0-9A-Z\xC0-\xFF_-]*$/i,
4545
4513
  lt: /^[0-9A-ZĄČĘĖĮŠŲŪŽ_-]*$/i,
@@ -4733,29 +4701,34 @@ var assertString_1 = createCommonjsModule(function (module, exports) {
4733
4701
  Object.defineProperty(exports, "__esModule", {
4734
4702
  value: true
4735
4703
  });
4704
+ exports.default = assertString;
4736
4705
 
4737
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
4706
+ function _typeof(obj) { 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); }
4738
4707
 
4739
- exports.default = assertString;
4740
4708
  function assertString(input) {
4741
4709
  var isString = typeof input === 'string' || input instanceof String;
4742
4710
 
4743
4711
  if (!isString) {
4744
- var invalidType = void 0;
4712
+ var invalidType;
4713
+
4745
4714
  if (input === null) {
4746
4715
  invalidType = 'null';
4747
4716
  } else {
4748
- invalidType = typeof input === 'undefined' ? 'undefined' : _typeof(input);
4717
+ invalidType = _typeof(input);
4718
+
4749
4719
  if (invalidType === 'object' && input.constructor && input.constructor.hasOwnProperty('name')) {
4750
4720
  invalidType = input.constructor.name;
4751
4721
  } else {
4752
- invalidType = 'a ' + invalidType;
4722
+ invalidType = "a ".concat(invalidType);
4753
4723
  }
4754
4724
  }
4755
- throw new TypeError('Expected string but received ' + invalidType + '.');
4725
+
4726
+ throw new TypeError("Expected string but received ".concat(invalidType, "."));
4756
4727
  }
4757
4728
  }
4758
- module.exports = exports['default'];
4729
+
4730
+ module.exports = exports.default;
4731
+ module.exports.default = exports.default;
4759
4732
  });
4760
4733
 
4761
4734
  unwrapExports(assertString_1);
@@ -4767,9 +4740,7 @@ Object.defineProperty(exports, "__esModule", {
4767
4740
  });
4768
4741
  exports.default = isCreditCard;
4769
4742
 
4770
-
4771
-
4772
- var _assertString2 = _interopRequireDefault(assertString_1);
4743
+ var _assertString = _interopRequireDefault(assertString_1);
4773
4744
 
4774
4745
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
4775
4746
 
@@ -4778,20 +4749,25 @@ var creditCard = /^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|(222[1-9]|22[3-9][
4778
4749
  /* eslint-enable max-len */
4779
4750
 
4780
4751
  function isCreditCard(str) {
4781
- (0, _assertString2.default)(str);
4752
+ (0, _assertString.default)(str);
4782
4753
  var sanitized = str.replace(/[- ]+/g, '');
4754
+
4783
4755
  if (!creditCard.test(sanitized)) {
4784
4756
  return false;
4785
4757
  }
4758
+
4786
4759
  var sum = 0;
4787
- var digit = void 0;
4788
- var tmpNum = void 0;
4789
- var shouldDouble = void 0;
4760
+ var digit;
4761
+ var tmpNum;
4762
+ var shouldDouble;
4763
+
4790
4764
  for (var i = sanitized.length - 1; i >= 0; i--) {
4791
4765
  digit = sanitized.substring(i, i + 1);
4792
4766
  tmpNum = parseInt(digit, 10);
4767
+
4793
4768
  if (shouldDouble) {
4794
4769
  tmpNum *= 2;
4770
+
4795
4771
  if (tmpNum >= 10) {
4796
4772
  sum += tmpNum % 10 + 1;
4797
4773
  } else {
@@ -4800,11 +4776,15 @@ function isCreditCard(str) {
4800
4776
  } else {
4801
4777
  sum += tmpNum;
4802
4778
  }
4779
+
4803
4780
  shouldDouble = !shouldDouble;
4804
4781
  }
4782
+
4805
4783
  return !!(sum % 10 === 0 ? sanitized : false);
4806
4784
  }
4807
- module.exports = exports['default'];
4785
+
4786
+ module.exports = exports.default;
4787
+ module.exports.default = exports.default;
4808
4788
  });
4809
4789
 
4810
4790
  var isCreditCard = unwrapExports(isCreditCard_1);
@@ -5055,18 +5035,22 @@ Object.defineProperty(exports, "__esModule", {
5055
5035
  value: true
5056
5036
  });
5057
5037
  exports.default = merge;
5038
+
5058
5039
  function merge() {
5059
5040
  var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5060
- var defaults = arguments[1];
5041
+ var defaults = arguments.length > 1 ? arguments[1] : undefined;
5061
5042
 
5062
5043
  for (var key in defaults) {
5063
5044
  if (typeof obj[key] === 'undefined') {
5064
5045
  obj[key] = defaults[key];
5065
5046
  }
5066
5047
  }
5048
+
5067
5049
  return obj;
5068
5050
  }
5069
- module.exports = exports['default'];
5051
+
5052
+ module.exports = exports.default;
5053
+ module.exports.default = exports.default;
5070
5054
  });
5071
5055
 
5072
5056
  unwrapExports(merge_1);
@@ -5076,23 +5060,21 @@ var isByteLength_1 = createCommonjsModule(function (module, exports) {
5076
5060
  Object.defineProperty(exports, "__esModule", {
5077
5061
  value: true
5078
5062
  });
5079
-
5080
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
5081
-
5082
5063
  exports.default = isByteLength;
5083
5064
 
5084
-
5085
-
5086
- var _assertString2 = _interopRequireDefault(assertString_1);
5065
+ var _assertString = _interopRequireDefault(assertString_1);
5087
5066
 
5088
5067
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
5089
5068
 
5069
+ function _typeof(obj) { 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); }
5070
+
5090
5071
  /* eslint-disable prefer-rest-params */
5091
5072
  function isByteLength(str, options) {
5092
- (0, _assertString2.default)(str);
5093
- var min = void 0;
5094
- var max = void 0;
5095
- if ((typeof options === 'undefined' ? 'undefined' : _typeof(options)) === 'object') {
5073
+ (0, _assertString.default)(str);
5074
+ var min;
5075
+ var max;
5076
+
5077
+ if (_typeof(options) === 'object') {
5096
5078
  min = options.min || 0;
5097
5079
  max = options.max;
5098
5080
  } else {
@@ -5100,10 +5082,13 @@ function isByteLength(str, options) {
5100
5082
  min = arguments[1];
5101
5083
  max = arguments[2];
5102
5084
  }
5085
+
5103
5086
  var len = encodeURI(str).split(/%..|./).length - 1;
5104
5087
  return len >= min && (typeof max === 'undefined' || len <= max);
5105
5088
  }
5106
- module.exports = exports['default'];
5089
+
5090
+ module.exports = exports.default;
5091
+ module.exports.default = exports.default;
5107
5092
  });
5108
5093
 
5109
5094
  unwrapExports(isByteLength_1);
@@ -5115,13 +5100,9 @@ Object.defineProperty(exports, "__esModule", {
5115
5100
  });
5116
5101
  exports.default = isFQDN;
5117
5102
 
5103
+ var _assertString = _interopRequireDefault(assertString_1);
5118
5104
 
5119
-
5120
- var _assertString2 = _interopRequireDefault(assertString_1);
5121
-
5122
-
5123
-
5124
- var _merge2 = _interopRequireDefault(merge_1);
5105
+ var _merge = _interopRequireDefault(merge_1);
5125
5106
 
5126
5107
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
5127
5108
 
@@ -5132,48 +5113,61 @@ var default_fqdn_options = {
5132
5113
  };
5133
5114
 
5134
5115
  function isFQDN(str, options) {
5135
- (0, _assertString2.default)(str);
5136
- options = (0, _merge2.default)(options, default_fqdn_options);
5137
-
5116
+ (0, _assertString.default)(str);
5117
+ options = (0, _merge.default)(options, default_fqdn_options);
5138
5118
  /* Remove the optional trailing dot before checking validity */
5119
+
5139
5120
  if (options.allow_trailing_dot && str[str.length - 1] === '.') {
5140
5121
  str = str.substring(0, str.length - 1);
5141
5122
  }
5123
+
5142
5124
  var parts = str.split('.');
5125
+
5143
5126
  for (var i = 0; i < parts.length; i++) {
5144
5127
  if (parts[i].length > 63) {
5145
5128
  return false;
5146
5129
  }
5147
5130
  }
5131
+
5148
5132
  if (options.require_tld) {
5149
5133
  var tld = parts.pop();
5134
+
5150
5135
  if (!parts.length || !/^([a-z\u00a1-\uffff]{2,}|xn[a-z0-9-]{2,})$/i.test(tld)) {
5151
5136
  return false;
5152
- }
5153
- // disallow spaces
5137
+ } // disallow spaces
5138
+
5139
+
5154
5140
  if (/[\s\u2002-\u200B\u202F\u205F\u3000\uFEFF\uDB40\uDC20]/.test(tld)) {
5155
5141
  return false;
5156
5142
  }
5157
5143
  }
5144
+
5158
5145
  for (var part, _i = 0; _i < parts.length; _i++) {
5159
5146
  part = parts[_i];
5147
+
5160
5148
  if (options.allow_underscores) {
5161
5149
  part = part.replace(/_/g, '');
5162
5150
  }
5151
+
5163
5152
  if (!/^[a-z\u00a1-\uffff0-9-]+$/i.test(part)) {
5164
5153
  return false;
5165
- }
5166
- // disallow full-width chars
5154
+ } // disallow full-width chars
5155
+
5156
+
5167
5157
  if (/[\uff01-\uff5e]/.test(part)) {
5168
5158
  return false;
5169
5159
  }
5160
+
5170
5161
  if (part[0] === '-' || part[part.length - 1] === '-') {
5171
5162
  return false;
5172
5163
  }
5173
5164
  }
5165
+
5174
5166
  return true;
5175
5167
  }
5176
- module.exports = exports['default'];
5168
+
5169
+ module.exports = exports.default;
5170
+ module.exports.default = exports.default;
5177
5171
  });
5178
5172
 
5179
5173
  var isFQDN = unwrapExports(isFQDN_1);
@@ -5185,9 +5179,7 @@ Object.defineProperty(exports, "__esModule", {
5185
5179
  });
5186
5180
  exports.default = isIP;
5187
5181
 
5188
-
5189
-
5190
- var _assertString2 = _interopRequireDefault(assertString_1);
5182
+ var _assertString = _interopRequireDefault(assertString_1);
5191
5183
 
5192
5184
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
5193
5185
 
@@ -5196,15 +5188,16 @@ var ipv6Block = /^[0-9A-F]{1,4}$/i;
5196
5188
 
5197
5189
  function isIP(str) {
5198
5190
  var version = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
5199
-
5200
- (0, _assertString2.default)(str);
5191
+ (0, _assertString.default)(str);
5201
5192
  version = String(version);
5193
+
5202
5194
  if (!version) {
5203
5195
  return isIP(str, 4) || isIP(str, 6);
5204
5196
  } else if (version === '4') {
5205
5197
  if (!ipv4Maybe.test(str)) {
5206
5198
  return false;
5207
5199
  }
5200
+
5208
5201
  var parts = str.split('.').sort(function (a, b) {
5209
5202
  return a - b;
5210
5203
  });
@@ -5212,18 +5205,19 @@ function isIP(str) {
5212
5205
  } else if (version === '6') {
5213
5206
  var blocks = str.split(':');
5214
5207
  var foundOmissionBlock = false; // marker to indicate ::
5215
-
5216
5208
  // At least some OS accept the last 32 bits of an IPv6 address
5217
5209
  // (i.e. 2 of the blocks) in IPv4 notation, and RFC 3493 says
5218
5210
  // that '::ffff:a.b.c.d' is valid for IPv4-mapped IPv6 addresses,
5219
5211
  // and '::a.b.c.d' is deprecated, but also valid.
5212
+
5220
5213
  var foundIPv4TransitionBlock = isIP(blocks[blocks.length - 1], 4);
5221
5214
  var expectedNumberOfBlocks = foundIPv4TransitionBlock ? 7 : 8;
5222
5215
 
5223
5216
  if (blocks.length > expectedNumberOfBlocks) {
5224
5217
  return false;
5225
- }
5226
- // initial or final ::
5218
+ } // initial or final ::
5219
+
5220
+
5227
5221
  if (str === '::') {
5228
5222
  return true;
5229
5223
  } else if (str.substr(0, 2) === '::') {
@@ -5243,19 +5237,25 @@ function isIP(str) {
5243
5237
  if (foundOmissionBlock) {
5244
5238
  return false; // multiple :: in address
5245
5239
  }
5240
+
5246
5241
  foundOmissionBlock = true;
5247
5242
  } else if (foundIPv4TransitionBlock && i === blocks.length - 1) ; else if (!ipv6Block.test(blocks[i])) {
5248
5243
  return false;
5249
5244
  }
5250
5245
  }
5246
+
5251
5247
  if (foundOmissionBlock) {
5252
5248
  return blocks.length >= 1;
5253
5249
  }
5250
+
5254
5251
  return blocks.length === expectedNumberOfBlocks;
5255
5252
  }
5253
+
5256
5254
  return false;
5257
5255
  }
5258
- module.exports = exports['default'];
5256
+
5257
+ module.exports = exports.default;
5258
+ module.exports.default = exports.default;
5259
5259
  });
5260
5260
 
5261
5261
  var isIP = unwrapExports(isIP_1);
@@ -5267,25 +5267,15 @@ Object.defineProperty(exports, "__esModule", {
5267
5267
  });
5268
5268
  exports.default = isEmail;
5269
5269
 
5270
+ var _assertString = _interopRequireDefault(assertString_1);
5270
5271
 
5272
+ var _merge = _interopRequireDefault(merge_1);
5271
5273
 
5272
- var _assertString2 = _interopRequireDefault(assertString_1);
5273
-
5274
+ var _isByteLength = _interopRequireDefault(isByteLength_1);
5274
5275
 
5276
+ var _isFQDN = _interopRequireDefault(isFQDN_1);
5275
5277
 
5276
- var _merge2 = _interopRequireDefault(merge_1);
5277
-
5278
-
5279
-
5280
- var _isByteLength2 = _interopRequireDefault(isByteLength_1);
5281
-
5282
-
5283
-
5284
- var _isFQDN2 = _interopRequireDefault(isFQDN_1);
5285
-
5286
-
5287
-
5288
- var _isIP2 = _interopRequireDefault(isIP_1);
5278
+ var _isIP = _interopRequireDefault(isIP_1);
5289
5279
 
5290
5280
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
5291
5281
 
@@ -5295,9 +5285,10 @@ var default_email_options = {
5295
5285
  allow_utf8_local_part: true,
5296
5286
  require_tld: true
5297
5287
  };
5298
-
5299
5288
  /* eslint-disable max-len */
5289
+
5300
5290
  /* eslint-disable no-control-regex */
5291
+
5301
5292
  var displayName = /^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\.\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\,\.\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF\s]*<(.+)>$/i;
5302
5293
  var emailUserPart = /^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i;
5303
5294
  var gmailUserPart = /^[a-z\d]+$/;
@@ -5305,14 +5296,16 @@ var quotedEmailUser = /^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e
5305
5296
  var emailUserUtf8Part = /^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i;
5306
5297
  var quotedEmailUserUtf8 = /^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i;
5307
5298
  /* eslint-enable max-len */
5299
+
5308
5300
  /* eslint-enable no-control-regex */
5309
5301
 
5310
5302
  function isEmail(str, options) {
5311
- (0, _assertString2.default)(str);
5312
- options = (0, _merge2.default)(options, default_email_options);
5303
+ (0, _assertString.default)(str);
5304
+ options = (0, _merge.default)(options, default_email_options);
5313
5305
 
5314
5306
  if (options.require_display_name || options.allow_display_name) {
5315
5307
  var display_email = str.match(displayName);
5308
+
5316
5309
  if (display_email) {
5317
5310
  str = display_email[1];
5318
5311
  } else if (options.require_display_name) {
@@ -5323,7 +5316,6 @@ function isEmail(str, options) {
5323
5316
  var parts = str.split('@');
5324
5317
  var domain = parts.pop();
5325
5318
  var user = parts.join('@');
5326
-
5327
5319
  var lower_domain = domain.toLowerCase();
5328
5320
 
5329
5321
  if (options.domain_specific_validation && (lower_domain === 'gmail.com' || lower_domain === 'googlemail.com')) {
@@ -5334,17 +5326,19 @@ function isEmail(str, options) {
5334
5326
  Gmail only normalizes single dots, removing them from here is pointless,
5335
5327
  should be done in normalizeEmail
5336
5328
  */
5337
- user = user.toLowerCase();
5329
+ user = user.toLowerCase(); // Removing sub-address from username before gmail validation
5338
5330
 
5339
- // Removing sub-address from username before gmail validation
5340
- var username = user.split('+')[0];
5331
+ var username = user.split('+')[0]; // Dots are not included in gmail length restriction
5341
5332
 
5342
- // Dots are not included in gmail length restriction
5343
- if (!(0, _isByteLength2.default)(username.replace('.', ''), { min: 6, max: 30 })) {
5333
+ if (!(0, _isByteLength.default)(username.replace('.', ''), {
5334
+ min: 6,
5335
+ max: 30
5336
+ })) {
5344
5337
  return false;
5345
5338
  }
5346
5339
 
5347
5340
  var _user_parts = username.split('.');
5341
+
5348
5342
  for (var i = 0; i < _user_parts.length; i++) {
5349
5343
  if (!gmailUserPart.test(_user_parts[i])) {
5350
5344
  return false;
@@ -5352,23 +5346,29 @@ function isEmail(str, options) {
5352
5346
  }
5353
5347
  }
5354
5348
 
5355
- if (!(0, _isByteLength2.default)(user, { max: 64 }) || !(0, _isByteLength2.default)(domain, { max: 254 })) {
5349
+ if (!(0, _isByteLength.default)(user, {
5350
+ max: 64
5351
+ }) || !(0, _isByteLength.default)(domain, {
5352
+ max: 254
5353
+ })) {
5356
5354
  return false;
5357
5355
  }
5358
5356
 
5359
- if (!(0, _isFQDN2.default)(domain, { require_tld: options.require_tld })) {
5357
+ if (!(0, _isFQDN.default)(domain, {
5358
+ require_tld: options.require_tld
5359
+ })) {
5360
5360
  if (!options.allow_ip_domain) {
5361
5361
  return false;
5362
5362
  }
5363
5363
 
5364
- if (!(0, _isIP2.default)(domain)) {
5364
+ if (!(0, _isIP.default)(domain)) {
5365
5365
  if (!domain.startsWith('[') || !domain.endsWith(']')) {
5366
5366
  return false;
5367
5367
  }
5368
5368
 
5369
5369
  var noBracketdomain = domain.substr(1, domain.length - 2);
5370
5370
 
5371
- if (noBracketdomain.length === 0 || !(0, _isIP2.default)(noBracketdomain)) {
5371
+ if (noBracketdomain.length === 0 || !(0, _isIP.default)(noBracketdomain)) {
5372
5372
  return false;
5373
5373
  }
5374
5374
  }
@@ -5380,8 +5380,8 @@ function isEmail(str, options) {
5380
5380
  }
5381
5381
 
5382
5382
  var pattern = options.allow_utf8_local_part ? emailUserUtf8Part : emailUserPart;
5383
-
5384
5383
  var user_parts = user.split('.');
5384
+
5385
5385
  for (var _i = 0; _i < user_parts.length; _i++) {
5386
5386
  if (!pattern.test(user_parts[_i])) {
5387
5387
  return false;
@@ -5390,7 +5390,9 @@ function isEmail(str, options) {
5390
5390
 
5391
5391
  return true;
5392
5392
  }
5393
- module.exports = exports['default'];
5393
+
5394
+ module.exports = exports.default;
5395
+ module.exports.default = exports.default;
5394
5396
  });
5395
5397
 
5396
5398
  var isEmail = unwrapExports(isEmail_1);
@@ -5775,21 +5777,13 @@ Object.defineProperty(exports, "__esModule", {
5775
5777
  });
5776
5778
  exports.default = isURL;
5777
5779
 
5780
+ var _assertString = _interopRequireDefault(assertString_1);
5778
5781
 
5782
+ var _isFQDN = _interopRequireDefault(isFQDN_1);
5779
5783
 
5780
- var _assertString2 = _interopRequireDefault(assertString_1);
5781
-
5782
-
5783
-
5784
- var _isFQDN2 = _interopRequireDefault(isFQDN_1);
5785
-
5786
-
5787
-
5788
- var _isIP2 = _interopRequireDefault(isIP_1);
5789
-
5784
+ var _isIP = _interopRequireDefault(isIP_1);
5790
5785
 
5791
-
5792
- var _merge2 = _interopRequireDefault(merge_1);
5786
+ var _merge = _interopRequireDefault(merge_1);
5793
5787
 
5794
5788
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
5795
5789
 
@@ -5803,7 +5797,6 @@ var default_url_options = {
5803
5797
  allow_trailing_dot: false,
5804
5798
  allow_protocol_relative_urls: false
5805
5799
  };
5806
-
5807
5800
  var wrapped_ipv6 = /^\[([^\]]+)\](?::([0-9]+))?$/;
5808
5801
 
5809
5802
  function isRegExp(obj) {
@@ -5813,40 +5806,37 @@ function isRegExp(obj) {
5813
5806
  function checkHost(host, matches) {
5814
5807
  for (var i = 0; i < matches.length; i++) {
5815
5808
  var match = matches[i];
5809
+
5816
5810
  if (host === match || isRegExp(match) && match.test(host)) {
5817
5811
  return true;
5818
5812
  }
5819
5813
  }
5814
+
5820
5815
  return false;
5821
5816
  }
5822
5817
 
5823
5818
  function isURL(url, options) {
5824
- (0, _assertString2.default)(url);
5819
+ (0, _assertString.default)(url);
5820
+
5825
5821
  if (!url || url.length >= 2083 || /[\s<>]/.test(url)) {
5826
5822
  return false;
5827
5823
  }
5824
+
5828
5825
  if (url.indexOf('mailto:') === 0) {
5829
5826
  return false;
5830
5827
  }
5831
- options = (0, _merge2.default)(options, default_url_options);
5832
- var protocol = void 0,
5833
- auth = void 0,
5834
- host = void 0,
5835
- hostname = void 0,
5836
- port = void 0,
5837
- port_str = void 0,
5838
- split = void 0,
5839
- ipv6 = void 0;
5840
5828
 
5829
+ options = (0, _merge.default)(options, default_url_options);
5830
+ var protocol, auth, host, hostname, port, port_str, split, ipv6;
5841
5831
  split = url.split('#');
5842
5832
  url = split.shift();
5843
-
5844
5833
  split = url.split('?');
5845
5834
  url = split.shift();
5846
-
5847
5835
  split = url.split('://');
5836
+
5848
5837
  if (split.length > 1) {
5849
5838
  protocol = split.shift().toLowerCase();
5839
+
5850
5840
  if (options.require_valid_protocol && options.protocols.indexOf(protocol) === -1) {
5851
5841
  return false;
5852
5842
  }
@@ -5856,8 +5846,10 @@ function isURL(url, options) {
5856
5846
  if (!options.allow_protocol_relative_urls) {
5857
5847
  return false;
5858
5848
  }
5849
+
5859
5850
  split[0] = url.substr(2);
5860
5851
  }
5852
+
5861
5853
  url = split.join('://');
5862
5854
 
5863
5855
  if (url === '') {
@@ -5872,17 +5864,24 @@ function isURL(url, options) {
5872
5864
  }
5873
5865
 
5874
5866
  split = url.split('@');
5867
+
5875
5868
  if (split.length > 1) {
5869
+ if (options.disallow_auth) {
5870
+ return false;
5871
+ }
5872
+
5876
5873
  auth = split.shift();
5874
+
5877
5875
  if (auth.indexOf(':') >= 0 && auth.split(':').length > 2) {
5878
5876
  return false;
5879
5877
  }
5880
5878
  }
5881
- hostname = split.join('@');
5882
5879
 
5880
+ hostname = split.join('@');
5883
5881
  port_str = null;
5884
5882
  ipv6 = null;
5885
5883
  var ipv6_match = hostname.match(wrapped_ipv6);
5884
+
5886
5885
  if (ipv6_match) {
5887
5886
  host = '';
5888
5887
  ipv6 = ipv6_match[1];
@@ -5890,6 +5889,7 @@ function isURL(url, options) {
5890
5889
  } else {
5891
5890
  split = hostname.split(':');
5892
5891
  host = split.shift();
5892
+
5893
5893
  if (split.length) {
5894
5894
  port_str = split.join(':');
5895
5895
  }
@@ -5897,12 +5897,13 @@ function isURL(url, options) {
5897
5897
 
5898
5898
  if (port_str !== null) {
5899
5899
  port = parseInt(port_str, 10);
5900
+
5900
5901
  if (!/^[0-9]+$/.test(port_str) || port <= 0 || port > 65535) {
5901
5902
  return false;
5902
5903
  }
5903
5904
  }
5904
5905
 
5905
- if (!(0, _isIP2.default)(host) && !(0, _isFQDN2.default)(host, options) && (!ipv6 || !(0, _isIP2.default)(ipv6, 6))) {
5906
+ if (!(0, _isIP.default)(host) && !(0, _isFQDN.default)(host, options) && (!ipv6 || !(0, _isIP.default)(ipv6, 6))) {
5906
5907
  return false;
5907
5908
  }
5908
5909
 
@@ -5911,13 +5912,16 @@ function isURL(url, options) {
5911
5912
  if (options.host_whitelist && !checkHost(host, options.host_whitelist)) {
5912
5913
  return false;
5913
5914
  }
5915
+
5914
5916
  if (options.host_blacklist && checkHost(host, options.host_blacklist)) {
5915
5917
  return false;
5916
5918
  }
5917
5919
 
5918
5920
  return true;
5919
5921
  }
5920
- module.exports = exports['default'];
5922
+
5923
+ module.exports = exports.default;
5924
+ module.exports.default = exports.default;
5921
5925
  });
5922
5926
 
5923
5927
  var isURL = unwrapExports(isURL_1);
@@ -5942,6 +5946,4 @@ var url = {
5942
5946
  validate: validate$y
5943
5947
  };
5944
5948
 
5945
- /* eslint-disable camelcase */
5946
-
5947
5949
  export { after, alpha$1 as alpha, alpha_dash, alpha_num, alpha_spaces, before, between, confirmed, credit_card, date_between, date_format, decimal, digits, dimensions, email, excluded, ext, image, included, integer, ip, ip_or_fqdn, is, is_not, length, max, max_value, mimes, min, min_value, numeric, regex, required, required_if, size, url };