vee-validate 2.2.12 → 2.2.13

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.
package/dist/rules.esm.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vee-validate v2.2.12
2
+ * vee-validate v2.2.13
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
  /**
@@ -4733,29 +4697,34 @@ var assertString_1 = createCommonjsModule(function (module, exports) {
4733
4697
  Object.defineProperty(exports, "__esModule", {
4734
4698
  value: true
4735
4699
  });
4700
+ exports.default = assertString;
4736
4701
 
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; };
4702
+ 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
4703
 
4739
- exports.default = assertString;
4740
4704
  function assertString(input) {
4741
4705
  var isString = typeof input === 'string' || input instanceof String;
4742
4706
 
4743
4707
  if (!isString) {
4744
- var invalidType = void 0;
4708
+ var invalidType;
4709
+
4745
4710
  if (input === null) {
4746
4711
  invalidType = 'null';
4747
4712
  } else {
4748
- invalidType = typeof input === 'undefined' ? 'undefined' : _typeof(input);
4713
+ invalidType = _typeof(input);
4714
+
4749
4715
  if (invalidType === 'object' && input.constructor && input.constructor.hasOwnProperty('name')) {
4750
4716
  invalidType = input.constructor.name;
4751
4717
  } else {
4752
- invalidType = 'a ' + invalidType;
4718
+ invalidType = "a ".concat(invalidType);
4753
4719
  }
4754
4720
  }
4755
- throw new TypeError('Expected string but received ' + invalidType + '.');
4721
+
4722
+ throw new TypeError("Expected string but received ".concat(invalidType, "."));
4756
4723
  }
4757
4724
  }
4758
- module.exports = exports['default'];
4725
+
4726
+ module.exports = exports.default;
4727
+ module.exports.default = exports.default;
4759
4728
  });
4760
4729
 
4761
4730
  unwrapExports(assertString_1);
@@ -4767,9 +4736,7 @@ Object.defineProperty(exports, "__esModule", {
4767
4736
  });
4768
4737
  exports.default = isCreditCard;
4769
4738
 
4770
-
4771
-
4772
- var _assertString2 = _interopRequireDefault(assertString_1);
4739
+ var _assertString = _interopRequireDefault(assertString_1);
4773
4740
 
4774
4741
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
4775
4742
 
@@ -4778,20 +4745,25 @@ var creditCard = /^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|(222[1-9]|22[3-9][
4778
4745
  /* eslint-enable max-len */
4779
4746
 
4780
4747
  function isCreditCard(str) {
4781
- (0, _assertString2.default)(str);
4748
+ (0, _assertString.default)(str);
4782
4749
  var sanitized = str.replace(/[- ]+/g, '');
4750
+
4783
4751
  if (!creditCard.test(sanitized)) {
4784
4752
  return false;
4785
4753
  }
4754
+
4786
4755
  var sum = 0;
4787
- var digit = void 0;
4788
- var tmpNum = void 0;
4789
- var shouldDouble = void 0;
4756
+ var digit;
4757
+ var tmpNum;
4758
+ var shouldDouble;
4759
+
4790
4760
  for (var i = sanitized.length - 1; i >= 0; i--) {
4791
4761
  digit = sanitized.substring(i, i + 1);
4792
4762
  tmpNum = parseInt(digit, 10);
4763
+
4793
4764
  if (shouldDouble) {
4794
4765
  tmpNum *= 2;
4766
+
4795
4767
  if (tmpNum >= 10) {
4796
4768
  sum += tmpNum % 10 + 1;
4797
4769
  } else {
@@ -4800,11 +4772,15 @@ function isCreditCard(str) {
4800
4772
  } else {
4801
4773
  sum += tmpNum;
4802
4774
  }
4775
+
4803
4776
  shouldDouble = !shouldDouble;
4804
4777
  }
4778
+
4805
4779
  return !!(sum % 10 === 0 ? sanitized : false);
4806
4780
  }
4807
- module.exports = exports['default'];
4781
+
4782
+ module.exports = exports.default;
4783
+ module.exports.default = exports.default;
4808
4784
  });
4809
4785
 
4810
4786
  var isCreditCard = unwrapExports(isCreditCard_1);
@@ -5055,18 +5031,22 @@ Object.defineProperty(exports, "__esModule", {
5055
5031
  value: true
5056
5032
  });
