z-schema 5.0.5 → 6.0.0

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.
@@ -3009,6 +3009,8 @@ var _isFQDN = _interopRequireDefault(require("./lib/isFQDN"));
3009
3009
 
3010
3010
  var _isDate = _interopRequireDefault(require("./lib/isDate"));
3011
3011
 
3012
+ var _isTime = _interopRequireDefault(require("./lib/isTime"));
3013
+
3012
3014
  var _isBoolean = _interopRequireDefault(require("./lib/isBoolean"));
3013
3015
 
3014
3016
  var _isLocale = _interopRequireDefault(require("./lib/isLocale"));
@@ -3091,6 +3093,8 @@ var _isBefore = _interopRequireDefault(require("./lib/isBefore"));
3091
3093
 
3092
3094
  var _isIn = _interopRequireDefault(require("./lib/isIn"));
3093
3095
 
3096
+ var _isLuhnNumber = _interopRequireDefault(require("./lib/isLuhnNumber"));
3097
+
3094
3098
  var _isCreditCard = _interopRequireDefault(require("./lib/isCreditCard"));
3095
3099
 
3096
3100
  var _isIdentityCard = _interopRequireDefault(require("./lib/isIdentityCard"));
@@ -3113,7 +3117,9 @@ var _isCurrency = _interopRequireDefault(require("./lib/isCurrency"));
3113
3117
 
3114
3118
  var _isBtcAddress = _interopRequireDefault(require("./lib/isBtcAddress"));
3115
3119
 
3116
- var _isISO = _interopRequireDefault(require("./lib/isISO8601"));
3120
+ var _isISO = _interopRequireDefault(require("./lib/isISO6391"));
3121
+
3122
+ var _isISO2 = _interopRequireDefault(require("./lib/isISO8601"));
3117
3123
 
3118
3124
  var _isRFC = _interopRequireDefault(require("./lib/isRFC3339"));
3119
3125
 
@@ -3121,7 +3127,7 @@ var _isISO31661Alpha = _interopRequireDefault(require("./lib/isISO31661Alpha2"))
3121
3127
 
3122
3128
  var _isISO31661Alpha2 = _interopRequireDefault(require("./lib/isISO31661Alpha3"));
3123
3129
 
3124
- var _isISO2 = _interopRequireDefault(require("./lib/isISO4217"));
3130
+ var _isISO3 = _interopRequireDefault(require("./lib/isISO4217"));
3125
3131
 
3126
3132
  var _isBase = _interopRequireDefault(require("./lib/isBase32"));
3127
3133
 
@@ -3173,7 +3179,7 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
3173
3179
 
3174
3180
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3175
3181
 