5057
5033
  exports.default = merge;
5034
+
5058
5035
  function merge() {
5059
5036
  var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5060
- var defaults = arguments[1];
5037
+ var defaults = arguments.length > 1 ? arguments[1] : undefined;
5061
5038
 
5062
5039
  for (var key in defaults) {
5063
5040
  if (typeof obj[key] === 'undefined') {
5064
5041
  obj[key] = defaults[key];
5065
5042
  }
5066
5043
  }
5044
+
5067
5045
  return obj;
5068
5046
  }
5069
- module.exports = exports['default'];
5047
+
5048
+ module.exports = exports.default;
5049
+ module.exports.default = exports.default;
5070
5050
  });
5071
5051
 
5072
5052
  unwrapExports(merge_1);
@@ -5076,23 +5056,21 @@ var isByteLength_1 = createCommonjsModule(function (module, exports) {
5076
5056
  Object.defineProperty(exports, "__esModule", {
5077
5057
  value: true
5078
5058
  });
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
5059
  exports.default = isByteLength;
5083
5060
 
5084
-
5085
-
5086
- var _assertString2 = _interopRequireDefault(assertString_1);
5061
+ var _assertString = _interopRequireDefault(assertString_1);
5087
5062
 
5088
5063
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
5089
5064
 
5065
+ 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); }
5066
+
5090
5067
  /* eslint-disable prefer-rest-params */
5091
5068
  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') {
5069
+ (0, _assertString.default)(str);
5070
+ var min;
5071
+ var max;
5072
+
5073
+ if (_typeof(options) === 'object') {
5096
5074
  min = options.min || 0;
5097
5075
  max = options.max;
5098
5076
  } else {
@@ -5100,10 +5078,13 @@ function isByteLength(str, options) {
5100
5078
  min = arguments[1];
5101
5079
  max = arguments[2];
5102
5080
  }
5081
+
5103
5082
  var len = encodeURI(str).split(/%..|./).length - 1;
5104
5083
  return len >= min && (typeof max === 'undefined' || len <= max);
5105
5084
  }
5106
- module.exports = exports['default'];
5085
+
5086
+ module.exports = exports.default;
5087
+ module.exports.default = exports.default;
5107
5088
  });
5108
5089
 
5109
5090
  unwrapExports(isByteLength_1);
@@ -5115,13 +5096,9 @@ Object.defineProperty(exports, "__esModule", {
5115
5096
  });
5116
5097
  exports.default = isFQDN;
5117
5098
 
5099
+ var _assertString = _interopRequireDefault(assertString_1);
5118
5100
 
5119
-
5120
- var _assertString2 = _interopRequireDefault(assertString_1);
5121
-
5122
-
5123
-
5124
- var _merge2 = _interopRequireDefault(merge_1);
5101
+ var _merge = _interopRequireDefault(merge_1);
5125
5102
 
5126
5103
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
5127
5104
 
@@ -5132,48 +5109,61 @@ var default_fqdn_options = {
5132
5109
  };
5133
5110
 
5134
5111
  function isFQDN(str, options) {
5135
- (0, _assertString2.default)(str);
5136
- options = (0, _merge2.default)(options, default_fqdn_options);
5137
-
5112
+ (0, _assertString.default)(str);
5113
+ options = (0, _merge.default)(options, default_fqdn_options);
5138
5114
  /* Remove the optional trailing dot before checking validity */
5115
+
5139
5116
  if (options.allow_trailing_dot && str[str.length - 1] === '.') {
5140
5117
  str = str.substring(0, str.length - 1);
5141
5118
  }
5119
+
5142
5120
  var parts = str.split('.');
5121
+
5143
5122
  for (var i = 0; i < parts.length; i++) {
5144
5123
  if (parts[i].length > 63) {
5145
5124
  return false;
5146
5125
  }
5147
5126
  }
5127
+
5148
5128
  if (options.require_tld) {
5149
5129
  var tld = parts.pop();
5130
+
5150
5131
  if (!parts.length || !/^([a-z\u00a1-\uffff]{2,}|xn[a-z0-9-]{2,})$/i.test(tld)) {
5151
5132
  return false;
5152
- }
5153
- // disallow spaces
5133
+ } // disallow spaces
5134
+
5135
+
5154
5136
  if (/[\s\u2002-\u200B\u202F\u205F\u3000\uFEFF\uDB40\uDC20]/.test(tld)) {
5155
5137
  return false;
5156
5138
  }
5157
5139
  }
5140
+
5158
5141
  for (var part, _i = 0; _i < parts.length; _i++) {
5159
5142
  part = parts[_i];
5143
+
5160
5144
  if (options.allow_underscores) {
5161
5145
  part = part.replace(/_/g, '');
5162
5146
  }
5147
+
5163
5148
  if (!/^[a-z\u00a1-\uffff0-9-]+$/i.test(part)) {
5164
5149
  return false;
5165
- }
5166
- // disallow full-width chars
5150
+ } // disallow full-width chars
5151
+
5152
+
5167
5153
  if (/[\uff01-\uff5e]/.test(part)) {
5168
5154
  return false;
5169
5155
  }
5156
+
5170
5157
  if (part[0] === '-' || part[part.length - 1] === '-') {
5171
5158
  return false;
5172
5159
  }
5173
5160
  }
5161
+
5174
5162
  return true;
5175
5163
  }
5176
- module.exports = exports['default'];
5164
+
5165
+ module.exports = exports.default;
5166
+ module.exports.default = exports.default;
5177
5167
  });
5178
5168
 
5179
5169
  var isFQDN = unwrapExports(isFQDN_1);
@@ -5185,9 +5175,7 @@ Object.defineProperty(exports, "__esModule", {
5185
5175
  });
5186
5176
  exports.default = isIP;
5187
5177
 
5188
-
5189
-
5190
- var _assertString2 = _interopRequireDefault(assertString_1);
5178
+ var _assertString = _interopRequireDefault(assertString_1);
5191
5179
 
5192
5180
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
5193
5181
 
@@ -5196,15 +5184,16 @@ var ipv6Block = /^[0-9A-F]{1,4}$/i;
5196
5184
 
5197
5185
  function isIP(str) {
5198
5186
  var version = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
5199
-
5200
- (0, _assertString2.default)(str);
5187
+ (0, _assertString.default)(str);
5201
5188
  version = String(version);
5189
+
5202
5190
  if (!version) {
5203
5191
  return isIP(str, 4) || isIP(str, 6);
5204
5192
  } else if (version === '4') {
5205
5193
  if (!ipv4Maybe.test(str)) {
5206
5194
  return false;
5207
5195
  }
5196
+
5208
5197
  var parts = str.split('.').sort(function (a, b) {
5209
5198
  return a - b;
5210
5199
  });
@@ -5212,18 +5201,19 @@ function isIP(str) {
5212
5201
  } else if (version === '6') {
5213
5202
  var blocks = str.split(':');
5214
5203
  var foundOmissionBlock = false; // marker to indicate ::
5215
-
5216
5204
  // At least some OS accept the last 32 bits of an IPv6 address
5217
5205
  // (i.e. 2 of the blocks) in IPv4 notation, and RFC 3493 says
5218
5206
  // that '::ffff:a.b.c.d' is valid for IPv4-mapped IPv6 addresses,
5219
5207
  // and '::a.b.c.d' is deprecated, but also valid.
5208
+
5220
5209
  var foundIPv4TransitionBlock = isIP(blocks[blocks.length - 1], 4);
5221
5210
  var expectedNumberOfBlocks = foundIPv4TransitionBlock ? 7 : 8;
5222
5211
 
5223
5212
  if (blocks.length > expectedNumberOfBlocks) {
5224
5213
  return false;
5225
- }
5226
- // initial or final ::
5214
+ } // initial or final ::
5215
+
5216
+
5227
5217
  if (str === '::') {
5228
5218
  return true;
5229
5219
  } else if (str.substr(0, 2) === '::') {
@@ -5243,19 +5233,25 @@ function isIP(str) {
5243
5233
  if (foundOmissionBlock) {
5244
5234
  return false; // multiple :: in address
5245
5235
  }
5236
+
5246
5237
  foundOmissionBlock = true;
5247
5238
  } else if (foundIPv4TransitionBlock && i === blocks.length - 1) ; else if (!ipv6Block.test(blocks[i])) {
5248
5239
  return false;
5249
5240
  }
5250
5241
  }
5242
+
5251
5243
  if (foundOmissionBlock) {
5252
5244
  return blocks.length >= 1;
5253
5245
  }
5246
+
5254
5247
  return blocks.length === expectedNumberOfBlocks;
5255
5248
  }
5249
+
5256
5250
  return false;
5257
5251
  }