3176
- var version = '13.7.0';
3182
+ var version = '13.9.0';
3177
3183
  var validator = {
3178
3184
  version: version,
3179
3185
  toDate: _toDate.default,
@@ -3233,6 +3239,7 @@ var validator = {
3233
3239
  isAfter: _isAfter.default,
3234
3240
  isBefore: _isBefore.default,
3235
3241
  isIn: _isIn.default,
3242
+ isLuhnNumber: _isLuhnNumber.default,
3236
3243
  isCreditCard: _isCreditCard.default,
3237
3244
  isIdentityCard: _isIdentityCard.default,
3238
3245
  isEAN: _isEAN.default,
@@ -3246,11 +3253,12 @@ var validator = {
3246
3253
  isEthereumAddress: _isEthereumAddress.default,
3247
3254
  isCurrency: _isCurrency.default,
3248
3255
  isBtcAddress: _isBtcAddress.default,
3249
- isISO8601: _isISO.default,
3256
+ isISO6391: _isISO.default,
3257
+ isISO8601: _isISO2.default,
3250
3258
  isRFC3339: _isRFC.default,
3251
3259
  isISO31661Alpha2: _isISO31661Alpha.default,
3252
3260
  isISO31661Alpha3: _isISO31661Alpha2.default,
3253
- isISO4217: _isISO2.default,
3261
+ isISO4217: _isISO3.default,
3254
3262
  isBase32: _isBase.default,
3255
3263
  isBase58: _isBase2.default,
3256
3264
  isBase64: _isBase3.default,
@@ -3273,6 +3281,7 @@ var validator = {
3273
3281
  isStrongPassword: _isStrongPassword.default,
3274
3282
  isTaxID: _isTaxID.default,
3275
3283
  isDate: _isDate.default,
3284
+ isTime: _isTime.default,
3276
3285
  isLicensePlate: _isLicensePlate.default,
3277
3286
  isVAT: _isVAT.default,
3278
3287
  ibanLocales: _isIBAN.locales
@@ -3281,13 +3290,13 @@ var _default = validator;
3281
3290
  exports.default = _default;
3282
3291
  module.exports = exports.default;
3283
3292
  module.exports.default = exports.default;
3284
- },{"./lib/blacklist":6,"./lib/contains":7,"./lib/equals":8,"./lib/escape":9,"./lib/isAfter":10,"./lib/isAlpha":11,"./lib/isAlphanumeric":12,"./lib/isAscii":13,"./lib/isBIC":14,"./lib/isBase32":15,"./lib/isBase58":16,"./lib/isBase64":17,"./lib/isBefore":18,"./lib/isBoolean":19,"./lib/isBtcAddress":20,"./lib/isByteLength":21,"./lib/isCreditCard":22,"./lib/isCurrency":23,"./lib/isDataURI":24,"./lib/isDate":25,"./lib/isDecimal":26,"./lib/isDivisibleBy":27,"./lib/isEAN":28,"./lib/isEmail":29,"./lib/isEmpty":30,"./lib/isEthereumAddress":31,"./lib/isFQDN":32,"./lib/isFloat":33,"./lib/isFullWidth":34,"./lib/isHSL":35,"./lib/isHalfWidth":36,"./lib/isHash":37,"./lib/isHexColor":38,"./lib/isHexadecimal":39,"./lib/isIBAN":40,"./lib/isIMEI":41,"./lib/isIP":42,"./lib/isIPRange":43,"./lib/isISBN":44,"./lib/isISIN":45,"./lib/isISO31661Alpha2":46,"./lib/isISO31661Alpha3":47,"./lib/isISO4217":48,"./lib/isISO8601":49,"./lib/isISRC":50,"./lib/isISSN":51,"./lib/isIdentityCard":52,"./lib/isIn":53,"./lib/isInt":54,"./lib/isJSON":55,"./lib/isJWT":56,"./lib/isLatLong":57,"./lib/isLength":58,"./lib/isLicensePlate":59,"./lib/isLocale":60,"./lib/isLowercase":61,"./lib/isMACAddress":62,"./lib/isMD5":63,"./lib/isMagnetURI":64,"./lib/isMimeType":65,"./lib/isMobilePhone":66,"./lib/isMongoId":67,"./lib/isMultibyte":68,"./lib/isNumeric":69,"./lib/isOctal":70,"./lib/isPassportNumber":71,"./lib/isPort":72,"./lib/isPostalCode":73,"./lib/isRFC3339":74,"./lib/isRgbColor":75,"./lib/isSemVer":76,"./lib/isSlug":77,"./lib/isStrongPassword":78,"./lib/isSurrogatePair":79,"./lib/isTaxID":80,"./lib/isURL":81,"./lib/isUUID":82,"./lib/isUppercase":83,"./lib/isVAT":84,"./lib/isVariableWidth":85,"./lib/isWhitelisted":86,"./lib/ltrim":87,"./lib/matches":88,"./lib/normalizeEmail":89,"./lib/rtrim":90,"./lib/stripLow":91,"./lib/toBoolean":92,"./lib/toDate":93,"./lib/toFloat":94,"./lib/toInt":95,"./lib/trim":96,"./lib/unescape":97,"./lib/whitelist":104}],5:[function(require,module,exports){
3293
+ },{"./lib/blacklist":6,"./lib/contains":7,"./lib/equals":8,"./lib/escape":9,"./lib/isAfter":10,"./lib/isAlpha":11,"./lib/isAlphanumeric":12,"./lib/isAscii":13,"./lib/isBIC":14,"./lib/isBase32":15,"./lib/isBase58":16,"./lib/isBase64":17,"./lib/isBefore":18,"./lib/isBoolean":19,"./lib/isBtcAddress":20,"./lib/isByteLength":21,"./lib/isCreditCard":22,"./lib/isCurrency":23,"./lib/isDataURI":24,"./lib/isDate":25,"./lib/isDecimal":26,"./lib/isDivisibleBy":27,"./lib/isEAN":28,"./lib/isEmail":29,"./lib/isEmpty":30,"./lib/isEthereumAddress":31,"./lib/isFQDN":32,"./lib/isFloat":33,"./lib/isFullWidth":34,"./lib/isHSL":35,"./lib/isHalfWidth":36,"./lib/isHash":37,"./lib/isHexColor":38,"./lib/isHexadecimal":39,"./lib/isIBAN":40,"./lib/isIMEI":41,"./lib/isIP":42,"./lib/isIPRange":43,"./lib/isISBN":44,"./lib/isISIN":45,"./lib/isISO31661Alpha2":46,"./lib/isISO31661Alpha3":47,"./lib/isISO4217":48,"./lib/isISO6391":49,"./lib/isISO8601":50,"./lib/isISRC":51,"./lib/isISSN":52,"./lib/isIdentityCard":53,"./lib/isIn":54,"./lib/isInt":55,"./lib/isJSON":56,"./lib/isJWT":57,"./lib/isLatLong":58,"./lib/isLength":59,"./lib/isLicensePlate":60,"./lib/isLocale":61,"./lib/isLowercase":62,"./lib/isLuhnNumber":63,"./lib/isMACAddress":64,"./lib/isMD5":65,"./lib/isMagnetURI":66,"./lib/isMimeType":67,"./lib/isMobilePhone":68,"./lib/isMongoId":69,"./lib/isMultibyte":70,"./lib/isNumeric":71,"./lib/isOctal":72,"./lib/isPassportNumber":73,"./lib/isPort":74,"./lib/isPostalCode":75,"./lib/isRFC3339":76,"./lib/isRgbColor":77,"./lib/isSemVer":78,"./lib/isSlug":79,"./lib/isStrongPassword":80,"./lib/isSurrogatePair":81,"./lib/isTaxID":82,"./lib/isTime":83,"./lib/isURL":84,"./lib/isUUID":85,"./lib/isUppercase":86,"./lib/isVAT":87,"./lib/isVariableWidth":88,"./lib/isWhitelisted":89,"./lib/ltrim":90,"./lib/matches":91,"./lib/normalizeEmail":92,"./lib/rtrim":93,"./lib/stripLow":94,"./lib/toBoolean":95,"./lib/toDate":96,"./lib/toFloat":97,"./lib/toInt":98,"./lib/trim":99,"./lib/unescape":100,"./lib/whitelist":107}],5:[function(require,module,exports){
3285
3294
  "use strict";
3286
3295
 
3287
3296
  Object.defineProperty(exports, "__esModule", {
3288
3297
  value: true
3289
3298
  });
3290
- exports.commaDecimal = exports.dotDecimal = exports.farsiLocales = exports.arabicLocales = exports.englishLocales = exports.decimal = exports.alphanumeric = exports.alpha = void 0;
3299
+ exports.commaDecimal = exports.dotDecimal = exports.bengaliLocales = exports.farsiLocales = exports.arabicLocales = exports.englishLocales = exports.decimal = exports.alphanumeric = exports.alpha = void 0;
3291
3300
  var alpha = {
3292
3301
  'en-US': /^[A-Z]+$/i,
3293
3302
  'az-AZ': /^[A-VXYZÇƏĞİıÖŞÜ]+$/i,
@@ -3301,6 +3310,7 @@ var alpha = {
3301
3310
  'fi-FI': /^[A-ZÅÄÖ]+$/i,
3302
3311
  'fr-FR': /^[A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,
3303
3312
  'it-IT': /^[A-ZÀÉÈÌÎÓÒÙ]+$/i,
3313
+ 'ja-JP': /^[ぁ-んァ-ヶヲ-゚一-龠ー・。、]+$/i,
3304
3314
  'nb-NO': /^[A-ZÆØÅ]+$/i,
3305
3315
  'nl-NL': /^[A-ZÁÉËÏÓÖÜÚ]+$/i,
3306
3316
  'nn-NO': /^[A-ZÆØÅ]+$/i,
@@ -3317,11 +3327,14 @@ var alpha = {
3317
3327
  'tr-TR': /^[A-ZÇĞİıÖŞÜ]+$/i,
3318
3328
  'uk-UA': /^[А-ЩЬЮЯЄIЇҐі]+$/i,
3319
3329
  'vi-VN': /^[A-ZÀÁẠẢÃÂẦẤẬẨẪĂẰẮẶẲẴĐÈÉẸẺẼÊỀẾỆỂỄÌÍỊỈĨÒÓỌỎÕÔỒỐỘỔỖƠỜỚỢỞỠÙÚỤỦŨƯỪỨỰỬỮỲÝỴỶỸ]+$/i,
3330
+ 'ko-KR': /^[ㄱ-ㅎㅏ-ㅣ가-힣]*$/,
3320
3331
  'ku-IQ': /^[ئابپتجچحخدرڕزژسشعغفڤقکگلڵمنوۆھەیێيطؤثآإأكضصةظذ]+$/i,
3321
3332
  ar: /^[ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/,
3322
3333
  he: /^[א-ת]+$/,
3323
3334
  fa: /^['آاءأؤئبپتثجچحخدذرزژسشصضطظعغفقکگلمنوهةی']+$/i,
3324
- 'hi-IN': /^[\u0900-\u0961]+[\u0972-\u097F]*$/i
3335
+ bn: /^['ঀঁংঃঅআইঈউঊঋঌএঐওঔকখগঘঙচছজঝঞটঠডঢণতথদধনপফবভমযরলশষসহ়ঽািীুূৃৄেৈোৌ্ৎৗড়ঢ়য়ৠৡৢৣৰৱ৲৳৴৵৶৷৸৹৺৻']+$/,
3336
+ 'hi-IN': /^[\u0900-\u0961]+[\u0972-\u097F]*$/i,
3337
+ 'si-LK': /^[\u0D80-\u0DFF]+$/
3325
3338
  };
3326
3339
  exports.alpha = alpha;
3327
3340
  var alphanumeric = {
@@ -3336,6 +3349,7 @@ var alphanumeric = {
3336
3349
  'fi-FI': /^[0-9A-ZÅÄÖ]+$/i,
3337
3350
  'fr-FR': /^[0-9A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,
3338
3351
  'it-IT': /^[0-9A-ZÀÉÈÌÎÓÒÙ]+$/i,
3352
+ 'ja-JP': /^[0-90-9ぁ-んァ-ヶヲ-゚一-龠ー・。、]+$/i,
3339
3353
  'hu-HU': /^[0-9A-ZÁÉÍÓÖŐÚÜŰ]+$/i,
3340
3354
  'nb-NO': /^[0-9A-ZÆØÅ]+$/i,
3341
3355
  'nl-NL': /^[0-9A-ZÁÉËÏÓÖÜÚ]+$/i,
@@ -3351,12 +3365,15 @@ var alphanumeric = {
3351
3365
  'th-TH': /^[ก-๙\s]+$/i,
3352
3366
  'tr-TR': /^[0-9A-ZÇĞİıÖŞÜ]+$/i,
3353
3367
  'uk-UA': /^[0-9А-ЩЬЮЯЄIЇҐі]+$/i,
3368
+ 'ko-KR': /^[0-9ㄱ-ㅎㅏ-ㅣ가-힣]*$/,
3354
3369
  'ku-IQ': /^[٠١٢٣٤٥٦٧٨٩0-9ئابپتجچحخدرڕزژسشعغفڤقکگلڵمنوۆھەیێيطؤثآإأكضصةظذ]+$/i,
3355
3370
  'vi-VN': /^[0-9A-ZÀÁẠẢÃÂẦẤẬẨẪĂẰẮẶẲẴĐÈÉẸẺẼÊỀẾỆỂỄÌÍỊỈĨÒÓỌỎÕÔỒỐỘỔỖƠỜỚỢỞỠÙÚỤỦŨƯỪỨỰỬỮỲÝỴỶỸ]+$/i,
3356
3371
  ar: /^[٠١٢٣٤٥٦٧٨٩0-9ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/,
3357
3372
  he: /^[0-9א-ת]+$/,
3358
3373
  fa: /^['0-9آاءأؤئبپتثجچحخدذرزژسشصضطظعغفقکگلمنوهةی۱۲۳۴۵۶۷۸۹۰']+$/i,
3359
- 'hi-IN': /^[\u0900-\u0963]+[\u0966-\u097F]*$/i
3374
+ bn: /^['ঀঁংঃঅআইঈউঊঋঌএঐওঔকখগঘঙচছজঝঞটঠডঢণতথদধনপফবভমযরলশষসহ়ঽািীুূৃৄেৈোৌ্ৎৗড়ঢ়য়ৠৡৢৣ০১২৩৪৫৬৭৮৯ৰৱ৲৳৴৵৶৷৸৹৺৻']+$/,
3375
+ 'hi-IN': /^[\u0900-\u0963]+[\u0966-\u097F]*$/i,
3376
+ 'si-LK': /^[0-9\u0D80-\u0DFF]+$/
3360
3377
  };
3361
3378
  exports.alphanumeric = alphanumeric;
3362
3379
  var decimal = {
@@ -3392,20 +3409,30 @@ for (var _locale2, _i2 = 0; _i2 < farsiLocales.length; _i2++) {
3392
3409
  _locale2 = "fa-".concat(farsiLocales[_i2]);
3393
3410
  alphanumeric[_locale2] = alphanumeric.fa;
3394
3411
  decimal[_locale2] = decimal.ar;
3412
+ }
3413
+
3414
+ var bengaliLocales = ['BD', 'IN'];
3415
+ exports.bengaliLocales = bengaliLocales;
3416
+
3417
+ for (var _locale3, _i3 = 0; _i3 < bengaliLocales.length; _i3++) {
3418
+ _locale3 = "bn-".concat(bengaliLocales[_i3]);
3419
+ alpha[_locale3] = alpha.bn;
3420
+ alphanumeric[_locale3] = alphanumeric.bn;
3421
+ decimal[_locale3] = decimal['en-US'];
3395
3422
  } // Source: https://en.wikipedia.org/wiki/Decimal_mark
3396
3423
 
3397
3424
 
3398
3425
  var dotDecimal = ['ar-EG', 'ar-LB', 'ar-LY'];
3399
3426
  exports.dotDecimal = dotDecimal;
3400
- var commaDecimal = ['bg-BG', 'cs-CZ', 'da-DK', 'de-DE', 'el-GR', 'en-ZM', 'es-ES', 'fr-CA', 'fr-FR', 'id-ID', 'it-IT', 'ku-IQ', 'hi-IN', 'hu-HU', 'nb-NO', 'nn-NO', 'nl-NL', 'pl-PL', 'pt-PT', 'ru-RU', 'sl-SI', 'sr-RS@latin', 'sr-RS', 'sv-SE', 'tr-TR', 'uk-UA', 'vi-VN'];
3427
+ var commaDecimal = ['bg-BG', 'cs-CZ', 'da-DK', 'de-DE', 'el-GR', 'en-ZM', 'es-ES', 'fr-CA', 'fr-FR', 'id-ID', 'it-IT', 'ku-IQ', 'hi-IN', 'hu-HU', 'nb-NO', 'nn-NO', 'nl-NL', 'pl-PL', 'pt-PT', 'ru-RU', 'si-LK', 'sl-SI', 'sr-RS@latin', 'sr-RS', 'sv-SE', 'tr-TR', 'uk-UA', 'vi-VN'];
3401
3428
  exports.commaDecimal = commaDecimal;
3402
3429
 
3403
- for (var _i3 = 0; _i3 < dotDecimal.length; _i3++) {
3404
- decimal[dotDecimal[_i3]] = decimal['en-US'];
3430
+ for (var _i4 = 0; _i4 < dotDecimal.length; _i4++) {
3431
+ decimal[dotDecimal[_i4]] = decimal['en-US'];
3405
3432
  }
3406
3433
 
3407
- for (var _i4 = 0; _i4 < commaDecimal.length; _i4++) {
3408
- decimal[commaDecimal[_i4]] = ',';
3434
+ for (var _i5 = 0; _i5 < commaDecimal.length; _i5++) {
3435
+ decimal[commaDecimal[_i5]] = ',';
3409
3436
  }
3410
3437
 
3411
3438
  alpha['fr-CA'] = alpha['fr-FR'];
@@ -3438,7 +3465,7 @@ function blacklist(str, chars) {
3438
3465
 
3439
3466
  module.exports = exports.default;
3440
3467
  module.exports.default = exports.default;
3441
- },{"./util/assertString":99}],7:[function(require,module,exports){
3468
+ },{"./util/assertString":102}],7:[function(require,module,exports){
3442
3469
  "use strict";
3443
3470
 
3444
3471
  Object.defineProperty(exports, "__esModule", {
@@ -3472,7 +3499,7 @@ function contains(str, elem, options) {
3472
3499
 
3473
3500
  module.exports = exports.default;
3474
3501
  module.exports.default = exports.default;
3475
- },{"./util/assertString":99,"./util/merge":101,"./util/toString":103}],8:[function(require,module,exports){
3502
+ },{"./util/assertString":102,"./util/merge":104,"./util/toString":106}],8:[function(require,module,exports){
3476
3503
  "use strict";
3477
3504
 
3478
3505
  Object.defineProperty(exports, "__esModule", {
@@ -3491,7 +3518,7 @@ function equals(str, comparison) {
3491
3518
 
3492
3519
  module.exports = exports.default;
3493
3520
  module.exports.default = exports.default;
3494
- },{"./util/assertString":99}],9:[function(require,module,exports){
3521
+ },{"./util/assertString":102}],9:[function(require,module,exports){
3495
3522
  "use strict";
3496
3523
 
3497
3524
  Object.defineProperty(exports, "__esModule", {
@@ -3510,7 +3537,7 @@ function escape(str) {
3510
3537
 
3511
3538
  module.exports = exports.default;
3512
3539
  module.exports.default = exports.default;
3513
- },{"./util/assertString":99}],10:[function(require,module,exports){
3540
+ },{"./util/assertString":102}],10:[function(require,module,exports){
3514
3541
  "use strict";
3515
3542
 
3516
3543
  Object.defineProperty(exports, "__esModule", {
@@ -3518,23 +3545,22 @@ Object.defineProperty(exports, "__esModule", {
3518
3545
  });
3519
3546
  exports.default = isAfter;
3520
3547
 
3521
- var _assertString = _interopRequireDefault(require("./util/assertString"));
3522
-
3523
3548
  var _toDate = _interopRequireDefault(require("./toDate"));
3524
3549
 
3525
3550
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3526
3551
 
3527
- function isAfter(str) {
3528
- var date = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : String(new Date());
3529
- (0, _assertString.default)(str);
3530
- var comparison = (0, _toDate.default)(date);
3531
- var original = (0, _toDate.default)(str);
3552
+ function isAfter(date, options) {
3553
+ // For backwards compatibility:
3554
+ // isAfter(str [, date]), i.e. `options` could be used as argument for the legacy `date`
3555
+ var comparisonDate = (options === null || options === void 0 ? void 0 : options.comparisonDate) || options || Date().toString();
3556
+ var comparison = (0, _toDate.default)(comparisonDate);
3557
+ var original = (0, _toDate.default)(date);
3532
3558
  return !!(original && comparison && original > comparison);
3533
3559
  }
3534
3560
 
3535
3561
  module.exports = exports.default;
3536
3562
  module.exports.default = exports.default;
3537
- },{"./toDate":93,"./util/assertString":99}],11:[function(require,module,exports){
3563
+ },{"./toDate":96}],11:[function(require,module,exports){
3538
3564
  "use strict";
3539
3565
 
3540
3566
  Object.defineProperty(exports, "__esModule", {
@@ -3575,7 +3601,7 @@ function isAlpha(_str) {
3575
3601
 
3576
3602
  var locales = Object.keys(_alpha.alpha);
3577
3603
  exports.locales = locales;
3578
- },{"./alpha":5,"./util/assertString":99}],12:[function(require,module,exports){
3604
+ },{"./alpha":5,"./util/assertString":102}],12:[function(require,module,exports){
3579
3605
  "use strict";
3580
3606
 
3581
3607
  Object.defineProperty(exports, "__esModule", {
@@ -3616,7 +3642,7 @@ function isAlphanumeric(_str) {
3616
3642
 
3617
3643
  var locales = Object.keys(_alpha.alphanumeric);
3618
3644
  exports.locales = locales;
3619
- },{"./alpha":5,"./util/assertString":99}],13:[function(require,module,exports){
3645
+ },{"./alpha":5,"./util/assertString":102}],13:[function(require,module,exports){
3620
3646
  "use strict";
3621
3647
 
3622
3648
  Object.defineProperty(exports, "__esModule", {
@@ -3639,7 +3665,7 @@ function isAscii(str) {
3639
3665
 
3640
3666
  module.exports = exports.default;
3641
3667
  module.exports.default = exports.default;
3642
- },{"./util/assertString":99}],14:[function(require,module,exports){
3668
+ },{"./util/assertString":102}],14:[function(require,module,exports){
3643
3669
  "use strict";
3644
3670
 
3645
3671
  Object.defineProperty(exports, "__esModule", {
@@ -3660,7 +3686,9 @@ function isBIC(str) {
3660
3686
  (0, _assertString.default)(str); // toUpperCase() should be removed when a new major version goes out that changes
3661
3687
  // the regex to [A-Z] (per the spec).
3662
3688
 
3663
- if (!_isISO31661Alpha.CountryCodes.has(str.slice(4, 6).toUpperCase())) {
3689
+ var countryCode = str.slice(4, 6).toUpperCase();
3690
+
3691
+ if (!_isISO31661Alpha.CountryCodes.has(countryCode) && countryCode !== 'XK') {
3664
3692
  return false;
3665
3693
  }
3666
3694
 
@@ -3669,7 +3697,7 @@ function isBIC(str) {
3669
3697
 
3670
3698
  module.exports = exports.default;
3671
3699
  module.exports.default = exports.default;
3672
- },{"./isISO31661Alpha2":46,"./util/assertString":99}],15:[function(require,module,exports){
3700
+ },{"./isISO31661Alpha2":46,"./util/assertString":102}],15:[function(require,module,exports){
3673
3701
  "use strict";
3674
3702
 
3675
3703
  Object.defineProperty(exports, "__esModule", {
@@ -3679,12 +3707,24 @@ exports.default = isBase32;
3679
3707
 
3680
3708
  var _assertString = _interopRequireDefault(require("./util/assertString"));
3681
3709
 
3710
+ var _merge = _interopRequireDefault(require("./util/merge"));
3711
+
3682
3712
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3683
3713
 
3684
3714
  var base32 = /^[A-Z2-7]+=*$/;
3715
+ var crockfordBase32 = /^[A-HJKMNP-TV-Z0-9]+$/;
3716
+ var defaultBase32Options = {
3717
+ crockford: false
3718
+ };
3685
3719
 
3686
- function isBase32(str) {
3720
+ function isBase32(str, options) {
3687
3721
  (0, _assertString.default)(str);
3722
+ options = (0, _merge.default)(options, defaultBase32Options);
3723
+
3724
+ if (options.crockford) {
3725
+ return crockfordBase32.test(str);
3726
+ }
3727
+
3688
3728
  var len = str.length;
3689
3729
 
3690
3730
  if (len % 8 === 0 && base32.test(str)) {
@@ -3696,7 +3736,7 @@ function isBase32(str) {
3696
3736
 
3697
3737
  module.exports = exports.default;
3698
3738
  module.exports.default = exports.default;
3699
- },{"./util/assertString":99}],16:[function(require,module,exports){
3739
+ },{"./util/assertString":102,"./util/merge":104}],16:[function(require,module,exports){
3700
3740
  "use strict";
3701
3741
 
3702
3742
  Object.defineProperty(exports, "__esModule", {
@@ -3723,7 +3763,7 @@ function isBase58(str) {
3723
3763
 
3724
3764
  module.exports = exports.default;
3725
3765
  module.exports.default = exports.default;
3726
- },{"./util/assertString":99}],17:[function(require,module,exports){
3766
+ },{"./util/assertString":102}],17:[function(require,module,exports){
3727
3767
  "use strict";
3728
3768
 
3729
3769
  Object.defineProperty(exports, "__esModule", {
@@ -3762,7 +3802,7 @@ function isBase64(str, options) {
3762
3802
 
3763
3803
  module.exports = exports.default;
3764
3804
  module.exports.default = exports.default;
3765
- },{"./util/assertString":99,"./util/merge":101}],18:[function(require,module,exports){
3805
+ },{"./util/assertString":102,"./util/merge":104}],18:[function(require,module,exports){
3766
3806
  "use strict";
3767
3807
 
3768
3808
  Object.defineProperty(exports, "__esModule", {
@@ -3786,7 +3826,7 @@ function isBefore(str) {
3786
3826
 
3787
3827
  module.exports = exports.default;
3788
3828
  module.exports.default = exports.default;
3789
- },{"./toDate":93,"./util/assertString":99}],19:[function(require,module,exports){
3829
+ },{"./toDate":96,"./util/assertString":102}],19:[function(require,module,exports){
3790
3830
  "use strict";
3791
3831
 
3792
3832
  Object.defineProperty(exports, "__esModule", {
@@ -3817,7 +3857,7 @@ function isBoolean(str) {
3817
3857
 
3818
3858
  module.exports = exports.default;
3819
3859
  module.exports.default = exports.default;
3820
- },{"./util/assertString":99}],20:[function(require,module,exports){
3860
+ },{"./util/assertString":102}],20:[function(require,module,exports){
3821
3861
  "use strict";
3822
3862
 
3823
3863
  Object.defineProperty(exports, "__esModule", {
@@ -3829,23 +3869,17 @@ var _assertString = _interopRequireDefault(require("./util/assertString"));
3829
3869
 
3830
3870
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3831
3871
 
3832
- // supports Bech32 addresses
3833
3872
  var bech32 = /^(bc1)[a-z0-9]{25,39}$/;
3834
3873
  var base58 = /^(1|3)[A-HJ-NP-Za-km-z1-9]{25,39}$/;
3835
3874
 
3836
3875
  function isBtcAddress(str) {
3837
- (0, _assertString.default)(str); // check for bech32
3838
-
3839
- if (str.startsWith('bc1')) {
3840
- return bech32.test(str);
3841
- }
3842
-
3843
- return base58.test(str);
3876
+ (0, _assertString.default)(str);
3877
+ return bech32.test(str) || base58.test(str);
3844
3878
  }
3845
3879
 
3846
3880
  module.exports = exports.default;
3847
3881
  module.exports.default = exports.default;
3848
- },{"./util/assertString":99}],21:[function(require,module,exports){
3882
+ },{"./util/assertString":102}],21:[function(require,module,exports){
3849
3883
  "use strict";
3850
3884
 
3851
3885
  Object.defineProperty(exports, "__esModule", {
@@ -3880,7 +3914,7 @@ function isByteLength(str, options) {
3880
3914
 
3881
3915
  module.exports = exports.default;
3882
3916
  module.exports.default = exports.default;
3883
- },{"./util/assertString":99}],22:[function(require,module,exports){
3917
+ },{"./util/assertString":102}],22:[function(require,module,exports){
3884
3918
  "use strict";
3885
3919
 
3886
3920
  Object.defineProperty(exports, "__esModule", {
@@ -3890,50 +3924,50 @@ exports.default = isCreditCard;
3890
3924
 
3891
3925
  var _assertString = _interopRequireDefault(require("./util/assertString"));
3892
3926
 
3927
+ var _isLuhnNumber = _interopRequireDefault(require("./isLuhnNumber"));
3928
+
3893
3929
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3894
3930
 
3931
+ var cards = {
3932
+ amex: /^3[47][0-9]{13}$/,
3933
+ dinersclub: /^3(?:0[0-5]|[68][0-9])[0-9]{11}$/,
3934
+ discover: /^6(?:011|5[0-9][0-9])[0-9]{12,15}$/,
3935
+ jcb: /^(?:2131|1800|35\d{3})\d{11}$/,
3936
+ mastercard: /^5[1-5][0-9]{2}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}$/,
3937
+ // /^[25][1-7][0-9]{14}$/;
3938
+ unionpay: /^(6[27][0-9]{14}|^(81[0-9]{14,17}))$/,
3939
+ visa: /^(?:4[0-9]{12})(?:[0-9]{3,6})?$/
3940
+ };
3895
3941
  /* eslint-disable max-len */
3896
- var creditCard = /^(?:4[0-9]{12}(?:[0-9]{3,6})?|5[1-5][0-9]{14}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}|6(?:011|5[0-9][0-9])[0-9]{12,15}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11}|6[27][0-9]{14}|^(81[0-9]{14,17}))$/;
3897
- /* eslint-enable max-len */
3898
-
3899
- function isCreditCard(str) {
3900
- (0, _assertString.default)(str);
3901
- var sanitized = str.replace(/[- ]+/g, '');
3902
3942
 
3903
- if (!creditCard.test(sanitized)) {
3904
- return false;
3905
- }
3906
-
3907
- var sum = 0;
3908
- var digit;
3909
- var tmpNum;
3910
- var shouldDouble;
3911
-
3912
- for (var i = sanitized.length - 1; i >= 0; i--) {
3913
- digit = sanitized.substring(i, i + 1);
3914
- tmpNum = parseInt(digit, 10);
3943
+ var allCards = /^(?:4[0-9]{12}(?:[0-9]{3,6})?|5[1-5][0-9]{14}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}|6(?:011|5[0-9][0-9])[0-9]{12,15}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11}|6[27][0-9]{14}|^(81[0-9]{14,17}))$/;
3944
+ /* eslint-enable max-len */
3915
3945
 
3916
- if (shouldDouble) {
3917
- tmpNum *= 2;
3946
+ function isCreditCard(card) {
3947
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
3948
+ (0, _assertString.default)(card);
3949
+ var provider = options.provider;
3950
+ var sanitized = card.replace(/[- ]+/g, '');
3918
3951
 
3919
- if (tmpNum >= 10) {
3920
- sum += tmpNum % 10 + 1;
3921
- } else {
3922
- sum += tmpNum;
3923
- }
3924
- } else {
3925
- sum += tmpNum;
3952
+ if (provider && provider.toLowerCase() in cards) {
3953
+ // specific provider in the list
3954
+ if (!cards[provider.toLowerCase()].test(sanitized)) {
3955
+ return false;
3926
3956
  }
3927
-
3928
- shouldDouble = !shouldDouble;
3957
+ } else if (provider && !(provider.toLowerCase() in cards)) {
3958
+ /* specific provider not in the list */
3959
+ throw new Error("".concat(provider, " is not a valid credit card provider."));
3960
+ } else if (!allCards.test(sanitized)) {
3961
+ // no specific provider
3962
+ return false;
3929
3963
  }
3930
3964
 
3931
- return !!(sum % 10 === 0 ? sanitized : false);
3965
+ return (0, _isLuhnNumber.default)(card);
3932
3966
  }
3933
3967
 
3934
3968
  module.exports = exports.default;
3935
3969
  module.exports.default = exports.default;
3936
- },{"./util/assertString":99}],23:[function(require,module,exports){
3970
+ },{"./isLuhnNumber":63,"./util/assertString":102}],23:[function(require,module,exports){
3937
3971
  "use strict";
3938
3972
 
3939
3973
  Object.defineProperty(exports, "__esModule", {
@@ -4025,7 +4059,7 @@ function isCurrency(str, options) {
4025
4059
 
4026
4060
  module.exports = exports.default;
4027
4061
  module.exports.default = exports.default;
4028
- },{"./util/assertString":99,"./util/merge":101}],24:[function(require,module,exports){
4062
+ },{"./util/assertString":102,"./util/merge":104}],24:[function(require,module,exports){
4029
4063
  "use strict";
4030
4064
 
4031
4065
  Object.defineProperty(exports, "__esModule", {
@@ -4037,7 +4071,7 @@ var _assertString = _interopRequireDefault(require("./util/assertString"));
4037
4071
 
4038
4072
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
4039
4073
 
4040
- var validMediaType = /^[a-z]+\/[a-z0-9\-\+]+$/i;
4074
+ var validMediaType = /^[a-z]+\/[a-z0-9\-\+\._]+$/i;
4041
4075
  var validAttribute = /^[a-z\-]+=[a-z0-9\-]+$/i;
4042
4076
  var validData = /^[a-z0-9!\$&'\(\)\*\+,;=\-\._~:@\/\?%\s]*$/i;
4043
4077
 
@@ -4052,11 +4086,11 @@ function isDataURI(str) {
4052
4086
  var attributes = data.shift().trim().split(';');
4053
4087
  var schemeAndMediaType = attributes.shift();
4054
4088
 
4055
- if (schemeAndMediaType.substr(0, 5) !== 'data:') {
4089
+ if (schemeAndMediaType.slice(0, 5) !== 'data:') {
4056
4090
  return false;
4057
4091
  }
4058
4092
 
4059
- var mediaType = schemeAndMediaType.substr(5);
4093
+ var mediaType = schemeAndMediaType.slice(5);
4060
4094
 
4061
4095
  if (mediaType !== '' && !validMediaType.test(mediaType)) {
4062
4096
  return false;
@@ -4079,7 +4113,7 @@ function isDataURI(str) {
4079
4113
 
4080
4114
  module.exports = exports.default;
4081
4115
  module.exports.default = exports.default;
4082
- },{"./util/assertString":99}],25:[function(require,module,exports){
4116
+ },{"./util/assertString":102}],25:[function(require,module,exports){
4083
4117
  "use strict";
4084
4118
 
4085
4119
  Object.defineProperty(exports, "__esModule", {
@@ -4179,7 +4213,7 @@ function isDate(input, options) {
4179
4213
 
4180
4214
  module.exports = exports.default;
4181
4215
  module.exports.default = exports.default;
4182
- },{"./util/merge":101}],26:[function(require,module,exports){
4216
+ },{"./util/merge":104}],26:[function(require,module,exports){
4183
4217
  "use strict";
4184
4218
 
4185
4219
  Object.defineProperty(exports, "__esModule", {
@@ -4222,7 +4256,7 @@ function isDecimal(str, options) {
4222
4256
 
4223
4257
  module.exports = exports.default;
4224
4258
  module.exports.default = exports.default;
4225
- },{"./alpha":5,"./util/assertString":99,"./util/includes":100,"./util/merge":101}],27:[function(require,module,exports){
4259
+ },{"./alpha":5,"./util/assertString":102,"./util/includes":103,"./util/merge":104}],27:[function(require,module,exports){
4226
4260
  "use strict";
4227
4261
 
4228
4262
  Object.defineProperty(exports, "__esModule", {
@@ -4243,7 +4277,7 @@ function isDivisibleBy(str, num) {
4243
4277
 
4244
4278
  module.exports = exports.default;
4245
4279
  module.exports.default = exports.default;
4246
- },{"./toFloat":94,"./util/assertString":99}],28:[function(require,module,exports){
4280
+ },{"./toFloat":97,"./util/assertString":102}],28:[function(require,module,exports){
4247
4281
  "use strict";
4248
4282
 
4249
4283
  Object.defineProperty(exports, "__esModule", {
@@ -4329,7 +4363,7 @@ function isEAN(str) {
4329
4363
 
4330
4364
  module.exports = exports.default;
4331
4365
  module.exports.default = exports.default;
4332
- },{"./util/assertString":99}],29:[function(require,module,exports){
4366
+ },{"./util/assertString":102}],29:[function(require,module,exports){
4333
4367
  "use strict";
4334
4368
 
4335
4369
  Object.defineProperty(exports, "__esModule", {
@@ -4356,7 +4390,8 @@ var default_email_options = {
4356
4390
  require_tld: true,
4357
4391
  blacklisted_chars: '',
4358
4392
  ignore_max_length: false,
4359
- host_blacklist: []
4393
+ host_blacklist: [],
4394
+ host_whitelist: []
4360
4395
  };
4361
4396
  /* eslint-disable max-len */
4362
4397
 
@@ -4423,7 +4458,7 @@ function isEmail(str, options) {
4423
4458
  // the display name is `myname` instead of `myname `, so need to trim the last space
4424
4459
 
4425
4460
  if (display_name.endsWith(' ')) {
4426
- display_name = display_name.substr(0, display_name.length - 1);
4461
+ display_name = display_name.slice(0, -1);
4427
4462
  }
4428
4463
 
4429
4464
  if (!validateDisplayName(display_name)) {
@@ -4446,6 +4481,10 @@ function isEmail(str, options) {
4446
4481
  return false;
4447
4482
  }
4448
4483
 
4484
+ if (options.host_whitelist.length > 0 && !options.host_whitelist.includes(lower_domain)) {
4485
+ return false;
4486
+ }
4487
+
4449
4488
  var user = parts.join('@');
4450
4489
 
4451
4490
  if (options.domain_specific_validation && (lower_domain === 'gmail.com' || lower_domain === 'googlemail.com')) {
@@ -4485,7 +4524,8 @@ function isEmail(str, options) {
4485
4524
  }
4486
4525
 
4487
4526
  if (!(0, _isFQDN.default)(domain, {
4488
- require_tld: options.require_tld
4527
+ require_tld: options.require_tld,
4528
+ ignore_max_length: options.ignore_max_length
4489
4529
  })) {
4490
4530
  if (!options.allow_ip_domain) {
4491
4531
  return false;
@@ -4496,7 +4536,7 @@ function isEmail(str, options) {
4496
4536
  return false;
4497
4537
  }
4498
4538
 
4499
- var noBracketdomain = domain.substr(1, domain.length - 2);
4539
+ var noBracketdomain = domain.slice(1, -1);
4500
4540
 
4501
4541
  if (noBracketdomain.length === 0 || !(0, _isIP.default)(noBracketdomain)) {
4502
4542
  return false;
@@ -4527,7 +4567,7 @@ function isEmail(str, options) {
4527
4567
 
4528
4568
  module.exports = exports.default;
4529
4569
  module.exports.default = exports.default;
4530
- },{"./isByteLength":21,"./isFQDN":32,"./isIP":42,"./util/assertString":99,"./util/merge":101}],30:[function(require,module,exports){
4570
+ },{"./isByteLength":21,"./isFQDN":32,"./isIP":42,"./util/assertString":102,"./util/merge":104}],30:[function(require,module,exports){
4531
4571
  "use strict";
4532
4572
 
4533
4573
  Object.defineProperty(exports, "__esModule", {
@@ -4553,7 +4593,7 @@ function isEmpty(str, options) {
4553
4593
 
4554
4594
  module.exports = exports.default;
4555
4595
  module.exports.default = exports.default;
4556
- },{"./util/assertString":99,"./util/merge":101}],31:[function(require,module,exports){
4596
+ },{"./util/assertString":102,"./util/merge":104}],31:[function(require,module,exports){
4557
4597
  "use strict";
4558
4598
 
4559
4599
  Object.defineProperty(exports, "__esModule", {
@@ -4574,7 +4614,7 @@ function isEthereumAddress(str) {
4574
4614
 
4575
4615
  module.exports = exports.default;
4576
4616
  module.exports.default = exports.default;
4577
- },{"./util/assertString":99}],32:[function(require,module,exports){
4617
+ },{"./util/assertString":102}],32:[function(require,module,exports){
4578
4618
  "use strict";
4579
4619
 
4580
4620
  Object.defineProperty(exports, "__esModule", {
@@ -4593,7 +4633,8 @@ var default_fqdn_options = {
4593
4633
  allow_underscores: false,
4594
4634
  allow_trailing_dot: false,
4595
4635
  allow_numeric_tld: false,
4596
- allow_wildcard: false
4636
+ allow_wildcard: false,
4637
+ ignore_max_length: false
4597
4638
  };
4598
4639
 
4599
4640
  function isFQDN(str, options) {
@@ -4620,7 +4661,7 @@ function isFQDN(str, options) {
4620
4661
  return false;
4621
4662
  }
4622
4663
 
4623
- if (!/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(tld)) {
4664
+ if (!options.allow_numeric_tld && !/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(tld)) {
4624
4665
  return false;
4625
4666
  } // disallow spaces
4626
4667
 
@@ -4636,7 +4677,7 @@ function isFQDN(str, options) {
4636
4677
  }
4637
4678
 
4638
4679
  return parts.every(function (part) {
4639
- if (part.length > 63) {
4680
+ if (part.length > 63 && !options.ignore_max_length) {
4640
4681
  return false;
4641
4682
  }
4642
4683
 
@@ -4664,7 +4705,7 @@ function isFQDN(str, options) {
4664
4705
 
4665
4706
  module.exports = exports.default;
4666
4707
  module.exports.default = exports.default;
4667
- },{"./util/assertString":99,"./util/merge":101}],33:[function(require,module,exports){
4708
+ },{"./util/assertString":102,"./util/merge":104}],33:[function(require,module,exports){
4668
4709
  "use strict";
4669
4710
 
4670
4711
  Object.defineProperty(exports, "__esModule", {
@@ -4684,7 +4725,7 @@ function isFloat(str, options) {
4684
4725
  options = options || {};
4685
4726
  var float = new RegExp("^(?:[-+])?(?:[0-9]+)?(?:\\".concat(options.locale ? _alpha.decimal[options.locale] : '.', "[0-9]*)?(?:[eE][\\+\\-]?(?:[0-9]+))?$"));
4686
4727
 
4687
- if (str === '' || str === '.' || str === '-' || str === '+') {
4728
+ if (str === '' || str === '.' || str === ',' || str === '-' || str === '+') {
4688
4729
  return false;
4689
4730
  }
4690
4731
 
@@ -4694,7 +4735,7 @@ function isFloat(str, options) {
4694
4735
 
4695
4736
  var locales = Object.keys(_alpha.decimal);
4696
4737
  exports.locales = locales;
4697
- },{"./alpha":5,"./util/assertString":99}],34:[function(require,module,exports){
4738
+ },{"./alpha":5,"./util/assertString":102}],34:[function(require,module,exports){
4698
4739
  "use strict";
4699
4740
 
4700
4741
  Object.defineProperty(exports, "__esModule", {
@@ -4714,7 +4755,7 @@ function isFullWidth(str) {
4714
4755
  (0, _assertString.default)(str);
4715
4756
  return fullWidth.test(str);
4716
4757
  }
4717
- },{"./util/assertString":99}],35:[function(require,module,exports){
4758
+ },{"./util/assertString":102}],35:[function(require,module,exports){
4718
4759
  "use strict";
4719
4760
 
4720
4761
  Object.defineProperty(exports, "__esModule", {
@@ -4743,7 +4784,7 @@ function isHSL(str) {
4743
4784
 
4744
4785
  module.exports = exports.default;
4745
4786
  module.exports.default = exports.default;
4746
- },{"./util/assertString":99}],36:[function(require,module,exports){
4787
+ },{"./util/assertString":102}],36:[function(require,module,exports){
4747
4788
  "use strict";
4748
4789
 
4749
4790
  Object.defineProperty(exports, "__esModule", {
@@ -4763,7 +4804,7 @@ function isHalfWidth(str) {
4763
4804
  (0, _assertString.default)(str);
4764
4805
  return halfWidth.test(str);
4765
4806
  }
4766
- },{"./util/assertString":99}],37:[function(require,module,exports){
4807
+ },{"./util/assertString":102}],37:[function(require,module,exports){
4767
4808
  "use strict";
4768
4809
 
4769
4810
  Object.defineProperty(exports, "__esModule", {
@@ -4799,7 +4840,7 @@ function isHash(str, algorithm) {
4799
4840
 
4800
4841
  module.exports = exports.default;
4801
4842
  module.exports.default = exports.default;
4802
- },{"./util/assertString":99}],38:[function(require,module,exports){
4843
+ },{"./util/assertString":102}],38:[function(require,module,exports){
4803
4844
  "use strict";
4804
4845
 
4805
4846
  Object.defineProperty(exports, "__esModule", {
@@ -4820,7 +4861,7 @@ function isHexColor(str) {
4820
4861
 
4821
4862
  module.exports = exports.default;
4822
4863
  module.exports.default = exports.default;
4823
- },{"./util/assertString":99}],39:[function(require,module,exports){
4864
+ },{"./util/assertString":102}],39:[function(require,module,exports){
4824
4865
  "use strict";
4825
4866
 
4826
4867
  Object.defineProperty(exports, "__esModule", {
@@ -4841,7 +4882,7 @@ function isHexadecimal(str) {
4841
4882
 
4842
4883
  module.exports = exports.default;
4843
4884
  module.exports.default = exports.default;
4844
- },{"./util/assertString":99}],40:[function(require,module,exports){
4885
+ },{"./util/assertString":102}],40:[function(require,module,exports){
4845
4886
  "use strict";
4846
4887
 
4847
4888
  Object.defineProperty(exports, "__esModule", {
@@ -4992,7 +5033,7 @@ function isIBAN(str) {
4992
5033
 
4993
5034
  var locales = Object.keys(ibanRegexThroughCountryCode);
4994
5035
  exports.locales = locales;
4995
- },{"./util/assertString":99}],41:[function(require,module,exports){
5036
+ },{"./util/assertString":102}],41:[function(require,module,exports){
4996
5037
  "use strict";
4997
5038
 
4998
5039
  Object.defineProperty(exports, "__esModule", {
@@ -5054,7 +5095,7 @@ function isIMEI(str, options) {
5054
5095
 
5055
5096
  module.exports = exports.default;
5056
5097
  module.exports.default = exports.default;
5057
- },{"./util/assertString":99}],42:[function(require,module,exports){
5098
+ },{"./util/assertString":102}],42:[function(require,module,exports){
5058
5099
  "use strict";
5059
5100
 
5060
5101
  Object.defineProperty(exports, "__esModule", {
@@ -5111,18 +5152,11 @@ function isIP(str) {
5111
5152
  }
5112
5153
 
5113
5154
  if (version === '4') {
5114
- if (!IPv4AddressRegExp.test(str)) {
5115
- return false;
5116
- }
5117
-
5118
- var parts = str.split('.').sort(function (a, b) {
5119
- return a - b;
5120
- });
5121
- return parts[3] <= 255;
5155
+ return IPv4AddressRegExp.test(str);
5122
5156
  }
5123
5157
 
5124
5158
  if (version === '6') {
5125
- return !!IPv6AddressRegExp.test(str);
5159
+ return IPv6AddressRegExp.test(str);
5126
5160
  }
5127
5161
 
5128
5162
  return false;
@@ -5130,7 +5164,7 @@ function isIP(str) {
5130
5164
 
5131
5165
  module.exports = exports.default;
5132
5166
  module.exports.default = exports.default;
5133
- },{"./util/assertString":99}],43:[function(require,module,exports){
5167
+ },{"./util/assertString":102}],43:[function(require,module,exports){
5134
5168
  "use strict";
5135
5169
 
5136
5170
  Object.defineProperty(exports, "__esModule", {
@@ -5193,7 +5227,7 @@ function isIPRange(str) {
5193
5227
 
5194
5228
  module.exports = exports.default;
5195
5229
  module.exports.default = exports.default;
5196
- },{"./isIP":42,"./util/assertString":99}],44:[function(require,module,exports){
5230
+ },{"./isIP":42,"./util/assertString":102}],44:[function(require,module,exports){
5197
5231
  "use strict";
5198
5232
 
5199
5233
  Object.defineProperty(exports, "__esModule", {
@@ -5205,52 +5239,56 @@ var _assertString = _interopRequireDefault(require("./util/assertString"));
5205
5239
 
5206
5240
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
5207
5241
 
5208
- var isbn10Maybe = /^(?:[0-9]{9}X|[0-9]{10})$/;
5209
- var isbn13Maybe = /^(?:[0-9]{13})$/;
5242
+ var possibleIsbn10 = /^(?:[0-9]{9}X|[0-9]{10})$/;
5243
+ var possibleIsbn13 = /^(?:[0-9]{13})$/;
5210
5244
  var factor = [1, 3];
5211
5245
 
5212
- function isISBN(str) {
5213
- var version = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
5214
- (0, _assertString.default)(str);
5215
- version = String(version);
5246
+ function isISBN(isbn, options) {
5247
+ (0, _assertString.default)(isbn); // For backwards compatibility:
5248
+ // isISBN(str [, version]), i.e. `options` could be used as argument for the legacy `version`
5216
5249
 
5217
- if (!version) {
5218
- return isISBN(str, 10) || isISBN(str, 13);
5250
+ var version = String((options === null || options === void 0 ? void 0 : options.version) || options);
5251
+
5252
+ if (!(options !== null && options !== void 0 && options.version || options)) {
5253
+ return isISBN(isbn, {
5254
+ version: 10
5255
+ }) || isISBN(isbn, {
5256
+ version: 13
5257
+ });
5219
5258
  }
5220
5259
 
5221
- var sanitized = str.replace(/[\s-]+/g, '');
5260
+ var sanitizedIsbn = isbn.replace(/[\s-]+/g, '');
5222
5261
  var checksum = 0;
5223
- var i;
5224
5262
 
5225
5263
  if (version === '10') {
5226
- if (!isbn10Maybe.test(sanitized)) {
5264
+ if (!possibleIsbn10.test(sanitizedIsbn)) {
5227
5265
  return false;
5228
5266
  }
5229
5267
 
5230
- for (i = 0; i < 9; i++) {
5231
- checksum += (i + 1) * sanitized.charAt(i);
5268
+ for (var i = 0; i < version - 1; i++) {
5269
+ checksum += (i + 1) * sanitizedIsbn.charAt(i);
5232
5270
  }
5233
5271
 
5234
- if (sanitized.charAt(9) === 'X') {
5272
+ if (sanitizedIsbn.charAt(9) === 'X') {
5235
5273
  checksum += 10 * 10;
5236
5274
  } else {
5237
- checksum += 10 * sanitized.charAt(9);
5275
+ checksum += 10 * sanitizedIsbn.charAt(9);
5238
5276
  }
5239
5277
 
5240
5278
  if (checksum % 11 === 0) {
5241
- return !!sanitized;
5279
+ return true;
5242
5280
  }
5243
5281
  } else if (version === '13') {
5244
- if (!isbn13Maybe.test(sanitized)) {
5282
+ if (!possibleIsbn13.test(sanitizedIsbn)) {
5245
5283
  return false;
5246
5284
  }
5247
5285
 
5248
- for (i = 0; i < 12; i++) {
5249
- checksum += factor[i % 2] * sanitized.charAt(i);
5286
+ for (var _i = 0; _i < 12; _i++) {
5287
+ checksum += factor[_i % 2] * sanitizedIsbn.charAt(_i);
5250
5288
  }
5251
5289
 
5252
- if (sanitized.charAt(12) - (10 - checksum % 10) % 10 === 0) {
5253
- return !!sanitized;
5290
+ if (sanitizedIsbn.charAt(12) - (10 - checksum % 10) % 10 === 0) {
5291
+ return true;
5254
5292
  }
5255
5293
  }
5256
5294
 
@@ -5259,7 +5297,7 @@ function isISBN(str) {
5259
5297
 
5260
5298
  module.exports = exports.default;
5261
5299
  module.exports.default = exports.default;
5262
- },{"./util/assertString":99}],45:[function(require,module,exports){
5300
+ },{"./util/assertString":102}],45:[function(require,module,exports){
5263
5301
  "use strict";
5264
5302
 
5265
5303
  Object.defineProperty(exports, "__esModule", {
@@ -5333,7 +5371,7 @@ function isISIN(str) {
5333
5371
 
5334
5372
  module.exports = exports.default;
5335
5373
  module.exports.default = exports.default;
5336
- },{"./util/assertString":99}],46:[function(require,module,exports){
5374
+ },{"./util/assertString":102}],46:[function(require,module,exports){
5337
5375
  "use strict";
5338
5376
 
5339
5377
  Object.defineProperty(exports, "__esModule", {
@@ -5356,7 +5394,7 @@ function isISO31661Alpha2(str) {
5356
5394
 
5357
5395
  var CountryCodes = validISO31661Alpha2CountriesCodes;
5358
5396
  exports.CountryCodes = CountryCodes;
5359
- },{"./util/assertString":99}],47:[function(require,module,exports){
5397
+ },{"./util/assertString":102}],47:[function(require,module,exports){
5360
5398
  "use strict";
5361
5399
 
5362
5400
  Object.defineProperty(exports, "__esModule", {
@@ -5378,7 +5416,7 @@ function isISO31661Alpha3(str) {
5378
5416
 
5379
5417
  module.exports = exports.default;
5380
5418
  module.exports.default = exports.default;
5381
- },{"./util/assertString":99}],48:[function(require,module,exports){
5419
+ },{"./util/assertString":102}],48:[function(require,module,exports){
5382
5420
  "use strict";
5383
5421
 
5384
5422
  Object.defineProperty(exports, "__esModule", {
@@ -5401,7 +5439,28 @@ function isISO4217(str) {
5401
5439
 
5402
5440
  var CurrencyCodes = validISO4217CurrencyCodes;
5403
5441
  exports.CurrencyCodes = CurrencyCodes;
5404
- },{"./util/assertString":99}],49:[function(require,module,exports){
5442
+ },{"./util/assertString":102}],49:[function(require,module,exports){
5443
+ "use strict";
5444
+
5445
+ Object.defineProperty(exports, "__esModule", {
5446
+ value: true
5447
+ });
5448
+ exports.default = isISO6391;
5449
+
5450
+ var _assertString = _interopRequireDefault(require("./util/assertString"));
5451
+
5452
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
5453
+
5454
+ var isISO6391Set = new Set(['aa', 'ab', 'ae', 'af', 'ak', 'am', 'an', 'ar', 'as', 'av', 'ay', 'az', 'az', 'ba', 'be', 'bg', 'bh', 'bi', 'bm', 'bn', 'bo', 'br', 'bs', 'ca', 'ce', 'ch', 'co', 'cr', 'cs', 'cu', 'cv', 'cy', 'da', 'de', 'dv', 'dz', 'ee', 'el', 'en', 'eo', 'es', 'et', 'eu', 'fa', 'ff', 'fi', 'fj', 'fo', 'fr', 'fy', 'ga', 'gd', 'gl', 'gn', 'gu', 'gv', 'ha', 'he', 'hi', 'ho', 'hr', 'ht', 'hu', 'hy', 'hz', 'ia', 'id', 'ie', 'ig', 'ii', 'ik', 'io', 'is', 'it', 'iu', 'ja', 'jv', 'ka', 'kg', 'ki', 'kj', 'kk', 'kl', 'km', 'kn', 'ko', 'kr', 'ks', 'ku', 'kv', 'kw', 'ky', 'la', 'lb', 'lg', 'li', 'ln', 'lo', 'lt', 'lu', 'lv', 'mg', 'mh', 'mi', 'mk', 'ml', 'mn', 'mr', 'ms', 'mt', 'my', 'na', 'nb', 'nd', 'ne', 'ng', 'nl', 'nn', 'no', 'nr', 'nv', 'ny', 'oc', 'oj', 'om', 'or', 'os', 'pa', 'pi', 'pl', 'ps', 'pt', 'qu', 'rm', 'rn', 'ro', 'ru', 'rw', 'sa', 'sc', 'sd', 'se', 'sg', 'si', 'sk', 'sl', 'sm', 'sn', 'so', 'sq', 'sr', 'ss', 'st', 'su', 'sv', 'sw', 'ta', 'te', 'tg', 'th', 'ti', 'tk', 'tl', 'tn', 'to', 'tr', 'ts', 'tt', 'tw', 'ty', 'ug', 'uk', 'ur', 'uz', 've', 'vi', 'vo', 'wa', 'wo', 'xh', 'yi', 'yo', 'za', 'zh', 'zu']);
5455
+
5456
+ function isISO6391(str) {
5457
+ (0, _assertString.default)(str);
5458
+ return isISO6391Set.has(str);
5459
+ }
5460
+
5461
+ module.exports = exports.default;
5462
+ module.exports.default = exports.default;
5463
+ },{"./util/assertString":102}],50:[function(require,module,exports){
5405
5464
  "use strict";
5406
5465
 
5407
5466
  Object.defineProperty(exports, "__esModule", {
@@ -5461,7 +5520,7 @@ function isISO8601(str) {
5461
5520
 
5462
5521
  module.exports = exports.default;
5463
5522
  module.exports.default = exports.default;
5464
- },{"./util/assertString":99}],50:[function(require,module,exports){
5523
+ },{"./util/assertString":102}],51:[function(require,module,exports){
5465
5524
  "use strict";
5466
5525
 
5467
5526
  Object.defineProperty(exports, "__esModule", {
@@ -5483,7 +5542,7 @@ function isISRC(str) {
5483
5542
 
5484
5543
  module.exports = exports.default;
5485
5544
  module.exports.default = exports.default;
5486
- },{"./util/assertString":99}],51:[function(require,module,exports){
5545
+ },{"./util/assertString":102}],52:[function(require,module,exports){
5487
5546
  "use strict";
5488
5547
 
5489
5548
  Object.defineProperty(exports, "__esModule", {
@@ -5521,7 +5580,7 @@ function isISSN(str) {
5521
5580
 
5522
5581
  module.exports = exports.default;
5523
5582
  module.exports.default = exports.default;
5524
- },{"./util/assertString":99}],52:[function(require,module,exports){
5583
+ },{"./util/assertString":102}],53:[function(require,module,exports){
5525
5584
  "use strict";
5526
5585
 
5527
5586
  Object.defineProperty(exports, "__esModule", {
@@ -5631,13 +5690,13 @@ var validators = {
5631
5690
  },
5632
5691
  IR: function IR(str) {
5633
5692
  if (!str.match(/^\d{10}$/)) return false;
5634
- str = "0000".concat(str).substr(str.length - 6);
5635
- if (parseInt(str.substr(3, 6), 10) === 0) return false;
5636
- var lastNumber = parseInt(str.substr(9, 1), 10);
5693
+ str = "0000".concat(str).slice(str.length - 6);
5694
+ if (parseInt(str.slice(3, 9), 10) === 0) return false;
5695
+ var lastNumber = parseInt(str.slice(9, 10), 10);
5637
5696
  var sum = 0;
5638
5697
 
5639
5698
  for (var i = 0; i < 9; i++) {
5640
- sum += parseInt(str.substr(i, 1), 10) * (10 - i);
5699
+ sum += parseInt(str.slice(i, i + 1), 10) * (10 - i);
5641
5700
  }
5642
5701
 
5643
5702
  sum %= 11;
@@ -5834,6 +5893,32 @@ var validators = {
5834
5893
 
5835
5894
  return checkIdCardNo(str);
5836
5895
  },
5896
+ 'zh-HK': function zhHK(str) {
5897
+ // sanitize user input
5898
+ str = str.trim(); // HKID number starts with 1 or 2 letters, followed by 6 digits,
5899
+ // then a checksum contained in square / round brackets or nothing
5900
+
5901
+ var regexHKID = /^[A-Z]{1,2}[0-9]{6}((\([0-9A]\))|(\[[0-9A]\])|([0-9A]))$/;
5902
+ var regexIsDigit = /^[0-9]$/; // convert the user input to all uppercase and apply regex
5903
+
5904
+ str = str.toUpperCase();
5905
+ if (!regexHKID.test(str)) return false;
5906
+ str = str.replace(/\[|\]|\(|\)/g, '');
5907
+ if (str.length === 8) str = "3".concat(str);
5908
+ var checkSumVal = 0;
5909
+
5910
+ for (var i = 0; i <= 7; i++) {
5911
+ var convertedChar = void 0;
5912
+ if (!regexIsDigit.test(str[i])) convertedChar = (str[i].charCodeAt(0) - 55) % 11;else convertedChar = str[i];
5913
+ checkSumVal += convertedChar * (9 - i);
5914
+ }
5915
+
5916
+ checkSumVal %= 11;
5917
+ var checkSumConverted;
5918
+ if (checkSumVal === 0) checkSumConverted = '0';else if (checkSumVal === 1) checkSumConverted = 'A';else checkSumConverted = String(11 - checkSumVal);
5919
+ if (checkSumConverted === str[str.length - 1]) return true;
5920
+ return false;
5921
+ },
5837
5922
  'zh-TW': function zhTW(str) {
5838
5923
  var ALPHABET_CODES = {
5839
5924
  A: 10,
@@ -5906,7 +5991,7 @@ function isIdentityCard(str, locale) {
5906
5991
 
5907
5992
  module.exports = exports.default;
5908
5993
  module.exports.default = exports.default;
5909
- },{"./isInt":54,"./util/assertString":99}],53:[function(require,module,exports){
5994
+ },{"./isInt":55,"./util/assertString":102}],54:[function(require,module,exports){
5910
5995
  "use strict";
5911
5996
 
5912
5997
  Object.defineProperty(exports, "__esModule", {
@@ -5949,7 +6034,7 @@ function isIn(str, options) {
5949
6034
 
5950
6035
  module.exports = exports.default;
5951
6036
  module.exports.default = exports.default;
5952
- },{"./util/assertString":99,"./util/toString":103}],54:[function(require,module,exports){
6037
+ },{"./util/assertString":102,"./util/toString":106}],55:[function(require,module,exports){
5953
6038
  "use strict";
5954
6039
 
5955
6040
  Object.defineProperty(exports, "__esModule", {
@@ -5980,7 +6065,7 @@ function isInt(str, options) {
5980
6065
 
5981
6066
  module.exports = exports.default;
5982
6067
  module.exports.default = exports.default;
5983
- },{"./util/assertString":99}],55:[function(require,module,exports){
6068
+ },{"./util/assertString":102}],56:[function(require,module,exports){
5984
6069
  "use strict";
5985
6070
 
5986
6071
  Object.defineProperty(exports, "__esModule", {
@@ -6022,7 +6107,7 @@ function isJSON(str, options) {
6022
6107
 
6023
6108
  module.exports = exports.default;
6024
6109
  module.exports.default = exports.default;
6025
- },{"./util/assertString":99,"./util/merge":101}],56:[function(require,module,exports){
6110
+ },{"./util/assertString":102,"./util/merge":104}],57:[function(require,module,exports){
6026
6111
  "use strict";
6027
6112
 
6028
6113
  Object.defineProperty(exports, "__esModule", {
@@ -6054,7 +6139,7 @@ function isJWT(str) {
6054
6139
 
6055
6140
  module.exports = exports.default;
6056
6141
  module.exports.default = exports.default;
6057
- },{"./isBase64":17,"./util/assertString":99}],57:[function(require,module,exports){
6142
+ },{"./isBase64":17,"./util/assertString":102}],58:[function(require,module,exports){
6058
6143
  "use strict";
6059
6144
 
6060
6145
  Object.defineProperty(exports, "__esModule", {
@@ -6092,7 +6177,7 @@ function isLatLong(str, options) {
6092
6177
 
6093
6178
  module.exports = exports.default;
6094
6179
  module.exports.default = exports.default;
6095
- },{"./util/assertString":99,"./util/merge":101}],58:[function(require,module,exports){
6180
+ },{"./util/assertString":102,"./util/merge":104}],59:[function(require,module,exports){
6096
6181
  "use strict";
6097
6182
 
6098
6183
  Object.defineProperty(exports, "__esModule", {
@@ -6121,14 +6206,15 @@ function isLength(str, options) {
6121
6206
  max = arguments[2];
6122
6207
  }
6123
6208
 
6209
+ var presentationSequences = str.match(/(\uFE0F|\uFE0E)/g) || [];
6124
6210
  var surrogatePairs = str.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g) || [];
6125
- var len = str.length - surrogatePairs.length;
6211
+ var len = str.length - presentationSequences.length - surrogatePairs.length;
6126
6212
  return len >= min && (typeof max === 'undefined' || len <= max);
6127
6213
  }
6128
6214
 
6129
6215
  module.exports = exports.default;
6130
6216
  module.exports.default = exports.default;
6131
- },{"./util/assertString":99}],59:[function(require,module,exports){
6217
+ },{"./util/assertString":102}],60:[function(require,module,exports){
6132
6218
  "use strict";
6133
6219
 
6134
6220
  Object.defineProperty(exports, "__esModule", {
@@ -6142,25 +6228,37 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
6142
6228
 
6143
6229
  var validators = {
6144
6230
  'cs-CZ': function csCZ(str) {
6145
- return /^(([ABCDEFHKIJKLMNPRSTUVXYZ]|[0-9])-?){5,8}$/.test(str);
6231
+ return /^(([ABCDEFHIJKLMNPRSTUVXYZ]|[0-9])-?){5,8}$/.test(str);
6146
6232
  },
6147
6233
  'de-DE': function deDE(str) {
6148
- return /^((AW|UL|AK|GA|AÖ|LF|AZ|AM|AS|ZE|AN|AB|A|KG|KH|BA|EW|BZ|HY|KM|BT|HP|B|BC|BI|BO|FN|TT|ÜB|BN|AH|BS|FR|HB|ZZ|BB|BK|BÖ|OC|OK|CW|CE|C|CO|LH|CB|KW|LC|LN|DA|DI|DE|DH|SY|NÖ|DO|DD|DU|DN|D|EI|EA|EE|FI|EM|EL|EN|PF|ED|EF|ER|AU|ZP|E|ES|NT|EU|FL|FO|FT|FF|F|FS|FD|FÜ|GE|G|GI|GF|GS|ZR|GG|GP|GR|NY|ZI|GÖ|GZ|GT|HA|HH|HM|HU|WL|HZ|WR|RN|HK|HD|HN|HS|GK|HE|HF|RZ|HI|HG|HO|HX|IK|IL|IN|J|JL|KL|KA|KS|KF|KE|KI|KT|KO|KN|KR|KC|KU|K|LD|LL|LA|L|OP|LM|LI|LB|LU|LÖ|HL|LG|MD|GN|MZ|MA|ML|MR|MY|AT|DM|MC|NZ|RM|RG|MM|ME|MB|MI|FG|DL|HC|MW|RL|MK|MG|MÜ|WS|MH|M|MS|NU|NB|ND|NM|NK|NW|NR|NI|NF|DZ|EB|OZ|TG|TO|N|OA|GM|OB|CA|EH|FW|OF|OL|OE|OG|BH|LR|OS|AA|GD|OH|KY|NP|WK|PB|PA|PE|PI|PS|P|PM|PR|RA|RV|RE|R|H|SB|WN|RS|RD|RT|BM|NE|GV|RP|SU|GL|RO|GÜ|RH|EG|RW|PN|SK|MQ|RU|SZ|RI|SL|SM|SC|HR|FZ|VS|SW|SN|CR|SE|SI|SO|LP|SG|NH|SP|IZ|ST|BF|TE|HV|OD|SR|S|AC|DW|ZW|TF|TS|TR|TÜ|UM|PZ|TP|UE|UN|UH|MN|KK|VB|V|AE|PL|RC|VG|GW|PW|VR|VK|KB|WA|WT|BE|WM|WE|AP|MO|WW|FB|WZ|WI|WB|JE|WF|WO|W|WÜ|BL|Z|GC)[- ]?[A-Z]{1,2}[- ]?\d{1,4}|(AIC|FDB|ABG|SLN|SAW|KLZ|BUL|ESB|NAB|SUL|WST|ABI|AZE|BTF|KÖT|DKB|FEU|ROT|ALZ|SMÜ|WER|AUR|NOR|DÜW|BRK|HAB|TÖL|WOR|BAD|BAR|BER|BIW|EBS|KEM|MÜB|PEG|BGL|BGD|REI|WIL|BKS|BIR|WAT|BOR|BOH|BOT|BRB|BLK|HHM|NEB|NMB|WSF|LEO|HDL|WMS|WZL|BÜS|CHA|KÖZ|ROD|WÜM|CLP|NEC|COC|ZEL|COE|CUX|DAH|LDS|DEG|DEL|RSL|DLG|DGF|LAN|HEI|MED|DON|KIB|ROK|JÜL|MON|SLE|EBE|EIC|HIG|WBS|BIT|PRÜ|LIB|EMD|WIT|ERH|HÖS|ERZ|ANA|ASZ|MAB|MEK|STL|SZB|FDS|HCH|HOR|WOL|FRG|GRA|WOS|FRI|FFB|GAP|GER|BRL|CLZ|GTH|NOH|HGW|GRZ|LÖB|NOL|WSW|DUD|HMÜ|OHA|KRU|HAL|HAM|HBS|QLB|HVL|NAU|HAS|EBN|GEO|HOH|HDH|ERK|HER|WAN|HEF|ROF|HBN|ALF|HSK|USI|NAI|REH|SAN|KÜN|ÖHR|HOL|WAR|ARN|BRG|GNT|HOG|WOH|KEH|MAI|PAR|RID|ROL|KLE|GEL|KUS|KYF|ART|SDH|LDK|DIL|MAL|VIB|LER|BNA|GHA|GRM|MTL|WUR|LEV|LIF|STE|WEL|LIP|VAI|LUP|HGN|LBZ|LWL|PCH|STB|DAN|MKK|SLÜ|MSP|TBB|MGH|MTK|BIN|MSH|EIL|HET|SGH|BID|MYK|MSE|MST|MÜR|WRN|MEI|GRH|RIE|MZG|MIL|OBB|BED|FLÖ|MOL|FRW|SEE|SRB|AIB|MOS|BCH|ILL|SOB|NMS|NEA|SEF|UFF|NEW|VOH|NDH|TDO|NWM|GDB|GVM|WIS|NOM|EIN|GAN|LAU|HEB|OHV|OSL|SFB|ERB|LOS|BSK|KEL|BSB|MEL|WTL|OAL|FÜS|MOD|OHZ|OPR|BÜR|PAF|PLÖ|CAS|GLA|REG|VIT|ECK|SIM|GOA|EMS|DIZ|GOH|RÜD|SWA|NES|KÖN|MET|LRO|BÜZ|DBR|ROS|TET|HRO|ROW|BRV|HIP|PAN|GRI|SHK|EIS|SRO|SOK|LBS|SCZ|MER|QFT|SLF|SLS|HOM|SLK|ASL|BBG|SBK|SFT|SHG|MGN|MEG|ZIG|SAD|NEN|OVI|SHA|BLB|SIG|SON|SPN|FOR|GUB|SPB|IGB|WND|STD|STA|SDL|OBG|HST|BOG|SHL|PIR|FTL|SEB|SÖM|SÜW|TIR|SAB|TUT|ANG|SDT|LÜN|LSZ|MHL|VEC|VER|VIE|OVL|ANK|OVP|SBG|UEM|UER|WLG|GMN|NVP|RDG|RÜG|DAU|FKB|WAF|WAK|SLZ|WEN|SOG|APD|WUG|GUN|ESW|WIZ|WES|DIN|BRA|BÜD|WHV|HWI|GHC|WTM|WOB|WUN|MAK|SEL|OCH|HOT|WDA)[- ]?(([A-Z][- ]?\d{1,4})|([A-Z]{2}[- ]?\d{1,3})))[- ]?(E|H)?$/.test(str);
6234
+ return /^((A|AA|AB|AC|AE|AH|AK|AM|AN|AÖ|AP|AS|AT|AU|AW|AZ|B|BA|BB|BC|BE|BF|BH|BI|BK|BL|BM|BN|BO|BÖ|BS|BT|BZ|C|CA|CB|CE|CO|CR|CW|D|DA|DD|DE|DH|DI|DL|DM|DN|DO|DU|DW|DZ|E|EA|EB|ED|EE|EF|EG|EH|EI|EL|EM|EN|ER|ES|EU|EW|F|FB|FD|FF|FG|FI|FL|FN|FO|FR|FS|FT|FÜ|FW|FZ|G|GA|GC|GD|GE|GF|GG|GI|GK|GL|GM|GN|GÖ|GP|GR|GS|GT|GÜ|GV|GW|GZ|H|HA|HB|HC|HD|HE|HF|HG|HH|HI|HK|HL|HM|HN|HO|HP|HR|HS|HU|HV|HX|HY|HZ|IK|IL|IN|IZ|J|JE|JL|K|KA|KB|KC|KE|KF|KG|KH|KI|KK|KL|KM|KN|KO|KR|KS|KT|KU|KW|KY|L|LA|LB|LC|LD|LF|LG|LH|LI|LL|LM|LN|LÖ|LP|LR|LU|M|MA|MB|MC|MD|ME|MG|MH|MI|MK|ML|MM|MN|MO|MQ|MR|MS|MÜ|MW|MY|MZ|N|NB|ND|NE|NF|NH|NI|NK|NM|NÖ|NP|NR|NT|NU|NW|NY|NZ|OA|OB|OC|OD|OE|OF|OG|OH|OK|OL|OP|OS|OZ|P|PA|PB|PE|PF|PI|PL|PM|PN|PR|PS|PW|PZ|R|RA|RC|RD|RE|RG|RH|RI|RL|RM|RN|RO|RP|RS|RT|RU|RV|RW|RZ|S|SB|SC|SE|SG|SI|SK|SL|SM|SN|SO|SP|SR|ST|SU|SW|SY|SZ|TE|TF|TG|TO|TP|TR|TS|TT|TÜ|ÜB|UE|UH|UL|UM|UN|V|VB|VG|VK|VR|VS|W|WA|WB|WE|WF|WI|WK|WL|WM|WN|WO|WR|WS|WT|WÜ|WW|WZ|Z|ZE|ZI|ZP|ZR|ZW|ZZ)[- ]?[A-Z]{1,2}[- ]?\d{1,4}|(ABG|ABI|AIB|AIC|ALF|ALZ|ANA|ANG|ANK|APD|ARN|ART|ASL|ASZ|AUR|AZE|BAD|BAR|BBG|BCH|BED|BER|BGD|BGL|BID|BIN|BIR|BIT|BIW|BKS|BLB|BLK|BNA|BOG|BOH|BOR|BOT|BRA|BRB|BRG|BRK|BRL|BRV|BSB|BSK|BTF|BÜD|BUL|BÜR|BÜS|BÜZ|CAS|CHA|CLP|CLZ|COC|COE|CUX|DAH|DAN|DAU|DBR|DEG|DEL|DGF|DIL|DIN|DIZ|DKB|DLG|DON|DUD|DÜW|EBE|EBN|EBS|ECK|EIC|EIL|EIN|EIS|EMD|EMS|ERB|ERH|ERK|ERZ|ESB|ESW|FDB|FDS|FEU|FFB|FKB|FLÖ|FOR|FRG|FRI|FRW|FTL|FÜS|GAN|GAP|GDB|GEL|GEO|GER|GHA|GHC|GLA|GMN|GNT|GOA|GOH|GRA|GRH|GRI|GRM|GRZ|GTH|GUB|GUN|GVM|HAB|HAL|HAM|HAS|HBN|HBS|HCH|HDH|HDL|HEB|HEF|HEI|HER|HET|HGN|HGW|HHM|HIG|HIP|HMÜ|HOG|HOH|HOL|HOM|HOR|HÖS|HOT|HRO|HSK|HST|HVL|HWI|IGB|ILL|JÜL|KEH|KEL|KEM|KIB|KLE|KLZ|KÖN|KÖT|KÖZ|KRU|KÜN|KUS|KYF|LAN|LAU|LBS|LBZ|LDK|LDS|LEO|LER|LEV|LIB|LIF|LIP|LÖB|LOS|LRO|LSZ|LÜN|LUP|LWL|MAB|MAI|MAK|MAL|MED|MEG|MEI|MEK|MEL|MER|MET|MGH|MGN|MHL|MIL|MKK|MOD|MOL|MON|MOS|MSE|MSH|MSP|MST|MTK|MTL|MÜB|MÜR|MYK|MZG|NAB|NAI|NAU|NDH|NEA|NEB|NEC|NEN|NES|NEW|NMB|NMS|NOH|NOL|NOM|NOR|NVP|NWM|OAL|OBB|OBG|OCH|OHA|ÖHR|OHV|OHZ|OPR|OSL|OVI|OVL|OVP|PAF|PAN|PAR|PCH|PEG|PIR|PLÖ|PRÜ|QFT|QLB|RDG|REG|REH|REI|RID|RIE|ROD|ROF|ROK|ROL|ROS|ROT|ROW|RSL|RÜD|RÜG|SAB|SAD|SAN|SAW|SBG|SBK|SCZ|SDH|SDL|SDT|SEB|SEE|SEF|SEL|SFB|SFT|SGH|SHA|SHG|SHK|SHL|SIG|SIM|SLE|SLF|SLK|SLN|SLS|SLÜ|SLZ|SMÜ|SOB|SOG|SOK|SÖM|SON|SPB|SPN|SRB|SRO|STA|STB|STD|STE|STL|SUL|SÜW|SWA|SZB|TBB|TDO|TET|TIR|TÖL|TUT|UEM|UER|UFF|USI|VAI|VEC|VER|VIB|VIE|VIT|VOH|WAF|WAK|WAN|WAR|WAT|WBS|WDA|WEL|WEN|WER|WES|WHV|WIL|WIS|WIT|WIZ|WLG|WMS|WND|WOB|WOH|WOL|WOR|WOS|WRN|WSF|WST|WSW|WTL|WTM|WUG|WÜM|WUN|WUR|WZL|ZEL|ZIG)[- ]?(([A-Z][- ]?\d{1,4})|([A-Z]{2}[- ]?\d{1,3})))[- ]?(E|H)?$/.test(str);
6149
6235
  },
6150
6236
  'de-LI': function deLI(str) {
6151
6237
  return /^FL[- ]?\d{1,5}[UZ]?$/.test(str);
6152
6238
  },
6239
+ 'en-IN': function enIN(str) {
6240
+ return /^[A-Z]{2}[ -]?[0-9]{1,2}(?:[ -]?[A-Z])(?:[ -]?[A-Z]*)?[ -]?[0-9]{4}$/.test(str);
6241
+ },
6242
+ 'es-AR': function esAR(str) {
6243
+ return /^(([A-Z]{2} ?[0-9]{3} ?[A-Z]{2})|([A-Z]{3} ?[0-9]{3}))$/.test(str);
6244
+ },
6153
6245
  'fi-FI': function fiFI(str) {
6154
6246
  return /^(?=.{4,7})(([A-Z]{1,3}|[0-9]{1,3})[\s-]?([A-Z]{1,3}|[0-9]{1,5}))$/.test(str);
6155
6247
  },
6248
+ 'hu-HU': function huHU(str) {
6249
+ return /^((((?!AAA)(([A-NPRSTVZWXY]{1})([A-PR-Z]{1})([A-HJ-NPR-Z]))|(A[ABC]I)|A[ABC]O|A[A-W]Q|BPI|BPO|UCO|UDO|XAO)-(?!000)\d{3})|(M\d{6})|((CK|DT|CD|HC|H[ABEFIKLMNPRSTVX]|MA|OT|R[A-Z]) \d{2}-\d{2})|(CD \d{3}-\d{3})|(C-(C|X) \d{4})|(X-(A|B|C) \d{4})|(([EPVZ]-\d{5}))|(S A[A-Z]{2} \d{2})|(SP \d{2}-\d{2}))$/.test(str);
6250
+ },
6251
+ 'pt-BR': function ptBR(str) {
6252
+ return /^[A-Z]{3}[ -]?[0-9][A-Z][0-9]{2}|[A-Z]{3}[ -]?[0-9]{4}$/.test(str);
6253
+ },
6156
6254
  'pt-PT': function ptPT(str) {
6157
6255
  return /^([A-Z]{2}|[0-9]{2})[ -·]?([A-Z]{2}|[0-9]{2})[ -·]?([A-Z]{2}|[0-9]{2})$/.test(str);
6158
6256
  },
6159
6257
  'sq-AL': function sqAL(str) {
6160
6258
  return /^[A-Z]{2}[- ]?((\d{3}[- ]?(([A-Z]{2})|T))|(R[- ]?\d{3}))$/.test(str);
6161
6259
  },
6162
- 'pt-BR': function ptBR(str) {
6163
- return /^[A-Z]{3}[ -]?[0-9][A-Z][0-9]{2}|[A-Z]{3}[ -]?[0-9]{4}$/.test(str);
6260
+ 'sv-SE': function svSE(str) {
6261
+ return /^[A-HJ-PR-UW-Z]{3} ?[\d]{2}[A-HJ-PR-UW-Z1-9]$|(^[A-ZÅÄÖ ]{2,7}$)/.test(str.trim());
6164
6262
  }
6165
6263
  };
6166
6264
 
@@ -6187,7 +6285,7 @@ function isLicensePlate(str, locale) {
6187
6285
 
6188
6286
  module.exports = exports.default;
6189
6287
  module.exports.default = exports.default;
6190
- },{"./util/assertString":99}],60:[function(require,module,exports){
6288
+ },{"./util/assertString":102}],61:[function(require,module,exports){
6191
6289
  "use strict";
6192
6290
 
6193
6291
  Object.defineProperty(exports, "__esModule", {
@@ -6213,7 +6311,7 @@ function isLocale(str) {
6213
6311
 
6214
6312
  module.exports = exports.default;
6215
6313
  module.exports.default = exports.default;
6216
- },{"./util/assertString":99}],61:[function(require,module,exports){
6314
+ },{"./util/assertString":102}],62:[function(require,module,exports){
6217
6315
  "use strict";
6218
6316
 
6219
6317
  Object.defineProperty(exports, "__esModule", {
@@ -6232,7 +6330,51 @@ function isLowercase(str) {
6232
6330
 
6233
6331
  module.exports = exports.default;
6234
6332
  module.exports.default = exports.default;
6235
- },{"./util/assertString":99}],62:[function(require,module,exports){
6333
+ },{"./util/assertString":102}],63:[function(require,module,exports){
6334
+ "use strict";
6335
+
6336
+ Object.defineProperty(exports, "__esModule", {
6337
+ value: true
6338
+ });
6339
+ exports.default = isLuhnNumber;
6340
+
6341
+ var _assertString = _interopRequireDefault(require("./util/assertString"));
6342
+
6343
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6344
+
6345
+ function isLuhnNumber(str) {
6346
+ (0, _assertString.default)(str);
6347
+ var sanitized = str.replace(/[- ]+/g, '');
6348
+ var sum = 0;
6349
+ var digit;
6350
+ var tmpNum;
6351
+ var shouldDouble;
6352
+
6353
+ for (var i = sanitized.length - 1; i >= 0; i--) {
6354
+ digit = sanitized.substring(i, i + 1);
6355
+ tmpNum = parseInt(digit, 10);
6356
+
6357
+ if (shouldDouble) {
6358
+ tmpNum *= 2;
6359
+
6360
+ if (tmpNum >= 10) {
6361
+ sum += tmpNum % 10 + 1;
6362
+ } else {
6363
+ sum += tmpNum;
6364
+ }
6365
+ } else {
6366
+ sum += tmpNum;
6367
+ }
6368
+
6369
+ shouldDouble = !shouldDouble;
6370
+ }
6371
+
6372
+ return !!(sum % 10 === 0 ? sanitized : false);
6373
+ }
6374
+
6375
+ module.exports = exports.default;
6376
+ module.exports.default = exports.default;
6377
+ },{"./util/assertString":102}],64:[function(require,module,exports){
6236
6378
  "use strict";
6237
6379
 
6238
6380
  Object.defineProperty(exports, "__esModule", {
@@ -6244,26 +6386,54 @@ var _assertString = _interopRequireDefault(require("./util/assertString"));
6244
6386
 
6245
6387
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6246
6388
 
6247
- var macAddress = /^(?:[0-9a-fA-F]{2}([-:\s]))([0-9a-fA-F]{2}\1){4}([0-9a-fA-F]{2})$/;
6248
- var macAddressNoSeparators = /^([0-9a-fA-F]){12}$/;
6249
- var macAddressWithDots = /^([0-9a-fA-F]{4}\.){2}([0-9a-fA-F]{4})$/;
6389
+ var macAddress48 = /^(?:[0-9a-fA-F]{2}([-:\s]))([0-9a-fA-F]{2}\1){4}([0-9a-fA-F]{2})$/;
6390
+ var macAddress48NoSeparators = /^([0-9a-fA-F]){12}$/;
6391
+ var macAddress48WithDots = /^([0-9a-fA-F]{4}\.){2}([0-9a-fA-F]{4})$/;
6392
+ var macAddress64 = /^(?:[0-9a-fA-F]{2}([-:\s]))([0-9a-fA-F]{2}\1){6}([0-9a-fA-F]{2})$/;
6393
+ var macAddress64NoSeparators = /^([0-9a-fA-F]){16}$/;
6394
+ var macAddress64WithDots = /^([0-9a-fA-F]{4}\.){3}([0-9a-fA-F]{4})$/;
6250
6395
 
6251
6396
  function isMACAddress(str, options) {
6252
6397
  (0, _assertString.default)(str);
6398
+
6399
+ if (options !== null && options !== void 0 && options.eui) {
6400
+ options.eui = String(options.eui);
6401
+ }
6253
6402
  /**
6254
6403
  * @deprecated `no_colons` TODO: remove it in the next major
6255
6404
  */
6256
6405
 
6257
- if (options && (options.no_colons || options.no_separators)) {
6258
- return macAddressNoSeparators.test(str);
6406
+
6407
+ if (options !== null && options !== void 0 && options.no_colons || options !== null && options !== void 0 && options.no_separators) {
6408
+ if (options.eui === '48') {
6409
+ return macAddress48NoSeparators.test(str);
6410
+ }
6411
+
6412
+ if (options.eui === '64') {
6413
+ return macAddress64NoSeparators.test(str);
6414
+ }
6415
+
6416
+ return macAddress48NoSeparators.test(str) || macAddress64NoSeparators.test(str);
6417
+ }
6418
+
6419
+ if ((options === null || options === void 0 ? void 0 : options.eui) === '48') {
6420
+ return macAddress48.test(str) || macAddress48WithDots.test(str);
6421
+ }
6422
+
6423
+ if ((options === null || options === void 0 ? void 0 : options.eui) === '64') {
6424
+ return macAddress64.test(str) || macAddress64WithDots.test(str);
6259
6425
  }
6260
6426
 
6261
- return macAddress.test(str) || macAddressWithDots.test(str);
6427
+ return isMACAddress(str, {
6428
+ eui: '48'
6429
+ }) || isMACAddress(str, {
6430
+ eui: '64'
6431
+ });
6262
6432
  }
6263
6433
 
6264
6434
  module.exports = exports.default;
6265
6435
  module.exports.default = exports.default;
6266
- },{"./util/assertString":99}],63:[function(require,module,exports){
6436
+ },{"./util/assertString":102}],65:[function(require,module,exports){
6267
6437
  "use strict";
6268
6438
 
6269
6439
  Object.defineProperty(exports, "__esModule", {
@@ -6284,7 +6454,7 @@ function isMD5(str) {
6284
6454
 
6285
6455
  module.exports = exports.default;
6286
6456
  module.exports.default = exports.default;
6287
- },{"./util/assertString":99}],64:[function(require,module,exports){
6457
+ },{"./util/assertString":102}],66:[function(require,module,exports){
6288
6458
  "use strict";
6289
6459
 
6290
6460
  Object.defineProperty(exports, "__esModule", {
@@ -6296,16 +6466,21 @@ var _assertString = _interopRequireDefault(require("./util/assertString"));
6296
6466
 
6297
6467
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6298
6468
 
6299
- var magnetURI = /^magnet:\?xt(?:\.1)?=urn:(?:aich|bitprint|btih|ed2k|ed2khash|kzhash|md5|sha1|tree:tiger):[a-z0-9]{32}(?:[a-z0-9]{8})?($|&)/i;
6469
+ var magnetURIComponent = /(?:^magnet:\?|[^?&]&)xt(?:\.1)?=urn:(?:(?:aich|bitprint|btih|ed2k|ed2khash|kzhash|md5|sha1|tree:tiger):[a-z0-9]{32}(?:[a-z0-9]{8})?|btmh:1220[a-z0-9]{64})(?:$|&)/i;
6300
6470
 
6301
6471
  function isMagnetURI(url) {
6302
6472
  (0, _assertString.default)(url);
6303
- return magnetURI.test(url.trim());
6473
+
6474
+ if (url.indexOf('magnet:?') !== 0) {
6475
+ return false;
6476
+ }
6477
+
6478
+ return magnetURIComponent.test(url);
6304
6479
  }
6305
6480
 
6306
6481
  module.exports = exports.default;
6307
6482
  module.exports.default = exports.default;
6308
- },{"./util/assertString":99}],65:[function(require,module,exports){
6483
+ },{"./util/assertString":102}],67:[function(require,module,exports){
6309
6484
  "use strict";
6310
6485
 
6311
6486
  Object.defineProperty(exports, "__esModule", {
@@ -6342,7 +6517,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
6342
6517
  // NB :
6343
6518
  // Subtype length must not exceed 100 characters.
6344
6519
  // This rule does not comply to the RFC specs (what is the max length ?).
6345
- var mimeTypeSimple = /^(application|audio|font|image|message|model|multipart|text|video)\/[a-zA-Z0-9\.\-\+]{1,100}$/i; // eslint-disable-line max-len
6520
+ var mimeTypeSimple = /^(application|audio|font|image|message|model|multipart|text|video)\/[a-zA-Z0-9\.\-\+_]{1,100}$/i; // eslint-disable-line max-len
6346
6521
  // Handle "charset" in "text/*"
6347
6522
 
6348
6523
  var mimeTypeText = /^text\/[a-zA-Z0-9\.\-\+]{1,100};\s?charset=("[a-zA-Z0-9\.\-\+\s]{0,70}"|[a-zA-Z0-9\.\-\+]{0,70})(\s?\([a-zA-Z0-9\.\-\+\s]{1,20}\))?$/i; // eslint-disable-line max-len
@@ -6357,7 +6532,7 @@ function isMimeType(str) {
6357
6532
 
6358
6533
  module.exports = exports.default;
6359
6534
  module.exports.default = exports.default;
6360
- },{"./util/assertString":99}],66:[function(require,module,exports){
6535
+ },{"./util/assertString":102}],68:[function(require,module,exports){
6361
6536
  "use strict";
6362
6537
 
6363
6538
  Object.defineProperty(exports, "__esModule", {
@@ -6380,7 +6555,7 @@ var phones = {
6380
6555
  'ar-EG': /^((\+?20)|0)?1[0125]\d{8}$/,
6381
6556
  'ar-IQ': /^(\+?964|0)?7[0-9]\d{8}$/,
6382
6557
  'ar-JO': /^(\+?962|0)?7[789]\d{7}$/,
6383
- 'ar-KW': /^(\+?965)[569]\d{7}$/,
6558
+ 'ar-KW': /^(\+?965)([569]\d{7}|41\d{6})$/,
6384
6559
  'ar-LY': /^((\+?218)|0)?(9[1-6]\d{7}|[1-8]\d{7,9})$/,
6385
6560
  'ar-MA': /^(?:(?:\+|00)212|0)[5-7]\d{8}$/,
6386
6561
  'ar-OM': /^((\+|00)968)?(9[1-9])\d{6}$/,
@@ -6388,7 +6563,7 @@ var phones = {
6388
6563
  'ar-SA': /^(!?(\+?966)|0)?5\d{8}$/,
6389
6564
  'ar-SY': /^(!?(\+?963)|0)?9\d{8}$/,
6390
6565
  'ar-TN': /^(\+?216)?[2459]\d{7}$/,
6391
- 'az-AZ': /^(\+994|0)(5[015]|7[07]|99)\d{7}$/,
6566
+ 'az-AZ': /^(\+994|0)(10|5[015]|7[07]|99)\d{7}$/,
6392
6567
  'bs-BA': /^((((\+|00)3876)|06))((([0-3]|[5-6])\d{6})|(4\d{7}))$/,
6393
6568
  'be-BY': /^(\+?375)?(24|25|29|33|44)\d{7}$/,
6394
6569
  'bg-BG': /^(\+?359|0)?8[789]\d{7}$/,
@@ -6396,14 +6571,18 @@ var phones = {
6396
6571
  'ca-AD': /^(\+376)?[346]\d{5}$/,
6397
6572
  'cs-CZ': /^(\+?420)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,
6398
6573
  'da-DK': /^(\+?45)?\s?\d{2}\s?\d{2}\s?\d{2}\s?\d{2}$/,
6399
- 'de-DE': /^((\+49|0)[1|3])([0|5][0-45-9]\d|6([23]|0\d?)|7([0-57-9]|6\d))\d{7,9}$/,
6574
+ 'de-DE': /^((\+49|0)1)(5[0-25-9]\d|6([23]|0\d?)|7([0-57-9]|6\d))\d{7,9}$/,
6400
6575
  'de-AT': /^(\+43|0)\d{1,4}\d{3,12}$/,
6401
6576
  'de-CH': /^(\+41|0)([1-9])\d{1,9}$/,
6402
6577
  'de-LU': /^(\+352)?((6\d1)\d{6})$/,
6403
- 'dv-MV': /^(\+?960)?(7[2-9]|91|9[3-9])\d{7}$/,
6404
- 'el-GR': /^(\+?30|0)?(69\d{8})$/,
6578
+ 'dv-MV': /^(\+?960)?(7[2-9]|9[1-9])\d{5}$/,
6579
+ 'el-GR': /^(\+?30|0)?6(8[5-9]|9(?![26])[0-9])\d{7}$/,
6580
+ 'el-CY': /^(\+?357?)?(9(9|6)\d{6})$/,
6581
+ 'en-AI': /^(\+?1|0)264(?:2(35|92)|4(?:6[1-2]|76|97)|5(?:3[6-9]|8[1-4])|7(?:2(4|9)|72))\d{4}$/,
6405
6582
  'en-AU': /^(\+?61|0)4\d{8}$/,
6406
- 'en-BM': /^(\+?1)?441(((3|7)\d{6}$)|(5[0-3][0-9]\d{4}$)|(59\d{5}))/,
6583
+ 'en-AG': /^(?:\+1|1)268(?:464|7(?:1[3-9]|[28]\d|3[0246]|64|7[0-689]))\d{4}$/,
6584
+ 'en-BM': /^(\+?1)?441(((3|7)\d{6}$)|(5[0-3][0-9]\d{4}$)|(59\d{5}$))/,
6585
+ 'en-BS': /^(\+?1[-\s]?|0)?\(?242\)?[-\s]?\d{3}[-\s]?\d{4}$/,
6407
6586
  'en-GB': /^(\+?44|0)7\d{9}$/,
6408
6587
  'en-GG': /^(\+?44|0)1481\d{6}$/,
6409
6588
  'en-GH': /^(\+233|0)(20|50|24|54|27|57|26|56|23|28|55|59)\d{7}$/,
@@ -6412,13 +6591,18 @@ var phones = {
6412
6591
  'en-MO': /^(\+?853[-\s]?)?[6]\d{3}[-\s]?\d{4}$/,
6413
6592
  'en-IE': /^(\+?353|0)8[356789]\d{7}$/,
6414
6593
  'en-IN': /^(\+?91|0)?[6789]\d{9}$/,
6594
+ 'en-JM': /^(\+?876)?\d{7}$/,
6415
6595
  'en-KE': /^(\+?254|0)(7|1)\d{8}$/,
6596
+ 'en-SS': /^(\+?211|0)(9[1257])\d{7}$/,
6416
6597
  'en-KI': /^((\+686|686)?)?( )?((6|7)(2|3|8)[0-9]{6})$/,
6598
+ 'en-KN': /^(?:\+1|1)869(?:46\d|48[89]|55[6-8]|66\d|76[02-7])\d{4}$/,
6599
+ 'en-LS': /^(\+?266)(22|28|57|58|59|27|52)\d{6}$/,
6417
6600
  'en-MT': /^(\+?356|0)?(99|79|77|21|27|22|25)[0-9]{6}$/,
6418
6601
  'en-MU': /^(\+?230|0)?\d{8}$/,
6419
6602
  'en-NA': /^(\+?264|0)(6|8)\d{7}$/,
6420
6603
  'en-NG': /^(\+?234|0)?[789]\d{9}$/,
6421
6604
  'en-NZ': /^(\+?64|0)[28]\d{7,9}$/,
6605
+ 'en-PG': /^(\+?675|0)?(7\d|8[18])\d{6}$/,
6422
6606
  'en-PK': /^((00|\+)?92|0)3[0-6]\d{8}$/,
6423
6607
  'en-PH': /^(09|\+639)\d{9}$/,
6424
6608
  'en-RW': /^(\+?250|0)?[7]\d{8}$/,
@@ -6438,11 +6622,12 @@ var phones = {
6438
6622
  'es-CR': /^(\+506)?[2-8]\d{7}$/,
6439
6623
  'es-CU': /^(\+53|0053)?5\d{7}/,
6440
6624
  'es-DO': /^(\+?1)?8[024]9\d{7}$/,
6441
- 'es-HN': /^(\+?504)?[9|8]\d{7}$/,
6625
+ 'es-HN': /^(\+?504)?[9|8|3|2]\d{7}$/,
6442
6626
  'es-EC': /^(\+?593|0)([2-7]|9[2-9])\d{7}$/,
6443
6627
  'es-ES': /^(\+?34)?[6|7]\d{8}$/,
6444
6628
  'es-PE': /^(\+?51)?9\d{8}$/,
6445
6629
  'es-MX': /^(\+?52)?(1|01)?\d{10,11}$/,
6630
+ 'es-NI': /^(\+?505)\d{7,8}$/,
6446
6631
  'es-PA': /^(\+?507)\d{7,8}$/,
6447
6632
  'es-PY': /^(\+?595|0)9[9876]\d{7}$/,
6448
6633
  'es-SV': /^(\+?503)?[67]\d{7}$/,
@@ -6450,10 +6635,12 @@ var phones = {
6450
6635
  'es-VE': /^(\+?58)?(2|4)\d{9}$/,
6451
6636
  'et-EE': /^(\+?372)?\s?(5|8[1-4])\s?([0-9]\s?){6,7}$/,
6452
6637
  'fa-IR': /^(\+?98[\-\s]?|0)9[0-39]\d[\-\s]?\d{3}[\-\s]?\d{4}$/,
6453
- 'fi-FI': /^(\+?358|0)\s?(4(0|1|2|4|5|6)?|50)\s?(\d\s?){4,8}\d$/,
6638
+ 'fi-FI': /^(\+?358|0)\s?(4[0-6]|50)\s?(\d\s?){4,8}$/,
6454
6639
  'fj-FJ': /^(\+?679)?\s?\d{3}\s?\d{4}$/,
6455
6640
  'fo-FO': /^(\+?298)?\s?\d{2}\s?\d{2}\s?\d{2}$/,
6456
6641
  'fr-BF': /^(\+226|0)[67]\d{7}$/,
6642
+ 'fr-BJ': /^(\+229)\d{8}$/,
6643
+ 'fr-CD': /^(\+?243|0)?(8|9)\d{8}$/,
6457
6644
  'fr-CM': /^(\+?237)6[0-9]{8}$/,
6458
6645
  'fr-FR': /^(\+?33|0)[67]\d{8}$/,
6459
6646
  'fr-GF': /^(\+?594|0|00594)[67]\d{8}$/,
@@ -6464,27 +6651,34 @@ var phones = {
6464
6651
  'he-IL': /^(\+972|0)([23489]|5[012345689]|77)[1-9]\d{6}$/,
6465
6652
  'hu-HU': /^(\+?36|06)(20|30|31|50|70)\d{7}$/,
6466
6653
  'id-ID': /^(\+?62|0)8(1[123456789]|2[1238]|3[1238]|5[12356789]|7[78]|9[56789]|8[123456789])([\s?|\d]{5,11})$/,
6654
+ 'ir-IR': /^(\+98|0)?9\d{9}$/,
6467
6655
  'it-IT': /^(\+?39)?\s?3\d{2} ?\d{6,7}$/,
6468
6656
  'it-SM': /^((\+378)|(0549)|(\+390549)|(\+3780549))?6\d{5,9}$/,
6469
6657
  'ja-JP': /^(\+81[ \-]?(\(0\))?|0)[6789]0[ \-]?\d{4}[ \-]?\d{4}$/,
6470
- 'ka-GE': /^(\+?995)?(5|79)\d{7}$/,
6658
+ 'ka-GE': /^(\+?995)?(79\d{7}|5\d{8})$/,
6471
6659
  'kk-KZ': /^(\+?7|8)?7\d{9}$/,
6472
6660
  'kl-GL': /^(\+?299)?\s?\d{2}\s?\d{2}\s?\d{2}$/,
6473
6661
  'ko-KR': /^((\+?82)[ \-]?)?0?1([0|1|6|7|8|9]{1})[ \-]?\d{3,4}[ \-]?\d{4}$/,
6662
+ 'ky-KG': /^(\+?7\s?\+?7|0)\s?\d{2}\s?\d{3}\s?\d{4}$/,
6474
6663
  'lt-LT': /^(\+370|8)\d{8}$/,
6475
6664
  'lv-LV': /^(\+?371)2\d{7}$/,
6476
- 'ms-MY': /^(\+?6?01){1}(([0145]{1}(\-|\s)?\d{7,8})|([236789]{1}(\s|\-)?\d{7}))$/,
6665
+ 'mg-MG': /^((\+?261|0)(2|3)\d)?\d{7}$/,
6666
+ 'mn-MN': /^(\+|00|011)?976(77|81|88|91|94|95|96|99)\d{6}$/,
6667
+ 'my-MM': /^(\+?959|09|9)(2[5-7]|3[1-2]|4[0-5]|6[6-9]|7[5-9]|9[6-9])[0-9]{7}$/,
6668
+ 'ms-MY': /^(\+?60|0)1(([0145](-|\s)?\d{7,8})|([236-9](-|\s)?\d{7}))$/,
6477
6669
  'mz-MZ': /^(\+?258)?8[234567]\d{7}$/,
6478
6670
  'nb-NO': /^(\+?47)?[49]\d{7}$/,
6479
6671
  'ne-NP': /^(\+?977)?9[78]\d{8}$/,
6480
6672
  'nl-BE': /^(\+?32|0)4\d{8}$/,
6481
6673
  'nl-NL': /^(((\+|00)?31\(0\))|((\+|00)?31)|0)6{1}\d{8}$/,
6674
+ 'nl-AW': /^(\+)?297(56|59|64|73|74|99)\d{5}$/,
6482
6675
  'nn-NO': /^(\+?47)?[49]\d{7}$/,
6483
6676
  'pl-PL': /^(\+?48)? ?[5-8]\d ?\d{3} ?\d{2} ?\d{2}$/,
6484
- 'pt-BR': /^((\+?55\ ?[1-9]{2}\ ?)|(\+?55\ ?\([1-9]{2}\)\ ?)|(0[1-9]{2}\ ?)|(\([1-9]{2}\)\ ?)|([1-9]{2}\ ?))((\d{4}\-?\d{4})|(9[2-9]{1}\d{3}\-?\d{4}))$/,
6677
+ 'pt-BR': /^((\+?55\ ?[1-9]{2}\ ?)|(\+?55\ ?\([1-9]{2}\)\ ?)|(0[1-9]{2}\ ?)|(\([1-9]{2}\)\ ?)|([1-9]{2}\ ?))((\d{4}\-?\d{4})|(9[1-9]{1}\d{3}\-?\d{4}))$/,
6485
6678
  'pt-PT': /^(\+?351)?9[1236]\d{7}$/,
6486
6679
  'pt-AO': /^(\+244)\d{9}$/,
6487
- 'ro-RO': /^(\+?4?0)\s?7\d{2}(\/|\s|\.|\-)?\d{3}(\s|\.|\-)?\d{3}$/,
6680
+ 'ro-MD': /^(\+?373|0)((6(0|1|2|6|7|8|9))|(7(6|7|8|9)))\d{6}$/,
6681
+ 'ro-RO': /^(\+?40|0)\s?7\d{2}(\/|\s|\.|-)?\d{3}(\s|\.|-)?\d{3}$/,
6488
6682
  'ru-RU': /^(\+?7|8)?9\d{9}$/,
6489
6683
  'si-LK': /^(?:0|94|\+94)?(7(0|1|2|4|5|6|7|8)( |-)?)\d{7}$/,
6490
6684
  'sl-SI': /^(\+386\s?|0)(\d{1}\s?\d{3}\s?\d{2}\s?\d{2}|\d{2}\s?\d{3}\s?\d{3})$/,
@@ -6501,7 +6695,10 @@ var phones = {
6501
6695
  'vi-VN': /^((\+?84)|0)((3([2-9]))|(5([25689]))|(7([0|6-9]))|(8([1-9]))|(9([0-9])))([0-9]{7})$/,
6502
6696
  'zh-CN': /^((\+|00)86)?(1[3-9]|9[28])\d{9}$/,
6503
6697
  'zh-TW': /^(\+?886\-?|0)?9\d{8}$/,
6504
- 'dz-BT': /^(\+?975|0)?(17|16|77|02)\d{6}$/
6698
+ 'dz-BT': /^(\+?975|0)?(17|16|77|02)\d{6}$/,
6699
+ 'ar-YE': /^(((\+|00)9677|0?7)[0137]\d{7}|((\+|00)967|0)[1-7]\d{6})$/,
6700
+ 'ar-EH': /^(\+?212|0)[\s\-]?(5288|5289)[\s\-]?\d{5}$/,
6701
+ 'fa-AF': /^(\+93|0)?(2{1}[0-8]{1}|[3-5]{1}[0-4]{1})(\d{7})$/
6505
6702
  };
6506
6703
  /* eslint-enable max-len */
6507
6704
  // aliases
@@ -6558,7 +6755,7 @@ function isMobilePhone(str, locale, options) {
6558
6755
 
6559
6756
  var locales = Object.keys(phones);
6560
6757
  exports.locales = locales;
6561
- },{"./util/assertString":99}],67:[function(require,module,exports){
6758
+ },{"./util/assertString":102}],69:[function(require,module,exports){
6562
6759
  "use strict";
6563
6760
 
6564
6761
  Object.defineProperty(exports, "__esModule", {
@@ -6579,7 +6776,7 @@ function isMongoId(str) {
6579
6776
 
6580
6777
  module.exports = exports.default;
6581
6778
  module.exports.default = exports.default;
6582
- },{"./isHexadecimal":39,"./util/assertString":99}],68:[function(require,module,exports){
6779
+ },{"./isHexadecimal":39,"./util/assertString":102}],70:[function(require,module,exports){
6583
6780
  "use strict";
6584
6781
 
6585
6782
  Object.defineProperty(exports, "__esModule", {
@@ -6602,7 +6799,7 @@ function isMultibyte(str) {
6602
6799
 
6603
6800
  module.exports = exports.default;
6604
6801
  module.exports.default = exports.default;
6605
- },{"./util/assertString":99}],69:[function(require,module,exports){
6802
+ },{"./util/assertString":102}],71:[function(require,module,exports){
6606
6803
  "use strict";
6607
6804
 
6608
6805
  Object.defineProperty(exports, "__esModule", {
@@ -6630,7 +6827,7 @@ function isNumeric(str, options) {
6630
6827
 
6631
6828
  module.exports = exports.default;
6632
6829
  module.exports.default = exports.default;
6633
- },{"./alpha":5,"./util/assertString":99}],70:[function(require,module,exports){
6830
+ },{"./alpha":5,"./util/assertString":102}],72:[function(require,module,exports){
6634
6831
  "use strict";
6635
6832
 
6636
6833
  Object.defineProperty(exports, "__esModule", {
@@ -6651,7 +6848,7 @@ function isOctal(str) {
6651
6848
 
6652
6849
  module.exports = exports.default;
6653
6850
  module.exports.default = exports.default;
6654
- },{"./util/assertString":99}],71:[function(require,module,exports){
6851
+ },{"./util/assertString":102}],73:[function(require,module,exports){
6655
6852
  "use strict";
6656
6853
 
6657
6854
  Object.defineProperty(exports, "__esModule", {
@@ -6678,6 +6875,8 @@ var passportRegexByCountryCode = {
6678
6875
  // AUSTRIA
6679
6876
  AU: /^[A-Z]\d{7}$/,
6680
6877
  // AUSTRALIA
6878
+ AZ: /^[A-Z]{2,3}\d{7,8}$/,
6879
+ // AZERBAIJAN
6681
6880
  BE: /^[A-Z]{2}\d{6}$/,
6682
6881
  // BELGIUM
6683
6882
  BG: /^\d{9}$/,
@@ -6730,10 +6929,16 @@ var passportRegexByCountryCode = {
6730
6929
  // ICELAND
6731
6930
  IT: /^[A-Z0-9]{2}\d{7}$/,
6732
6931
  // ITALY
6932
+ JM: /^[Aa]\d{7}$/,
6933
+ // JAMAICA
6733
6934
  JP: /^[A-Z]{2}\d{7}$/,
6734
6935
  // JAPAN
6735
6936
  KR: /^[MS]\d{8}$/,
6736
6937
  // SOUTH KOREA, REPUBLIC OF KOREA, [S=PS Passports, M=PM Passports]
6938
+ KZ: /^[a-zA-Z]\d{7}$/,
6939
+ // KAZAKHSTAN
6940
+ LI: /^[a-zA-Z]\d{5}$/,
6941
+ // LIECHTENSTEIN
6737
6942
  LT: /^[A-Z0-9]{8}$/,
6738
6943
  // LITHUANIA
6739
6944
  LU: /^[A-Z0-9]{8}$/,
@@ -6748,8 +6953,16 @@ var passportRegexByCountryCode = {
6748
6953
  // MOZAMBIQUE
6749
6954
  MY: /^[AHK]\d{8}$/,
6750
6955
  // MALAYSIA
6956
+ MX: /^\d{10,11}$/,
6957
+ // MEXICO
6751
6958
  NL: /^[A-Z]{2}[A-Z0-9]{6}\d$/,
6752
6959
  // NETHERLANDS
6960
+ NZ: /^([Ll]([Aa]|[Dd]|[Ff]|[Hh])|[Ee]([Aa]|[Pp])|[Nn])\d{6}$/,
6961
+ // NEW ZEALAND
6962
+ PH: /^([A-Z](\d{6}|\d{7}[A-Z]))|([A-Z]{2}(\d{6}|\d{7}))$/,
6963
+ // PHILIPPINES
6964
+ PK: /^[A-Z]{2}\d{7}$/,
6965
+ // PAKISTAN
6753
6966
  PL: /^[A-Z]{2}\d{7}$/,
6754
6967
  // POLAND
6755
6968
  PT: /^[A-Z]\d{6}$/,
@@ -6761,9 +6974,11 @@ var passportRegexByCountryCode = {
6761
6974
  SE: /^\d{8}$/,
6762
6975
  // SWEDEN
6763
6976
  SL: /^(P)[A-Z]\d{7}$/,
6764
- // SLOVANIA
6977
+ // SLOVENIA
6765
6978
  SK: /^[0-9A-Z]\d{7}$/,
6766
6979
  // SLOVAKIA
6980
+ TH: /^[A-Z]{1,2}\d{6,7}$/,
6981
+ // THAILAND
6767
6982
  TR: /^[A-Z]\d{8}$/,
6768
6983
  // TURKEY
6769
6984
  UA: /^[A-Z]{2}\d{6}$/,
@@ -6790,7 +7005,7 @@ function isPassportNumber(str, countryCode) {
6790
7005
 
6791
7006
  module.exports = exports.default;
6792
7007
  module.exports.default = exports.default;
6793
- },{"./util/assertString":99}],72:[function(require,module,exports){
7008
+ },{"./util/assertString":102}],74:[function(require,module,exports){
6794
7009
  "use strict";
6795
7010
 
6796
7011
  Object.defineProperty(exports, "__esModule", {
@@ -6811,7 +7026,7 @@ function isPort(str) {
6811
7026
 
6812
7027
  module.exports = exports.default;
6813
7028
  module.exports.default = exports.default;
6814
- },{"./isInt":54}],73:[function(require,module,exports){
7029
+ },{"./isInt":55}],75:[function(require,module,exports){
6815
7030
  "use strict";
6816
7031
 
6817
7032
  Object.defineProperty(exports, "__esModule", {
@@ -6834,10 +7049,11 @@ var patterns = {
6834
7049
  AT: fourDigit,
6835
7050
  AU: fourDigit,
6836
7051
  AZ: /^AZ\d{4}$/,
7052
+ BA: /^([7-8]\d{4}$)/,
6837
7053
  BE: fourDigit,
6838
7054
  BG: fourDigit,
6839
7055
  BR: /^\d{5}-\d{3}$/,
6840
- BY: /2[1-4]{1}\d{4}$/,
7056
+ BY: /^2[1-4]\d{4}$/,
6841
7057
  CA: /^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJ-NPRSTV-Z][\s\-]?\d[ABCEGHJ-NPRSTV-Z]\d$/i,
6842
7058
  CH: fourDigit,
6843
7059
  CN: /^(0[1-7]|1[012356]|2[0-7]|3[0-6]|4[0-7]|5[1-7]|6[1-7]|7[1-5]|8[1345]|9[09])\d{4}$/,
@@ -6859,7 +7075,7 @@ var patterns = {
6859
7075
  IE: /^(?!.*(?:o))[A-Za-z]\d[\dw]\s\w{4}$/i,
6860
7076
  IL: /^(\d{5}|\d{7})$/,
6861
7077
  IN: /^((?!10|29|35|54|55|65|66|86|87|88|89)[1-9][0-9]{5})$/,
6862
- IR: /\b(?!(\d)\1{3})[13-9]{4}[1346-9][013-9]{5}\b/,
7078
+ IR: /^(?!(\d)\1{3})[13-9]{4}[1346-9][013-9]{5}$/,
6863
7079
  IS: threeDigit,
6864
7080
  IT: fiveDigit,
6865
7081
  JP: /^\d{3}\-\d{4}$/,
@@ -6870,6 +7086,7 @@ var patterns = {
6870
7086
  LU: fourDigit,
6871
7087
  LV: /^LV\-\d{4}$/,
6872
7088
  LK: fiveDigit,
7089
+ MG: threeDigit,
6873
7090
  MX: fiveDigit,
6874
7091
  MT: /^[A-Za-z]{3}\s{0,1}\d{4}$/,
6875
7092
  MY: fiveDigit,
@@ -6921,7 +7138,7 @@ function isPostalCode(str, locale) {
6921
7138
 
6922
7139
  throw new Error("Invalid locale '".concat(locale, "'"));
6923
7140
  }
6924
- },{"./util/assertString":99}],74:[function(require,module,exports){
7141
+ },{"./util/assertString":102}],76:[function(require,module,exports){
6925
7142
  "use strict";
6926
7143
 
6927
7144
  Object.defineProperty(exports, "__esModule", {
@@ -6955,7 +7172,7 @@ function isRFC3339(str) {
6955
7172
 
6956
7173
  module.exports = exports.default;
6957
7174
  module.exports.default = exports.default;
6958
- },{"./util/assertString":99}],75:[function(require,module,exports){
7175
+ },{"./util/assertString":102}],77:[function(require,module,exports){
6959
7176
  "use strict";
6960
7177
 
6961
7178
  Object.defineProperty(exports, "__esModule", {
@@ -6969,8 +7186,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
6969
7186
 
6970
7187
  var rgbColor = /^rgb\((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]),){2}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\)$/;
6971
7188
  var rgbaColor = /^rgba\((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]),){3}(0?\.\d|1(\.0)?|0(\.0)?)\)$/;
6972
- var rgbColorPercent = /^rgb\((([0-9]%|[1-9][0-9]%|100%),){2}([0-9]%|[1-9][0-9]%|100%)\)/;
6973
- var rgbaColorPercent = /^rgba\((([0-9]%|[1-9][0-9]%|100%),){3}(0?\.\d|1(\.0)?|0(\.0)?)\)/;
7189
+ var rgbColorPercent = /^rgb\((([0-9]%|[1-9][0-9]%|100%),){2}([0-9]%|[1-9][0-9]%|100%)\)$/;
7190
+ var rgbaColorPercent = /^rgba\((([0-9]%|[1-9][0-9]%|100%),){3}(0?\.\d|1(\.0)?|0(\.0)?)\)$/;
6974
7191
 
6975
7192
  function isRgbColor(str) {
6976
7193
  var includePercentValues = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
@@ -6985,7 +7202,7 @@ function isRgbColor(str) {
6985
7202
 
6986
7203
  module.exports = exports.default;
6987
7204
  module.exports.default = exports.default;
6988
- },{"./util/assertString":99}],76:[function(require,module,exports){
7205
+ },{"./util/assertString":102}],78:[function(require,module,exports){
6989
7206
  "use strict";
6990
7207
 
6991
7208
  Object.defineProperty(exports, "__esModule", {
@@ -7014,7 +7231,7 @@ function isSemVer(str) {
7014
7231
 
7015
7232
  module.exports = exports.default;
7016
7233
  module.exports.default = exports.default;
7017
- },{"./util/assertString":99,"./util/multilineRegex":102}],77:[function(require,module,exports){
7234
+ },{"./util/assertString":102,"./util/multilineRegex":105}],79:[function(require,module,exports){
7018
7235
  "use strict";
7019
7236
 
7020
7237
  Object.defineProperty(exports, "__esModule", {
@@ -7035,7 +7252,7 @@ function isSlug(str) {
7035
7252
 
7036
7253
  module.exports = exports.default;
7037
7254
  module.exports.default = exports.default;
7038
- },{"./util/assertString":99}],78:[function(require,module,exports){
7255
+ },{"./util/assertString":102}],80:[function(require,module,exports){
7039
7256
  "use strict";
7040
7257
 
7041
7258
  Object.defineProperty(exports, "__esModule", {
@@ -7052,7 +7269,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
7052
7269
  var upperCaseRegex = /^[A-Z]$/;
7053
7270
  var lowerCaseRegex = /^[a-z]$/;
7054
7271
  var numberRegex = /^[0-9]$/;
7055
- var symbolRegex = /^[-#!$@%^&*()_+|~=`{}\[\]:";'<>?,.\/ ]$/;
7272
+ var symbolRegex = /^[-#!$@£%^&*()_+|~=`{}\[\]:";'<>?,.\/ ]$/;
7056
7273
  var defaultOptions = {
7057
7274
  minLength: 8,
7058
7275
  minLowercase: 1,
@@ -7151,7 +7368,7 @@ function isStrongPassword(str) {
7151
7368
 
7152
7369
  module.exports = exports.default;
7153
7370
  module.exports.default = exports.default;
7154
- },{"./util/assertString":99,"./util/merge":101}],79:[function(require,module,exports){
7371
+ },{"./util/assertString":102,"./util/merge":104}],81:[function(require,module,exports){
7155
7372
  "use strict";
7156
7373
 
7157
7374
  Object.defineProperty(exports, "__esModule", {
@@ -7172,7 +7389,7 @@ function isSurrogatePair(str) {
7172
7389
 
7173
7390
  module.exports = exports.default;
7174
7391
  module.exports.default = exports.default;
7175
- },{"./util/assertString":99}],80:[function(require,module,exports){
7392
+ },{"./util/assertString":102}],82:[function(require,module,exports){
7176
7393
  "use strict";
7177
7394
 
7178
7395
  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); }
@@ -7273,6 +7490,37 @@ function bgBgCheck(tin) {
7273
7490
  checksum = checksum % 11 === 10 ? 0 : checksum % 11;
7274
7491
  return checksum === digits[9];
7275
7492
  }
7493
+ /**
7494
+ * Check if an input is a valid Canadian SIN (Social Insurance Number)
7495
+ *
7496
+ * The Social Insurance Number (SIN) is a 9 digit number that
7497
+ * you need to work in Canada or to have access to government programs and benefits.
7498
+ *
7499
+ * https://en.wikipedia.org/wiki/Social_Insurance_Number
7500
+ * https://www.canada.ca/en/employment-social-development/services/sin.html
7501
+ * https://www.codercrunch.com/challenge/819302488/sin-validator
7502
+ *
7503
+ * @param {string} input
7504
+ * @return {boolean}
7505
+ */
7506
+
7507
+
7508
+ function isCanadianSIN(input) {
7509
+ var digitsArray = input.split('');
7510
+ var even = digitsArray.filter(function (_, idx) {
7511
+ return idx % 2;
7512
+ }).map(function (i) {
7513
+ return Number(i) * 2;
7514
+ }).join('').split('');
7515
+ var total = digitsArray.filter(function (_, idx) {
7516
+ return !(idx % 2);
7517
+ }).concat(even).map(function (i) {
7518
+ return Number(i);
7519
+ }).reduce(function (acc, cur) {
7520
+ return acc + cur;
7521
+ });
7522
+ return total % 10 === 0;
7523
+ }
7276
7524
  /*
7277
7525
  * cs-CZ validation function
7278
7526
  * (Rodné číslo (RČ), persons only)
@@ -7625,7 +7873,7 @@ function enUsGetPrefixes() {
7625
7873
 
7626
7874
 
7627
7875
  function enUsCheck(tin) {
7628
- return enUsGetPrefixes().indexOf(tin.substr(0, 2)) !== -1;
7876
+ return enUsGetPrefixes().indexOf(tin.slice(0, 2)) !== -1;
7629
7877
  }
7630
7878
  /*
7631
7879
  * es-ES validation function
@@ -8593,6 +8841,7 @@ var taxIdFormat = {
8593
8841
  'dk-DK': /^\d{6}-{0,1}\d{4}$/,
8594
8842
  'el-CY': /^[09]\d{7}[A-Z]$/,
8595
8843
  'el-GR': /^([0-4]|[7-9])\d{8}$/,
8844
+ 'en-CA': /^\d{9}$/,
8596
8845
  'en-GB': /^\d{10}$|^(?!GB|NK|TN|ZZ)(?![DFIQUV])[A-Z](?![DFIQUVO])[A-Z]\d{6}[ABCD ]$/i,
8597
8846
  'en-IE': /^\d{7}[A-W][A-IW]{0,1}$/i,
8598
8847
  'en-US': /^\d{2}[- ]{0,1}\d{7}$/,
@@ -8621,7 +8870,8 @@ var taxIdFormat = {
8621
8870
 
8622
8871
  taxIdFormat['lb-LU'] = taxIdFormat['fr-LU'];
8623
8872
  taxIdFormat['lt-LT'] = taxIdFormat['et-EE'];
8624
- taxIdFormat['nl-BE'] = taxIdFormat['fr-BE']; // Algorithmic tax id check functions for various locales
8873
+ taxIdFormat['nl-BE'] = taxIdFormat['fr-BE'];
8874
+ taxIdFormat['fr-CA'] = taxIdFormat['en-CA']; // Algorithmic tax id check functions for various locales
8625
8875
 
8626
8876
  var taxIdCheck = {
8627
8877
  'bg-BG': bgBgCheck,
@@ -8631,6 +8881,7 @@ var taxIdCheck = {
8631
8881
  'dk-DK': dkDkCheck,
8632
8882
  'el-CY': elCyCheck,
8633
8883
  'el-GR': elGrCheck,
8884
+ 'en-CA': isCanadianSIN,
8634
8885
  'en-IE': enIeCheck,
8635
8886
  'en-US': enUsCheck,
8636
8887
  'es-ES': esEsCheck,
@@ -8656,7 +8907,8 @@ var taxIdCheck = {
8656
8907
 
8657
8908
  taxIdCheck['lb-LU'] = taxIdCheck['fr-LU'];
8658
8909
  taxIdCheck['lt-LT'] = taxIdCheck['et-EE'];
8659
- taxIdCheck['nl-BE'] = taxIdCheck['fr-BE']; // Regexes for locales where characters should be omitted before checking format
8910
+ taxIdCheck['nl-BE'] = taxIdCheck['fr-BE'];
8911
+ taxIdCheck['fr-CA'] = taxIdCheck['en-CA']; // Regexes for locales where characters should be omitted before checking format
8660
8912
 
8661
8913
  var allsymbols = /[-\\\/!@#$%\^&\*\(\)\+\=\[\]]+/g;
8662
8914
  var sanitizeRegexes = {
@@ -8701,7 +8953,42 @@ function isTaxID(str) {
8701
8953
 
8702
8954
  module.exports = exports.default;
8703
8955
  module.exports.default = exports.default;
8704
- },{"./isDate":25,"./util/algorithms":98,"./util/assertString":99}],81:[function(require,module,exports){
8956
+ },{"./isDate":25,"./util/algorithms":101,"./util/assertString":102}],83:[function(require,module,exports){
8957
+ "use strict";
8958
+
8959
+ Object.defineProperty(exports, "__esModule", {
8960
+ value: true
8961
+ });
8962
+ exports.default = isTime;
8963
+
8964
+ var _merge = _interopRequireDefault(require("./util/merge"));
8965
+
8966
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8967
+
8968
+ var default_time_options = {
8969
+ hourFormat: 'hour24',
8970
+ mode: 'default'
8971
+ };
8972
+ var formats = {
8973
+ hour24: {
8974
+ default: /^([01]?[0-9]|2[0-3]):([0-5][0-9])$/,
8975
+ withSeconds: /^([01]?[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$/
8976
+ },
8977
+ hour12: {
8978
+ default: /^(0?[1-9]|1[0-2]):([0-5][0-9]) (A|P)M$/,
8979
+ withSeconds: /^(0?[1-9]|1[0-2]):([0-5][0-9]):([0-5][0-9]) (A|P)M$/
8980
+ }
8981
+ };
8982
+
8983
+ function isTime(input, options) {
8984
+ options = (0, _merge.default)(options, default_time_options);
8985
+ if (typeof input !== 'string') return false;
8986
+ return formats[options.hourFormat][options.mode].test(input);
8987
+ }
8988
+
8989
+ module.exports = exports.default;
8990
+ module.exports.default = exports.default;
8991
+ },{"./util/merge":104}],84:[function(require,module,exports){
8705
8992
  "use strict";
8706
8993
 
8707
8994
  Object.defineProperty(exports, "__esModule", {
@@ -8815,12 +9102,12 @@ function isURL(url, options) {
8815
9102
  }
8816
9103
  } else if (options.require_protocol) {
8817
9104
  return false;
8818
- } else if (url.substr(0, 2) === '//') {
9105
+ } else if (url.slice(0, 2) === '//') {
8819
9106
  if (!options.allow_protocol_relative_urls) {
8820
9107
  return false;
8821
9108
  }
8822
9109
 
8823
- split[0] = url.substr(2);
9110
+ split[0] = url.slice(2);
8824
9111
  }
8825
9112
 
8826
9113
  url = split.join('://');
@@ -8895,6 +9182,10 @@ function isURL(url, options) {
8895
9182
  return checkHost(host, options.host_whitelist);
8896
9183
  }
8897
9184
 
9185
+ if (host === '' && !options.require_host) {
9186
+ return true;
9187
+ }
9188
+
8898
9189
  if (!(0, _isIP.default)(host) && !(0, _isFQDN.default)(host, options) && (!ipv6 || !(0, _isIP.default)(ipv6, 6))) {
8899
9190
  return false;
8900
9191
  }
@@ -8910,7 +9201,7 @@ function isURL(url, options) {
8910
9201
 
8911
9202
  module.exports = exports.default;
8912
9203
  module.exports.default = exports.default;
8913
- },{"./isFQDN":32,"./isIP":42,"./util/assertString":99,"./util/merge":101}],82:[function(require,module,exports){
9204
+ },{"./isFQDN":32,"./isIP":42,"./util/assertString":102,"./util/merge":104}],85:[function(require,module,exports){
8914
9205
  "use strict";
8915
9206
 
8916
9207
  Object.defineProperty(exports, "__esModule", {
@@ -8939,7 +9230,7 @@ function isUUID(str, version) {
8939
9230
 
8940
9231
  module.exports = exports.default;
8941
9232
  module.exports.default = exports.default;
8942
- },{"./util/assertString":99}],83:[function(require,module,exports){
9233
+ },{"./util/assertString":102}],86:[function(require,module,exports){
8943
9234
  "use strict";
8944
9235
 
8945
9236
  Object.defineProperty(exports, "__esModule", {
@@ -8958,9 +9249,11 @@ function isUppercase(str) {
8958
9249
 
8959
9250
  module.exports = exports.default;
8960
9251
  module.exports.default = exports.default;
8961
- },{"./util/assertString":99}],84:[function(require,module,exports){
9252
+ },{"./util/assertString":102}],87:[function(require,module,exports){
8962
9253
  "use strict";
8963
9254
 
9255
+ 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); }
9256
+
8964
9257
  Object.defineProperty(exports, "__esModule", {
8965
9258
  value: true
8966
9259
  });
@@ -8969,12 +9262,247 @@ exports.vatMatchers = void 0;
8969
9262
 
8970
9263
  var _assertString = _interopRequireDefault(require("./util/assertString"));
8971
9264
 
9265
+ var algorithms = _interopRequireWildcard(require("./util/algorithms"));
9266
+
9267
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
9268
+
9269
+ 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; }
9270
+
8972
9271
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8973
9272
 
9273
+ var PT = function PT(str) {
9274
+ var match = str.match(/^(PT)?(\d{9})$/);
9275
+
9276
+ if (!match) {
9277
+ return false;
9278
+ }
9279
+
9280
+ var tin = match[2];
9281
+ var checksum = 11 - algorithms.reverseMultiplyAndSum(tin.split('').slice(0, 8).map(function (a) {
9282
+ return parseInt(a, 10);
9283
+ }), 9) % 11;
9284
+
9285
+ if (checksum > 9) {
9286
+ return parseInt(tin[8], 10) === 0;
9287
+ }
9288
+
9289
+ return checksum === parseInt(tin[8], 10);
9290
+ };
9291
+
8974
9292
  var vatMatchers = {
8975
- GB: /^GB((\d{3} \d{4} ([0-8][0-9]|9[0-6]))|(\d{9} \d{3})|(((GD[0-4])|(HA[5-9]))[0-9]{2}))$/,
8976
- IT: /^(IT)?[0-9]{11}$/,
8977
- NL: /^(NL)?[0-9]{9}B[0-9]{2}$/
9293
+ /**
9294
+ * European Union VAT identification numbers
9295
+ */
9296
+ AT: function AT(str) {
9297
+ return /^(AT)?U\d{8}$/.test(str);
9298
+ },
9299
+ BE: function BE(str) {
9300
+ return /^(BE)?\d{10}$/.test(str);
9301
+ },
9302
+ BG: function BG(str) {
9303
+ return /^(BG)?\d{9,10}$/.test(str);
9304
+ },
9305
+ HR: function HR(str) {
9306
+ return /^(HR)?\d{11}$/.test(str);
9307
+ },
9308
+ CY: function CY(str) {
9309
+ return /^(CY)?\w{9}$/.test(str);
9310
+ },
9311
+ CZ: function CZ(str) {
9312
+ return /^(CZ)?\d{8,10}$/.test(str);
9313
+ },
9314
+ DK: function DK(str) {
9315
+ return /^(DK)?\d{8}$/.test(str);
9316
+ },
9317
+ EE: function EE(str) {
9318
+ return /^(EE)?\d{9}$/.test(str);
9319
+ },
9320
+ FI: function FI(str) {
9321
+ return /^(FI)?\d{8}$/.test(str);
9322
+ },
9323
+ FR: function FR(str) {
9324
+ return /^(FR)?\w{2}\d{9}$/.test(str);
9325
+ },
9326
+ DE: function DE(str) {
9327
+ return /^(DE)?\d{9}$/.test(str);
9328
+ },
9329
+ EL: function EL(str) {
9330
+ return /^(EL)?\d{9}$/.test(str);
9331
+ },
9332
+ HU: function HU(str) {
9333
+ return /^(HU)?\d{8}$/.test(str);
9334
+ },
9335
+ IE: function IE(str) {
9336
+ return /^(IE)?\d{7}\w{1}(W)?$/.test(str);
9337
+ },
9338
+ IT: function IT(str) {
9339
+ return /^(IT)?\d{11}$/.test(str);
9340
+ },
9341
+ LV: function LV(str) {
9342
+ return /^(LV)?\d{11}$/.test(str);
9343
+ },
9344
+ LT: function LT(str) {
9345
+ return /^(LT)?\d{9,12}$/.test(str);
9346
+ },
9347
+ LU: function LU(str) {
9348
+ return /^(LU)?\d{8}$/.test(str);
9349
+ },
9350
+ MT: function MT(str) {
9351
+ return /^(MT)?\d{8}$/.test(str);
9352
+ },
9353
+ NL: function NL(str) {
9354
+ return /^(NL)?\d{9}B\d{2}$/.test(str);
9355
+ },
9356
+ PL: function PL(str) {
9357
+ return /^(PL)?(\d{10}|(\d{3}-\d{3}-\d{2}-\d{2})|(\d{3}-\d{2}-\d{2}-\d{3}))$/.test(str);
9358
+ },
9359
+ PT: PT,
9360
+ RO: function RO(str) {
9361
+ return /^(RO)?\d{2,10}$/.test(str);
9362
+ },
9363
+ SK: function SK(str) {
9364
+ return /^(SK)?\d{10}$/.test(str);
9365
+ },
9366
+ SI: function SI(str) {
9367
+ return /^(SI)?\d{8}$/.test(str);
9368
+ },
9369
+ ES: function ES(str) {
9370
+ return /^(ES)?\w\d{7}[A-Z]$/.test(str);
9371
+ },
9372
+ SE: function SE(str) {
9373
+ return /^(SE)?\d{12}$/.test(str);
9374
+ },
9375
+
9376
+ /**
9377
+ * VAT numbers of non-EU countries
9378
+ */
9379
+ AL: function AL(str) {
9380
+ return /^(AL)?\w{9}[A-Z]$/.test(str);
9381
+ },
9382
+ MK: function MK(str) {
9383
+ return /^(MK)?\d{13}$/.test(str);
9384
+ },
9385
+ AU: function AU(str) {
9386
+ return /^(AU)?\d{11}$/.test(str);
9387
+ },
9388
+ BY: function BY(str) {
9389
+ return /^(УНП )?\d{9}$/.test(str);
9390
+ },
9391
+ CA: function CA(str) {
9392
+ return /^(CA)?\d{9}$/.test(str);
9393
+ },
9394
+ IS: function IS(str) {
9395
+ return /^(IS)?\d{5,6}$/.test(str);
9396
+ },
9397
+ IN: function IN(str) {
9398
+ return /^(IN)?\d{15}$/.test(str);
9399
+ },
9400
+ ID: function ID(str) {
9401
+ return /^(ID)?(\d{15}|(\d{2}.\d{3}.\d{3}.\d{1}-\d{3}.\d{3}))$/.test(str);
9402
+ },
9403
+ IL: function IL(str) {
9404
+ return /^(IL)?\d{9}$/.test(str);
9405
+ },
9406
+ KZ: function KZ(str) {
9407
+ return /^(KZ)?\d{9}$/.test(str);
9408
+ },
9409
+ NZ: function NZ(str) {
9410
+ return /^(NZ)?\d{9}$/.test(str);
9411
+ },
9412
+ NG: function NG(str) {
9413
+ return /^(NG)?(\d{12}|(\d{8}-\d{4}))$/.test(str);
9414
+ },
9415
+ NO: function NO(str) {
9416
+ return /^(NO)?\d{9}MVA$/.test(str);
9417
+ },
9418
+ PH: function PH(str) {
9419
+ return /^(PH)?(\d{12}|\d{3} \d{3} \d{3} \d{3})$/.test(str);
9420
+ },
9421
+ RU: function RU(str) {
9422
+ return /^(RU)?(\d{10}|\d{12})$/.test(str);
9423
+ },
9424
+ SM: function SM(str) {
9425
+ return /^(SM)?\d{5}$/.test(str);
9426
+ },
9427
+ SA: function SA(str) {
9428
+ return /^(SA)?\d{15}$/.test(str);
9429
+ },
9430
+ RS: function RS(str) {
9431
+ return /^(RS)?\d{9}$/.test(str);
9432
+ },
9433
+ CH: function CH(str) {
9434
+ return /^(CH)?(\d{6}|\d{9}|(\d{3}.\d{3})|(\d{3}.\d{3}.\d{3}))(TVA|MWST|IVA)$/.test(str);
9435
+ },
9436
+ TR: function TR(str) {
9437
+ return /^(TR)?\d{10}$/.test(str);
9438
+ },
9439
+ UA: function UA(str) {
9440
+ return /^(UA)?\d{12}$/.test(str);
9441
+ },
9442
+ GB: function GB(str) {
9443
+ return /^GB((\d{3} \d{4} ([0-8][0-9]|9[0-6]))|(\d{9} \d{3})|(((GD[0-4])|(HA[5-9]))[0-9]{2}))$/.test(str);
9444
+ },
9445
+ UZ: function UZ(str) {
9446
+ return /^(UZ)?\d{9}$/.test(str);
9447
+ },
9448
+
9449
+ /**
9450
+ * VAT numbers of Latin American countries
9451
+ */
9452
+ AR: function AR(str) {
9453
+ return /^(AR)?\d{11}$/.test(str);
9454
+ },
9455
+ BO: function BO(str) {
9456
+ return /^(BO)?\d{7}$/.test(str);
9457
+ },
9458
+ BR: function BR(str) {
9459
+ return /^(BR)?((\d{2}.\d{3}.\d{3}\/\d{4}-\d{2})|(\d{3}.\d{3}.\d{3}-\d{2}))$/.test(str);
9460
+ },
9461
+ CL: function CL(str) {
9462
+ return /^(CL)?\d{8}-\d{1}$/.test(str);
9463
+ },
9464
+ CO: function CO(str) {
9465
+ return /^(CO)?\d{10}$/.test(str);
9466
+ },
9467
+ CR: function CR(str) {
9468
+ return /^(CR)?\d{9,12}$/.test(str);
9469
+ },
9470
+ EC: function EC(str) {
9471
+ return /^(EC)?\d{13}$/.test(str);
9472
+ },
9473
+ SV: function SV(str) {
9474
+ return /^(SV)?\d{4}-\d{6}-\d{3}-\d{1}$/.test(str);
9475
+ },
9476
+ GT: function GT(str) {
9477
+ return /^(GT)?\d{7}-\d{1}$/.test(str);
9478
+ },
9479
+ HN: function HN(str) {
9480
+ return /^(HN)?$/.test(str);
9481
+ },
9482
+ MX: function MX(str) {
9483
+ return /^(MX)?\w{3,4}\d{6}\w{3}$/.test(str);
9484
+ },
9485
+ NI: function NI(str) {
9486
+ return /^(NI)?\d{3}-\d{6}-\d{4}\w{1}$/.test(str);
9487
+ },
9488
+ PA: function PA(str) {
9489
+ return /^(PA)?$/.test(str);
9490
+ },
9491
+ PY: function PY(str) {
9492
+ return /^(PY)?\d{6,8}-\d{1}$/.test(str);
9493
+ },
9494
+ PE: function PE(str) {
9495
+ return /^(PE)?\d{11}$/.test(str);
9496
+ },
9497
+ DO: function DO(str) {
9498
+ return /^(DO)?(\d{11}|(\d{3}-\d{7}-\d{1})|[1,4,5]{1}\d{8}|([1,4,5]{1})-\d{2}-\d{5}-\d{1})$/.test(str);
9499
+ },
9500
+ UY: function UY(str) {
9501
+ return /^(UY)?\d{12}$/.test(str);
9502
+ },
9503
+ VE: function VE(str) {
9504
+ return /^(VE)?[J,G,V,E]{1}-(\d{9}|(\d{8}-\d{1}))$/.test(str);
9505
+ }
8978
9506
  };
8979
9507
  exports.vatMatchers = vatMatchers;
8980
9508
 
@@ -8983,12 +9511,12 @@ function isVAT(str, countryCode) {
8983
9511
  (0, _assertString.default)(countryCode);
8984
9512
 
8985
9513
  if (countryCode in vatMatchers) {
8986
- return vatMatchers[countryCode].test(str);
9514
+ return vatMatchers[countryCode](str);
8987
9515
  }
8988
9516
 
8989
9517
  throw new Error("Invalid country code: '".concat(countryCode, "'"));
8990
9518
  }
8991
- },{"./util/assertString":99}],85:[function(require,module,exports){
9519
+ },{"./util/algorithms":101,"./util/assertString":102}],88:[function(require,module,exports){
8992
9520
  "use strict";
8993
9521
 
8994
9522
  Object.defineProperty(exports, "__esModule", {
@@ -9011,7 +9539,7 @@ function isVariableWidth(str) {
9011
9539
 
9012
9540
  module.exports = exports.default;
9013
9541
  module.exports.default = exports.default;
9014
- },{"./isFullWidth":34,"./isHalfWidth":36,"./util/assertString":99}],86:[function(require,module,exports){
9542
+ },{"./isFullWidth":34,"./isHalfWidth":36,"./util/assertString":102}],89:[function(require,module,exports){
9015
9543
  "use strict";
9016
9544
 
9017
9545
  Object.defineProperty(exports, "__esModule", {
@@ -9037,7 +9565,7 @@ function isWhitelisted(str, chars) {
9037
9565
 
9038
9566
  module.exports = exports.default;
9039
9567
  module.exports.default = exports.default;
9040
- },{"./util/assertString":99}],87:[function(require,module,exports){
9568
+ },{"./util/assertString":102}],90:[function(require,module,exports){
9041
9569
  "use strict";
9042
9570
 
9043
9571
  Object.defineProperty(exports, "__esModule", {
@@ -9058,7 +9586,7 @@ function ltrim(str, chars) {
9058
9586
 
9059
9587
  module.exports = exports.default;
9060
9588
  module.exports.default = exports.default;
9061
- },{"./util/assertString":99}],88:[function(require,module,exports){
9589
+ },{"./util/assertString":102}],91:[function(require,module,exports){
9062
9590
  "use strict";
9063
9591
 
9064
9592
  Object.defineProperty(exports, "__esModule", {
@@ -9077,12 +9605,12 @@ function matches(str, pattern, modifiers) {
9077
9605
  pattern = new RegExp(pattern, modifiers);
9078
9606
  }
9079
9607
 
9080
- return pattern.test(str);
9608
+ return !!str.match(pattern);
9081
9609
  }
9082
9610
 
9083
9611
  module.exports = exports.default;
9084
9612
  module.exports.default = exports.default;
9085
- },{"./util/assertString":99}],89:[function(require,module,exports){
9613
+ },{"./util/assertString":102}],92:[function(require,module,exports){
9086
9614
  "use strict";
9087
9615
 
9088
9616
  Object.defineProperty(exports, "__esModule", {
@@ -9234,7 +9762,7 @@ function normalizeEmail(email, options) {
9234
9762
 
9235
9763
  module.exports = exports.default;
9236
9764
  module.exports.default = exports.default;
9237
- },{"./util/merge":101}],90:[function(require,module,exports){
9765
+ },{"./util/merge":104}],93:[function(require,module,exports){
9238
9766
  "use strict";
9239
9767
 
9240
9768
  Object.defineProperty(exports, "__esModule", {
@@ -9267,7 +9795,7 @@ function rtrim(str, chars) {
9267
9795
 
9268
9796
  module.exports = exports.default;
9269
9797
  module.exports.default = exports.default;
9270
- },{"./util/assertString":99}],91:[function(require,module,exports){
9798
+ },{"./util/assertString":102}],94:[function(require,module,exports){
9271
9799
  "use strict";
9272
9800
 
9273
9801
  Object.defineProperty(exports, "__esModule", {
@@ -9289,7 +9817,7 @@ function stripLow(str, keep_new_lines) {
9289
9817
 
9290
9818
  module.exports = exports.default;
9291
9819
  module.exports.default = exports.default;
9292
- },{"./blacklist":6,"./util/assertString":99}],92:[function(require,module,exports){
9820
+ },{"./blacklist":6,"./util/assertString":102}],95:[function(require,module,exports){
9293
9821
  "use strict";
9294
9822
 
9295
9823
  Object.defineProperty(exports, "__esModule", {
@@ -9313,7 +9841,7 @@ function toBoolean(str, strict) {
9313
9841
 
9314
9842
  module.exports = exports.default;
9315
9843
  module.exports.default = exports.default;
9316
- },{"./util/assertString":99}],93:[function(require,module,exports){
9844
+ },{"./util/assertString":102}],96:[function(require,module,exports){
9317
9845
  "use strict";
9318
9846
 
9319
9847
  Object.defineProperty(exports, "__esModule", {
@@ -9333,7 +9861,7 @@ function toDate(date) {
9333
9861
 
9334
9862
  module.exports = exports.default;
9335
9863
  module.exports.default = exports.default;
9336
- },{"./util/assertString":99}],94:[function(require,module,exports){
9864
+ },{"./util/assertString":102}],97:[function(require,module,exports){
9337
9865
  "use strict";
9338
9866
 
9339
9867
  Object.defineProperty(exports, "__esModule", {
@@ -9352,7 +9880,7 @@ function toFloat(str) {
9352
9880
 
9353
9881
  module.exports = exports.default;
9354
9882
  module.exports.default = exports.default;
9355
- },{"./isFloat":33}],95:[function(require,module,exports){
9883
+ },{"./isFloat":33}],98:[function(require,module,exports){
9356
9884
  "use strict";
9357
9885
 
9358
9886
  Object.defineProperty(exports, "__esModule", {
@@ -9371,7 +9899,7 @@ function toInt(str, radix) {
9371
9899
 
9372
9900
  module.exports = exports.default;
9373
9901
  module.exports.default = exports.default;
9374
- },{"./util/assertString":99}],96:[function(require,module,exports){
9902
+ },{"./util/assertString":102}],99:[function(require,module,exports){
9375
9903
  "use strict";
9376
9904
 
9377
9905
  Object.defineProperty(exports, "__esModule", {
@@ -9391,7 +9919,7 @@ function trim(str, chars) {
9391
9919
 
9392
9920
  module.exports = exports.default;
9393
9921
  module.exports.default = exports.default;
9394
- },{"./ltrim":87,"./rtrim":90}],97:[function(require,module,exports){
9922
+ },{"./ltrim":90,"./rtrim":93}],100:[function(require,module,exports){
9395
9923
  "use strict";
9396
9924
 
9397
9925
  Object.defineProperty(exports, "__esModule", {
@@ -9412,7 +9940,7 @@ function unescape(str) {
9412
9940
 
9413
9941
  module.exports = exports.default;
9414
9942
  module.exports.default = exports.default;
9415
- },{"./util/assertString":99}],98:[function(require,module,exports){
9943
+ },{"./util/assertString":102}],101:[function(require,module,exports){
9416
9944
  "use strict";
9417
9945
 
9418
9946
  Object.defineProperty(exports, "__esModule", {
@@ -9514,7 +10042,7 @@ function verhoeffCheck(str) {
9514
10042
 
9515
10043
  return checksum === 0;
9516
10044
  }
9517
- },{}],99:[function(require,module,exports){
10045
+ },{}],102:[function(require,module,exports){
9518
10046
  "use strict";
9519
10047
 
9520
10048
  Object.defineProperty(exports, "__esModule", {
@@ -9537,7 +10065,7 @@ function assertString(input) {
9537
10065
 
9538
10066
  module.exports = exports.default;
9539
10067
  module.exports.default = exports.default;
9540
- },{}],100:[function(require,module,exports){
10068
+ },{}],103:[function(require,module,exports){
9541
10069
  "use strict";
9542
10070
 
9543
10071
  Object.defineProperty(exports, "__esModule", {
@@ -9555,7 +10083,7 @@ var _default = includes;
9555
10083
  exports.default = _default;
9556
10084
  module.exports = exports.default;
9557
10085
  module.exports.default = exports.default;
9558
- },{}],101:[function(require,module,exports){
10086
+ },{}],104:[function(require,module,exports){
9559
10087
  "use strict";
9560
10088
 
9561
10089
  Object.defineProperty(exports, "__esModule", {
@@ -9578,7 +10106,7 @@ function merge() {
9578
10106
 
9579
10107
  module.exports = exports.default;
9580
10108
  module.exports.default = exports.default;
9581
- },{}],102:[function(require,module,exports){
10109
+ },{}],105:[function(require,module,exports){
9582
10110
  "use strict";
9583
10111
 
9584
10112
  Object.defineProperty(exports, "__esModule", {
@@ -9601,7 +10129,7 @@ function multilineRegexp(parts, flags) {
9601
10129
 
9602
10130
  module.exports = exports.default;
9603
10131
  module.exports.default = exports.default;
9604
- },{}],103:[function(require,module,exports){
10132
+ },{}],106:[function(require,module,exports){
9605
10133
  "use strict";
9606
10134
 
9607
10135
  Object.defineProperty(exports, "__esModule", {
@@ -9627,7 +10155,7 @@ function toString(input) {
9627
10155
 
9628
10156
  module.exports = exports.default;
9629
10157
  module.exports.default = exports.default;
9630
- },{}],104:[function(require,module,exports){
10158
+ },{}],107:[function(require,module,exports){
9631
10159
  "use strict";
9632
10160
 
9633
10161
  Object.defineProperty(exports, "__esModule", {
@@ -9646,7 +10174,7 @@ function whitelist(str, chars) {
9646
10174
 
9647
10175
  module.exports = exports.default;
9648
10176
  module.exports.default = exports.default;
9649
- },{"./util/assertString":99}],105:[function(require,module,exports){
10177
+ },{"./util/assertString":102}],108:[function(require,module,exports){
9650
10178
  "use strict";
9651
10179
 
9652
10180
  module.exports = {
@@ -9708,7 +10236,7 @@ module.exports = {
9708
10236
 
9709
10237
  };
9710
10238
 
9711
- },{}],106:[function(require,module,exports){
10239
+ },{}],109:[function(require,module,exports){
9712
10240
  /*jshint maxlen: false*/
9713
10241
 
9714
10242
  var validator = require("validator");
@@ -9839,7 +10367,7 @@ var FormatValidators = {
9839
10367
 
9840
10368
  module.exports = FormatValidators;
9841
10369
 
9842
- },{"validator":4}],107:[function(require,module,exports){
10370
+ },{"validator":4}],110:[function(require,module,exports){
9843
10371
  "use strict";
9844
10372
 
9845
10373
  var FormatValidators = require("./FormatValidators"),
@@ -10462,7 +10990,7 @@ exports.validate = function (report, schema, json) {
10462
10990
 
10463
10991
  };
10464
10992
 
10465
- },{"./FormatValidators":106,"./Report":109,"./Utils":113}],108:[function(require,module,exports){
10993
+ },{"./FormatValidators":109,"./Report":112,"./Utils":116}],111:[function(require,module,exports){
10466
10994
  // Number.isFinite polyfill
10467
10995
  // http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isfinite
10468
10996
  if (typeof Number.isFinite !== "function") {
@@ -10480,7 +11008,7 @@ if (typeof Number.isFinite !== "function") {
10480
11008
  };
10481
11009
  }
10482
11010
 
10483
- },{}],109:[function(require,module,exports){
11011
+ },{}],112:[function(require,module,exports){
10484
11012
  (function (process){(function (){
10485
11013
  "use strict";
10486
11014
 
@@ -10783,7 +11311,7 @@ Report.prototype.addCustomError = function (errorCode, errorMessage, params, sub
10783
11311
  module.exports = Report;
10784
11312
 
10785
11313
  }).call(this)}).call(this,require('_process'))
10786
- },{"./Errors":105,"./Utils":113,"_process":3,"lodash.get":1}],110:[function(require,module,exports){
11314
+ },{"./Errors":108,"./Utils":116,"_process":3,"lodash.get":1}],113:[function(require,module,exports){
10787
11315
  "use strict";
10788
11316
 
10789
11317
  var isequal = require("lodash.isequal");
@@ -10973,7 +11501,7 @@ exports.getSchemaByUri = function (report, uri, root) {
10973
11501
 
10974
11502
  exports.getRemotePath = getRemotePath;
10975
11503
 
10976
- },{"./Report":109,"./SchemaCompilation":111,"./SchemaValidation":112,"./Utils":113,"lodash.isequal":2}],111:[function(require,module,exports){
11504
+ },{"./Report":112,"./SchemaCompilation":114,"./SchemaValidation":115,"./Utils":116,"lodash.isequal":2}],114:[function(require,module,exports){
10977
11505
  "use strict";
10978
11506
 
10979
11507
  var Report = require("./Report");
@@ -11274,7 +11802,7 @@ exports.compileSchema = function (report, schema) {
11274
11802
 
11275
11803
  };
11276
11804
 
11277
- },{"./Report":109,"./SchemaCache":110,"./Utils":113}],112:[function(require,module,exports){
11805
+ },{"./Report":112,"./SchemaCache":113,"./Utils":116}],115:[function(require,module,exports){
11278
11806
  "use strict";
11279
11807
 
11280
11808
  var FormatValidators = require("./FormatValidators"),
@@ -11895,7 +12423,7 @@ exports.validateSchema = function (report, schema) {
11895
12423
  return isValid;
11896
12424
  };
11897
12425
 
11898
- },{"./FormatValidators":106,"./JsonValidation":107,"./Report":109,"./Utils":113}],113:[function(require,module,exports){
12426
+ },{"./FormatValidators":109,"./JsonValidation":110,"./Report":112,"./Utils":116}],116:[function(require,module,exports){
11899
12427
  "use strict";
11900
12428
 
11901
12429
  exports.jsonSymbol = Symbol.for("z-schema/json");
@@ -12171,7 +12699,7 @@ exports.ucs2decode = function (string) {
12171
12699
  };
12172
12700
  /*jshint +W016*/
12173
12701
 
12174
- },{}],114:[function(require,module,exports){
12702
+ },{}],117:[function(require,module,exports){
12175
12703
  (function (process){(function (){
12176
12704
  "use strict";
12177
12705
 
@@ -12584,7 +13112,7 @@ ZSchema.jsonSymbol = Utils.jsonSymbol;
12584
13112
  module.exports = ZSchema;
12585
13113
 
12586
13114
  }).call(this)}).call(this,require('_process'))
12587
- },{"./FormatValidators":106,"./JsonValidation":107,"./Polyfills":108,"./Report":109,"./SchemaCache":110,"./SchemaCompilation":111,"./SchemaValidation":112,"./Utils":113,"./schemas/hyper-schema.json":115,"./schemas/schema.json":116,"_process":3,"lodash.get":1}],115:[function(require,module,exports){
13115
+ },{"./FormatValidators":109,"./JsonValidation":110,"./Polyfills":111,"./Report":112,"./SchemaCache":113,"./SchemaCompilation":114,"./SchemaValidation":115,"./Utils":116,"./schemas/hyper-schema.json":118,"./schemas/schema.json":119,"_process":3,"lodash.get":1}],118:[function(require,module,exports){
12588
13116
  module.exports={
12589
13117
  "$schema": "http://json-schema.org/draft-04/hyper-schema#",
12590
13118
  "id": "http://json-schema.org/draft-04/hyper-schema#",
@@ -12744,7 +13272,7 @@ module.exports={
12744
13272
  }
12745
13273
 
12746
13274
 
12747
- },{}],116:[function(require,module,exports){
13275
+ },{}],119:[function(require,module,exports){
12748
13276
  module.exports={
12749
13277
  "id": "http://json-schema.org/draft-04/schema#",
12750
13278
  "$schema": "http://json-schema.org/draft-04/schema#",
@@ -12897,5 +13425,5 @@ module.exports={
12897
13425
  "default": {}
12898
13426
  }
12899
13427
 
12900
- },{}]},{},[105,106,107,108,109,110,111,112,113,114])(114)
13428
+ },{}]},{},[108,109,110,111,112,113,114,115,116,117])(117)
12901
13429
  });