5258
- module.exports = exports['default'];
5252
+
5253
+ module.exports = exports.default;
5254
+ module.exports.default = exports.default;
5259
5255
  });
5260
5256
 
5261
5257
  var isIP = unwrapExports(isIP_1);
@@ -5267,25 +5263,15 @@ Object.defineProperty(exports, "__esModule", {
5267
5263
  });
5268
5264
  exports.default = isEmail;
5269
5265
 
5266
+ var _assertString = _interopRequireDefault(assertString_1);
5270
5267
 
5268
+ var _merge = _interopRequireDefault(merge_1);
5271
5269
 
5272
- var _assertString2 = _interopRequireDefault(assertString_1);
5273
-
5270
+ var _isByteLength = _interopRequireDefault(isByteLength_1);
5274
5271
 
5272
+ var _isFQDN = _interopRequireDefault(isFQDN_1);
5275
5273
 
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);
5274
+ var _isIP = _interopRequireDefault(isIP_1);
5289
5275
 
5290
5276
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
5291
5277
 
@@ -5295,9 +5281,10 @@ var default_email_options = {
5295
5281
  allow_utf8_local_part: true,
5296
5282
  require_tld: true
5297
5283
  };
5298
-
5299
5284
  /* eslint-disable max-len */
5285
+
5300
5286
  /* eslint-disable no-control-regex */
5287
+
5301
5288
  var displayName = /^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\.\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\,\.\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF\s]*<(.+)>$/i;
5302
5289
  var emailUserPart = /^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i;
5303
5290
  var gmailUserPart = /^[a-z\d]+$/;
@@ -5305,14 +5292,16 @@ var quotedEmailUser = /^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e
5305
5292
  var emailUserUtf8Part = /^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i;
5306
5293
  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
5294
  /* eslint-enable max-len */
5295
+
5308
5296
  /* eslint-enable no-control-regex */
5309
5297
 
5310
5298
  function isEmail(str, options) {
5311
- (0, _assertString2.default)(str);
5312
- options = (0, _merge2.default)(options, default_email_options);
5299
+ (0, _assertString.default)(str);
5300
+ options = (0, _merge.default)(options, default_email_options);
5313
5301
 
5314
5302
  if (options.require_display_name || options.allow_display_name) {
5315
5303
  var display_email = str.match(displayName);
5304
+
5316
5305
  if (display_email) {
5317
5306
  str = display_email[1];
5318
5307
  } else if (options.require_display_name) {
@@ -5323,7 +5312,6 @@ function isEmail(str, options) {
5323
5312
  var parts = str.split('@');
5324
5313
  var domain = parts.pop();
5325
5314
  var user = parts.join('@');
5326
-
5327
5315
  var lower_domain = domain.toLowerCase();
5328
5316
 
5329
5317
  if (options.domain_specific_validation && (lower_domain === 'gmail.com' || lower_domain === 'googlemail.com')) {
@@ -5334,17 +5322,19 @@ function isEmail(str, options) {
5334
5322
  Gmail only normalizes single dots, removing them from here is pointless,
5335
5323
  should be done in normalizeEmail
5336
5324
  */
5337
- user = user.toLowerCase();
5325
+ user = user.toLowerCase(); // Removing sub-address from username before gmail validation
5338
5326
 
5339
- // Removing sub-address from username before gmail validation
5340
- var username = user.split('+')[0];
5327
+ var username = user.split('+')[0]; // Dots are not included in gmail length restriction
5341
5328
 
5342
- // Dots are not included in gmail length restriction
5343
- if (!(0, _isByteLength2.default)(username.replace('.', ''), { min: 6, max: 30 })) {
5329
+ if (!(0, _isByteLength.default)(username.replace('.', ''), {
5330
+ min: 6,
5331
+ max: 30
5332
+ })) {
5344
5333
  return false;
5345
5334
  }
5346
5335
 
5347
5336
  var _user_parts = username.split('.');
5337
+
5348
5338
  for (var i = 0; i < _user_parts.length; i++) {
5349
5339
  if (!gmailUserPart.test(_user_parts[i])) {
5350
5340
  return false;
@@ -5352,23 +5342,29 @@ function isEmail(str, options) {
5352
5342
  }
5353
5343
  }
5354
5344
 
5355
- if (!(0, _isByteLength2.default)(user, { max: 64 }) || !(0, _isByteLength2.default)(domain, { max: 254 })) {
5345
+ if (!(0, _isByteLength.default)(user, {
5346
+ max: 64
5347
+ }) || !(0, _isByteLength.default)(domain, {
5348
+ max: 254
5349
+ })) {
5356
5350
  return false;
5357
5351
  }
5358
5352
 
5359
- if (!(0, _isFQDN2.default)(domain, { require_tld: options.require_tld })) {
5353
+ if (!(0, _isFQDN.default)(domain, {
5354
+ require_tld: options.require_tld
5355
+ })) {
5360
5356
  if (!options.allow_ip_domain) {
5361
5357
  return false;
5362
5358
  }
5363
5359
 
5364
- if (!(0, _isIP2.default)(domain)) {
5360
+ if (!(0, _isIP.default)(domain)) {
5365
5361
  if (!domain.startsWith('[') || !domain.endsWith(']')) {
5366
5362
  return false;
5367
5363
  }
5368
5364
 
5369
5365
  var noBracketdomain = domain.substr(1, domain.length - 2);
5370
5366
 
5371
- if (noBracketdomain.length === 0 || !(0, _isIP2.default)(noBracketdomain)) {
5367
+ if (noBracketdomain.length === 0 || !(0, _isIP.default)(noBracketdomain)) {
5372
5368
  return false;
5373
5369
  }
5374
5370
  }
@@ -5380,8 +5376,8 @@ function isEmail(str, options) {
5380
5376
  }
5381
5377
 
5382
5378
  var pattern = options.allow_utf8_local_part ? emailUserUtf8Part : emailUserPart;
5383
-
5384
5379
  var user_parts = user.split('.');
5380
+
5385
5381
  for (var _i = 0; _i < user_parts.length; _i++) {
5386
5382
  if (!pattern.test(user_parts[_i])) {
5387
5383
  return false;
@@ -5390,7 +5386,9 @@ function isEmail(str, options) {
5390
5386
 
5391
5387
  return true;
5392
5388
  }
5393
- module.exports = exports['default'];
5389
+
5390
+ module.exports = exports.default;
5391
+ module.exports.default = exports.default;
5394
5392
  });
5395
5393
 
5396
5394
  var isEmail = unwrapExports(isEmail_1);
@@ -5775,21 +5773,13 @@ Object.defineProperty(exports, "__esModule", {
5775
5773
  });
5776
5774
  exports.default = isURL;
5777
5775
 
5776
+ var _assertString = _interopRequireDefault(assertString_1);
5778
5777
 
5778
+ var _isFQDN = _interopRequireDefault(isFQDN_1);
5779
5779
 
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
-
5780
+ var _isIP = _interopRequireDefault(isIP_1);
5790
5781
 
5791
-
5792
- var _merge2 = _interopRequireDefault(merge_1);
5782
+ var _merge = _interopRequireDefault(merge_1);
5793
5783
 
5794
5784
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
5795
5785
 
@@ -5803,7 +5793,6 @@ var default_url_options = {
5803
5793
  allow_trailing_dot: false,
5804
5794
  allow_protocol_relative_urls: false
5805
5795
  };
5806
-
5807
5796
  var wrapped_ipv6 = /^\[([^\]]+)\](?::([0-9]+))?$/;
5808
5797
 
5809
5798
  function isRegExp(obj) {
@@ -5813,40 +5802,37 @@ function isRegExp(obj) {
5813
5802
  function checkHost(host, matches) {
5814
5803
  for (var i = 0; i < matches.length; i++) {
5815
5804
  var match = matches[i];
5805
+
5816
5806
  if (host === match || isRegExp(match) && match.test(host)) {
5817
5807
  return true;
5818
5808
  }
5819
5809
  }
5810
+
5820
5811
  return false;
5821
5812
  }
5822
5813
 
5823
5814
  function isURL(url, options) {
5824
- (0, _assertString2.default)(url);
5815
+ (0, _assertString.default)(url);
5816
+
5825
5817
  if (!url || url.length >= 2083 || /[\s<>]/.test(url)) {
5826
5818
  return false;
5827
5819
  }
5820
+
5828
5821
  if (url.indexOf('mailto:') === 0) {
5829
5822
  return false;
5830
5823
  }
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
5824
 
5825
+ options = (0, _merge.default)(options, default_url_options);
5826
+ var protocol, auth, host, hostname, port, port_str, split, ipv6;
5841
5827
  split = url.split('#');
5842
5828
  url = split.shift();
5843
-
5844
5829
  split = url.split('?');
5845
5830
  url = split.shift();
5846
-
5847
5831
  split = url.split('://');
5832
+
5848
5833
  if (split.length > 1) {
5849
5834
  protocol = split.shift().toLowerCase();
5835
+
5850
5836
  if (options.require_valid_protocol && options.protocols.indexOf(protocol) === -1) {
5851
5837
  return false;
5852
5838
  }
@@ -5856,8 +5842,10 @@ function isURL(url, options) {
5856
5842
  if (!options.allow_protocol_relative_urls) {
5857
5843
  return false;
5858
5844
  }
5845
+
5859
5846
  split[0] = url.substr(2);
5860
5847
  }
5848
+
5861
5849
  url = split.join('://');
5862
5850
 
5863
5851
  if (url === '') {
@@ -5872,17 +5860,24 @@ function isURL(url, options) {
5872
5860
  }
5873
5861
 
5874
5862
  split = url.split('@');
5863
+
5875
5864
  if (split.length > 1) {
5865
+ if (options.disallow_auth) {
5866
+ return false;
5867
+ }
5868
+
5876
5869
  auth = split.shift();
5870
+
5877
5871
  if (auth.indexOf(':') >= 0 && auth.split(':').length > 2) {
5878
5872
  return false;
5879
5873
  }
5880
5874
  }
5881
- hostname = split.join('@');
5882
5875
 
5876
+ hostname = split.join('@');
5883
5877
  port_str = null;
5884
5878
  ipv6 = null;
5885
5879
  var ipv6_match = hostname.match(wrapped_ipv6);
5880
+
5886
5881
  if (ipv6_match) {
5887
5882
  host = '';
5888
5883
  ipv6 = ipv6_match[1];
@@ -5890,6 +5885,7 @@ function isURL(url, options) {
5890
5885
  } else {
5891
5886
  split = hostname.split(':');
5892
5887
  host = split.shift();
5888
+
5893
5889
  if (split.length) {
5894
5890
  port_str = split.join(':');
5895
5891
  }
@@ -5897,12 +5893,13 @@ function isURL(url, options) {
5897
5893
 
5898
5894
  if (port_str !== null) {
5899
5895
  port = parseInt(port_str, 10);
5896
+
5900
5897
  if (!/^[0-9]+$/.test(port_str) || port <= 0 || port > 65535) {
5901
5898
  return false;
5902
5899
  }
5903
5900
  }
5904
5901
 
5905
- if (!(0, _isIP2.default)(host) && !(0, _isFQDN2.default)(host, options) && (!ipv6 || !(0, _isIP2.default)(ipv6, 6))) {
5902
+ if (!(0, _isIP.default)(host) && !(0, _isFQDN.default)(host, options) && (!ipv6 || !(0, _isIP.default)(ipv6, 6))) {
5906
5903
  return false;
5907
5904
  }
5908
5905
 
@@ -5911,13 +5908,16 @@ function isURL(url, options) {
5911
5908
  if (options.host_whitelist && !checkHost(host, options.host_whitelist)) {
5912
5909
  return false;
5913
5910
  }
5911
+
5914
5912
  if (options.host_blacklist && checkHost(host, options.host_blacklist)) {
5915
5913
  return false;
5916
5914
  }
5917
5915
 
5918
5916
  return true;
5919
5917
  }
5920
- module.exports = exports['default'];
5918
+
5919
+ module.exports = exports.default;
5920
+ module.exports.default = exports.default;
5921
5921
  });
5922
5922
 
5923
5923
  var isURL = unwrapExports(isURL_1);
@@ -5942,6 +5942,4 @@ var url = {
5942
5942
  validate: validate$y
5943
5943
  };
5944
5944
 
5945
- /* eslint-disable camelcase */
5946
-
5947
5945
  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 };