z-schema 3.18.3 → 3.18.4

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.
@@ -3106,6 +3106,10 @@ var _isMD = require('./lib/isMD5');
3106
3106
 
3107
3107
  var _isMD2 = _interopRequireDefault(_isMD);
3108
3108
 
3109
+ var _isHash = require('./lib/isHash');
3110
+
3111
+ var _isHash2 = _interopRequireDefault(_isHash);
3112
+
3109
3113
  var _isJSON = require('./lib/isJSON');
3110
3114
 
3111
3115
  var _isJSON2 = _interopRequireDefault(_isJSON);
@@ -3178,6 +3182,14 @@ var _isDataURI = require('./lib/isDataURI');
3178
3182
 
3179
3183
  var _isDataURI2 = _interopRequireDefault(_isDataURI);
3180
3184
 
3185
+ var _isLatLong = require('./lib/isLatLong');
3186
+
3187
+ var _isLatLong2 = _interopRequireDefault(_isLatLong);
3188
+
3189
+ var _isPostalCode = require('./lib/isPostalCode');
3190
+
3191
+ var _isPostalCode2 = _interopRequireDefault(_isPostalCode);
3192
+
3181
3193
  var _ltrim = require('./lib/ltrim');
3182
3194
 
3183
3195
  var _ltrim2 = _interopRequireDefault(_ltrim);
@@ -3224,7 +3236,7 @@ var _toString2 = _interopRequireDefault(_toString);
3224
3236
 
3225
3237
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3226
3238
 
3227
- var version = '8.0.0';
3239
+ var version = '8.2.0';
3228
3240
 
3229
3241
  var validator = {
3230
3242
  version: version,
@@ -3260,6 +3272,7 @@ var validator = {
3260
3272
  isHexColor: _isHexColor2.default,
3261
3273
  isISRC: _isISRC2.default,
3262
3274
  isMD5: _isMD2.default,
3275
+ isHash: _isHash2.default,
3263
3276
  isJSON: _isJSON2.default,
3264
3277
  isEmpty: _isEmpty2.default,
3265
3278
  isLength: _isLength2.default,
@@ -3274,10 +3287,12 @@ var validator = {
3274
3287
  isISBN: _isISBN2.default,
3275
3288
  isISSN: _isISSN2.default,
3276
3289
  isMobilePhone: _isMobilePhone2.default,
3290
+ isPostalCode: _isPostalCode2.default,
3277
3291
  isCurrency: _isCurrency2.default,
3278
3292
  isISO8601: _isISO2.default,
3279
3293
  isBase64: _isBase2.default,
3280
3294
  isDataURI: _isDataURI2.default,
3295
+ isLatLong: _isLatLong2.default,
3281
3296
  ltrim: _ltrim2.default,
3282
3297
  rtrim: _rtrim2.default,
3283
3298
  trim: _trim2.default,
@@ -3293,7 +3308,7 @@ var validator = {
3293
3308
 
3294
3309
  exports.default = validator;
3295
3310
  module.exports = exports['default'];
3296
- },{"./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/isBase64":14,"./lib/isBefore":15,"./lib/isBoolean":16,"./lib/isByteLength":17,"./lib/isCreditCard":18,"./lib/isCurrency":19,"./lib/isDataURI":20,"./lib/isDecimal":21,"./lib/isDivisibleBy":22,"./lib/isEmail":23,"./lib/isEmpty":24,"./lib/isFQDN":25,"./lib/isFloat":26,"./lib/isFullWidth":27,"./lib/isHalfWidth":28,"./lib/isHexColor":29,"./lib/isHexadecimal":30,"./lib/isIP":31,"./lib/isISBN":32,"./lib/isISIN":33,"./lib/isISO8601":34,"./lib/isISRC":35,"./lib/isISSN":36,"./lib/isIn":37,"./lib/isInt":38,"./lib/isJSON":39,"./lib/isLength":40,"./lib/isLowercase":41,"./lib/isMACAddress":42,"./lib/isMD5":43,"./lib/isMobilePhone":44,"./lib/isMongoId":45,"./lib/isMultibyte":46,"./lib/isNumeric":47,"./lib/isSurrogatePair":48,"./lib/isURL":49,"./lib/isUUID":50,"./lib/isUppercase":51,"./lib/isVariableWidth":52,"./lib/isWhitelisted":53,"./lib/ltrim":54,"./lib/matches":55,"./lib/normalizeEmail":56,"./lib/rtrim":57,"./lib/stripLow":58,"./lib/toBoolean":59,"./lib/toDate":60,"./lib/toFloat":61,"./lib/toInt":62,"./lib/trim":63,"./lib/unescape":64,"./lib/util/toString":67,"./lib/whitelist":68}],5:[function(require,module,exports){
3311
+ },{"./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/isBase64":14,"./lib/isBefore":15,"./lib/isBoolean":16,"./lib/isByteLength":17,"./lib/isCreditCard":18,"./lib/isCurrency":19,"./lib/isDataURI":20,"./lib/isDecimal":21,"./lib/isDivisibleBy":22,"./lib/isEmail":23,"./lib/isEmpty":24,"./lib/isFQDN":25,"./lib/isFloat":26,"./lib/isFullWidth":27,"./lib/isHalfWidth":28,"./lib/isHash":29,"./lib/isHexColor":30,"./lib/isHexadecimal":31,"./lib/isIP":32,"./lib/isISBN":33,"./lib/isISIN":34,"./lib/isISO8601":35,"./lib/isISRC":36,"./lib/isISSN":37,"./lib/isIn":38,"./lib/isInt":39,"./lib/isJSON":40,"./lib/isLatLong":41,"./lib/isLength":42,"./lib/isLowercase":43,"./lib/isMACAddress":44,"./lib/isMD5":45,"./lib/isMobilePhone":46,"./lib/isMongoId":47,"./lib/isMultibyte":48,"./lib/isNumeric":49,"./lib/isPostalCode":50,"./lib/isSurrogatePair":51,"./lib/isURL":52,"./lib/isUUID":53,"./lib/isUppercase":54,"./lib/isVariableWidth":55,"./lib/isWhitelisted":56,"./lib/ltrim":57,"./lib/matches":58,"./lib/normalizeEmail":59,"./lib/rtrim":60,"./lib/stripLow":61,"./lib/toBoolean":62,"./lib/toDate":63,"./lib/toFloat":64,"./lib/toInt":65,"./lib/trim":66,"./lib/unescape":67,"./lib/util/toString":70,"./lib/whitelist":71}],5:[function(require,module,exports){
3297
3312
  'use strict';
3298
3313
 
3299
3314
  Object.defineProperty(exports, "__esModule", {
@@ -3306,13 +3321,17 @@ var alpha = exports.alpha = {
3306
3321
  'de-DE': /^[A-ZÄÖÜß]+$/i,
3307
3322
  'es-ES': /^[A-ZÁÉÍÑÓÚÜ]+$/i,
3308
3323
  'fr-FR': /^[A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,
3309
- 'nl-NL': /^[A-ZÉËÏÓÖÜ]+$/i,
3324
+ 'it-IT': /^[A-ZÀÉÈÌÎÓÒÙ]+$/i,
3325
+ 'nb-NO': /^[A-ZÆØÅ]+$/i,
3326
+ 'nl-NL': /^[A-ZÁÉËÏÓÖÜÚ]+$/i,
3327
+ 'nn-NO': /^[A-ZÆØÅ]+$/i,
3310
3328
  'hu-HU': /^[A-ZÁÉÍÓÖŐÚÜŰ]+$/i,
3311
3329
  'pl-PL': /^[A-ZĄĆĘŚŁŃÓŻŹ]+$/i,
3312
3330
  'pt-PT': /^[A-ZÃÁÀÂÇÉÊÍÕÓÔÚÜ]+$/i,
3313
3331
  'ru-RU': /^[А-ЯЁ]+$/i,
3314
3332
  'sr-RS@latin': /^[A-ZČĆŽŠĐ]+$/i,
3315
3333
  'sr-RS': /^[А-ЯЂЈЉЊЋЏ]+$/i,
3334
+ 'sv-SE': /^[A-ZÅÄÖ]+$/i,
3316
3335
  'tr-TR': /^[A-ZÇĞİıÖŞÜ]+$/i,
3317
3336
  'uk-UA': /^[А-ЩЬЮЯЄIЇҐ]+$/i,
3318
3337
  ar: /^[ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/
@@ -3321,17 +3340,21 @@ var alpha = exports.alpha = {
3321
3340
  var alphanumeric = exports.alphanumeric = {
3322
3341
  'en-US': /^[0-9A-Z]+$/i,
3323
3342
  'cs-CZ': /^[0-9A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i,
3324
- 'da-DK': /^[0-9A-ZÆØÅ]$/i,
3343
+ 'da-DK': /^[0-9A-ZÆØÅ]+$/i,
3325
3344
  'de-DE': /^[0-9A-ZÄÖÜß]+$/i,
3326
3345
  'es-ES': /^[0-9A-ZÁÉÍÑÓÚÜ]+$/i,
3327
3346
  'fr-FR': /^[0-9A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,
3347
+ 'it-IT': /^[0-9A-ZÀÉÈÌÎÓÒÙ]+$/i,
3328
3348
  'hu-HU': /^[0-9A-ZÁÉÍÓÖŐÚÜŰ]+$/i,
3329
- 'nl-NL': /^[0-9A-ZÉËÏÓÖÜ]+$/i,
3349
+ 'nb-NO': /^[0-9A-ZÆØÅ]+$/i,
3350
+ 'nl-NL': /^[0-9A-ZÁÉËÏÓÖÜÚ]+$/i,
3351
+ 'nn-NO': /^[0-9A-ZÆØÅ]+$/i,
3330
3352
  'pl-PL': /^[0-9A-ZĄĆĘŚŁŃÓŻŹ]+$/i,
3331
3353
  'pt-PT': /^[0-9A-ZÃÁÀÂÇÉÊÍÕÓÔÚÜ]+$/i,
3332
3354
  'ru-RU': /^[0-9А-ЯЁ]+$/i,
3333
3355
  'sr-RS@latin': /^[0-9A-ZČĆŽŠĐ]+$/i,
3334
3356
  'sr-RS': /^[0-9А-ЯЂЈЉЊЋЏ]+$/i,
3357
+ 'sv-SE': /^[0-9A-ZÅÄÖ]+$/i,
3335
3358
  'tr-TR': /^[0-9A-ZÇĞİıÖŞÜ]+$/i,
3336
3359
  'uk-UA': /^[0-9А-ЩЬЮЯЄIЇҐ]+$/i,
3337
3360
  ar: /^[٠١٢٣٤٥٦٧٨٩0-9ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/
@@ -3375,7 +3398,7 @@ function blacklist(str, chars) {
3375
3398
  return str.replace(new RegExp('[' + chars + ']+', 'g'), '');
3376
3399
  }
3377
3400
  module.exports = exports['default'];
3378
- },{"./util/assertString":65}],7:[function(require,module,exports){
3401
+ },{"./util/assertString":68}],7:[function(require,module,exports){
3379
3402
  'use strict';
3380
3403
 
3381
3404
  Object.defineProperty(exports, "__esModule", {
@@ -3398,7 +3421,7 @@ function contains(str, elem) {
3398
3421
  return str.indexOf((0, _toString2.default)(elem)) >= 0;
3399
3422
  }
3400
3423
  module.exports = exports['default'];
3401
- },{"./util/assertString":65,"./util/toString":67}],8:[function(require,module,exports){
3424
+ },{"./util/assertString":68,"./util/toString":70}],8:[function(require,module,exports){
3402
3425
  'use strict';
3403
3426
 
3404
3427
  Object.defineProperty(exports, "__esModule", {
@@ -3417,7 +3440,7 @@ function equals(str, comparison) {
3417
3440
  return str === comparison;
3418
3441
  }
3419
3442
  module.exports = exports['default'];
3420
- },{"./util/assertString":65}],9:[function(require,module,exports){
3443
+ },{"./util/assertString":68}],9:[function(require,module,exports){
3421
3444
  'use strict';
3422
3445
 
3423
3446
  Object.defineProperty(exports, "__esModule", {
@@ -3436,7 +3459,7 @@ function escape(str) {
3436
3459
  return str.replace(/&/g, '&amp;').replace(/"/g, '&quot;').replace(/'/g, '&#x27;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\//g, '&#x2F;').replace(/\\/g, '&#x5C;').replace(/`/g, '&#96;');
3437
3460
  }
3438
3461
  module.exports = exports['default'];
3439
- },{"./util/assertString":65}],10:[function(require,module,exports){
3462
+ },{"./util/assertString":68}],10:[function(require,module,exports){
3440
3463
  'use strict';
3441
3464
 
3442
3465
  Object.defineProperty(exports, "__esModule", {
@@ -3463,7 +3486,7 @@ function isAfter(str) {
3463
3486
  return !!(original && comparison && original > comparison);
3464
3487
  }
3465
3488
  module.exports = exports['default'];
3466
- },{"./toDate":60,"./util/assertString":65}],11:[function(require,module,exports){
3489
+ },{"./toDate":63,"./util/assertString":68}],11:[function(require,module,exports){
3467
3490
  'use strict';
3468
3491
 
3469
3492
  Object.defineProperty(exports, "__esModule", {
@@ -3489,7 +3512,7 @@ function isAlpha(str) {
3489
3512
  throw new Error('Invalid locale \'' + locale + '\'');
3490
3513
  }
3491
3514
  module.exports = exports['default'];
3492
- },{"./alpha":5,"./util/assertString":65}],12:[function(require,module,exports){
3515
+ },{"./alpha":5,"./util/assertString":68}],12:[function(require,module,exports){
3493
3516
  'use strict';
3494
3517
 
3495
3518
  Object.defineProperty(exports, "__esModule", {
@@ -3515,7 +3538,7 @@ function isAlphanumeric(str) {
3515
3538
  throw new Error('Invalid locale \'' + locale + '\'');
3516
3539
  }
3517
3540
  module.exports = exports['default'];
3518
- },{"./alpha":5,"./util/assertString":65}],13:[function(require,module,exports){
3541
+ },{"./alpha":5,"./util/assertString":68}],13:[function(require,module,exports){
3519
3542
  'use strict';
3520
3543
 
3521
3544
  Object.defineProperty(exports, "__esModule", {
@@ -3538,7 +3561,7 @@ function isAscii(str) {
3538
3561
  return ascii.test(str);
3539
3562
  }
3540
3563
  module.exports = exports['default'];
3541
- },{"./util/assertString":65}],14:[function(require,module,exports){
3564
+ },{"./util/assertString":68}],14:[function(require,module,exports){
3542
3565
  'use strict';
3543
3566
 
3544
3567
  Object.defineProperty(exports, "__esModule", {
@@ -3564,7 +3587,7 @@ function isBase64(str) {
3564
3587
  return firstPaddingChar === -1 || firstPaddingChar === len - 1 || firstPaddingChar === len - 2 && str[len - 1] === '=';
3565
3588
  }
3566
3589
  module.exports = exports['default'];
3567
- },{"./util/assertString":65}],15:[function(require,module,exports){
3590
+ },{"./util/assertString":68}],15:[function(require,module,exports){
3568
3591
  'use strict';
3569
3592
 
3570
3593
  Object.defineProperty(exports, "__esModule", {
@@ -3591,7 +3614,7 @@ function isBefore(str) {
3591
3614
  return !!(original && comparison && original < comparison);
3592
3615
  }
3593
3616
  module.exports = exports['default'];
3594
- },{"./toDate":60,"./util/assertString":65}],16:[function(require,module,exports){
3617
+ },{"./toDate":63,"./util/assertString":68}],16:[function(require,module,exports){
3595
3618
  'use strict';
3596
3619
 
3597
3620
  Object.defineProperty(exports, "__esModule", {
@@ -3610,7 +3633,7 @@ function isBoolean(str) {
3610
3633
  return ['true', 'false', '1', '0'].indexOf(str) >= 0;
3611
3634
  }
3612
3635
  module.exports = exports['default'];
3613
- },{"./util/assertString":65}],17:[function(require,module,exports){
3636
+ },{"./util/assertString":68}],17:[function(require,module,exports){
3614
3637
  'use strict';
3615
3638
 
3616
3639
  Object.defineProperty(exports, "__esModule", {
@@ -3644,7 +3667,7 @@ function isByteLength(str, options) {
3644
3667
  return len >= min && (typeof max === 'undefined' || len <= max);
3645
3668
  }
3646
3669
  module.exports = exports['default'];
3647
- },{"./util/assertString":65}],18:[function(require,module,exports){
3670
+ },{"./util/assertString":68}],18:[function(require,module,exports){
3648
3671
  'use strict';
3649
3672
 
3650
3673
  Object.defineProperty(exports, "__esModule", {
@@ -3690,7 +3713,7 @@ function isCreditCard(str) {
3690
3713
  return !!(sum % 10 === 0 ? sanitized : false);
3691
3714
  }
3692
3715
  module.exports = exports['default'];
3693
- },{"./util/assertString":65}],19:[function(require,module,exports){
3716
+ },{"./util/assertString":68}],19:[function(require,module,exports){
3694
3717
  'use strict';
3695
3718
 
3696
3719
  Object.defineProperty(exports, "__esModule", {
@@ -3709,14 +3732,18 @@ var _assertString2 = _interopRequireDefault(_assertString);
3709
3732
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3710
3733
 
3711
3734
  function currencyRegex(options) {
3735
+ var decimal_digits = '\\d{' + options.digits_after_decimal[0] + '}';
3736
+ options.digits_after_decimal.forEach(function (digit, index) {
3737
+ if (index !== 0) decimal_digits = decimal_digits + '|\\d{' + digit + '}';
3738
+ });
3712
3739
  var symbol = '(\\' + options.symbol.replace(/\./g, '\\.') + ')' + (options.require_symbol ? '' : '?'),
3713
3740
  negative = '-?',
3714
3741
  whole_dollar_amount_without_sep = '[1-9]\\d*',
3715
3742
  whole_dollar_amount_with_sep = '[1-9]\\d{0,2}(\\' + options.thousands_separator + '\\d{3})*',
3716
3743
  valid_whole_dollar_amounts = ['0', whole_dollar_amount_without_sep, whole_dollar_amount_with_sep],
3717
3744
  whole_dollar_amount = '(' + valid_whole_dollar_amounts.join('|') + ')?',
3718
- decimal_amount = '(\\' + options.decimal_separator + '\\d{2})?';
3719
- var pattern = whole_dollar_amount + decimal_amount;
3745
+ decimal_amount = '(\\' + options.decimal_separator + '(' + decimal_digits + '))' + (options.require_decimal ? '' : '?');
3746
+ var pattern = whole_dollar_amount + (options.allow_decimal || options.require_decimal ? decimal_amount : '');
3720
3747
 
3721
3748
  // default is negative sign before symbol, but there are two other options (besides parens)
3722
3749
  if (options.allow_negatives && !options.parens_for_negatives) {
@@ -3767,6 +3794,9 @@ var default_currency_options = {
3767
3794
  allow_negative_sign_placeholder: false,
3768
3795
  thousands_separator: ',',
3769
3796
  decimal_separator: '.',
3797
+ allow_decimal: true,
3798
+ require_decimal: false,
3799
+ digits_after_decimal: [2],
3770
3800
  allow_space_after_digits: false
3771
3801
  };
3772
3802
 
@@ -3776,7 +3806,7 @@ function isCurrency(str, options) {
3776
3806
  return currencyRegex(options).test(str);
3777
3807
  }
3778
3808
  module.exports = exports['default'];
3779
- },{"./util/assertString":65,"./util/merge":66}],20:[function(require,module,exports){
3809
+ },{"./util/assertString":68,"./util/merge":69}],20:[function(require,module,exports){
3780
3810
  'use strict';
3781
3811
 
3782
3812
  Object.defineProperty(exports, "__esModule", {
@@ -3797,7 +3827,7 @@ function isDataURI(str) {
3797
3827
  return dataURI.test(str);
3798
3828
  }
3799
3829
  module.exports = exports['default'];
3800
- },{"./util/assertString":65}],21:[function(require,module,exports){
3830
+ },{"./util/assertString":68}],21:[function(require,module,exports){
3801
3831
  'use strict';
3802
3832
 
3803
3833
  Object.defineProperty(exports, "__esModule", {
@@ -3818,7 +3848,7 @@ function isDecimal(str) {
3818
3848
  return str !== '' && decimal.test(str);
3819
3849
  }
3820
3850
  module.exports = exports['default'];
3821
- },{"./util/assertString":65}],22:[function(require,module,exports){
3851
+ },{"./util/assertString":68}],22:[function(require,module,exports){
3822
3852
  'use strict';
3823
3853
 
3824
3854
  Object.defineProperty(exports, "__esModule", {
@@ -3841,7 +3871,7 @@ function isDivisibleBy(str, num) {
3841
3871
  return (0, _toFloat2.default)(str) % parseInt(num, 10) === 0;
3842
3872
  }
3843
3873
  module.exports = exports['default'];
3844
- },{"./toFloat":61,"./util/assertString":65}],23:[function(require,module,exports){
3874
+ },{"./toFloat":64,"./util/assertString":68}],23:[function(require,module,exports){
3845
3875
  'use strict';
3846
3876
 
3847
3877
  Object.defineProperty(exports, "__esModule", {
@@ -3876,7 +3906,7 @@ var default_email_options = {
3876
3906
 
3877
3907
  /* eslint-disable max-len */
3878
3908
  /* eslint-disable no-control-regex */
3879
- var displayName = /^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\.\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\.\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF\s]*<(.+)>$/i;
3909
+ var displayName = /^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\.\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\,\.\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF\s]*<(.+)>$/i;
3880
3910
  var emailUserPart = /^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i;
3881
3911
  var quotedEmailUser = /^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i;
3882
3912
  var emailUserUtf8Part = /^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i;
@@ -3931,7 +3961,7 @@ function isEmail(str, options) {
3931
3961
  return true;
3932
3962
  }
3933
3963
  module.exports = exports['default'];
3934
- },{"./isByteLength":17,"./isFQDN":25,"./util/assertString":65,"./util/merge":66}],24:[function(require,module,exports){
3964
+ },{"./isByteLength":17,"./isFQDN":25,"./util/assertString":68,"./util/merge":69}],24:[function(require,module,exports){
3935
3965
  'use strict';
3936
3966
 
3937
3967
  Object.defineProperty(exports, "__esModule", {
@@ -3950,7 +3980,7 @@ function isEmpty(str) {
3950
3980
  return str.length === 0;
3951
3981
  }
3952
3982
  module.exports = exports['default'];
3953
- },{"./util/assertString":65}],25:[function(require,module,exports){
3983
+ },{"./util/assertString":68}],25:[function(require,module,exports){
3954
3984
  'use strict';
3955
3985
 
3956
3986
  Object.defineProperty(exports, "__esModule", {
@@ -4012,7 +4042,7 @@ function isFDQN(str, options) {
4012
4042
  return true;
4013
4043
  }
4014
4044
  module.exports = exports['default'];
4015
- },{"./util/assertString":65,"./util/merge":66}],26:[function(require,module,exports){
4045
+ },{"./util/assertString":68,"./util/merge":69}],26:[function(require,module,exports){
4016
4046
  'use strict';
4017
4047
 
4018
4048
  Object.defineProperty(exports, "__esModule", {
@@ -4037,7 +4067,7 @@ function isFloat(str, options) {
4037
4067
  return float.test(str) && (!options.hasOwnProperty('min') || str >= options.min) && (!options.hasOwnProperty('max') || str <= options.max) && (!options.hasOwnProperty('lt') || str < options.lt) && (!options.hasOwnProperty('gt') || str > options.gt);
4038
4068
  }
4039
4069
  module.exports = exports['default'];
4040
- },{"./util/assertString":65}],27:[function(require,module,exports){
4070
+ },{"./util/assertString":68}],27:[function(require,module,exports){
4041
4071
  'use strict';
4042
4072
 
4043
4073
  Object.defineProperty(exports, "__esModule", {
@@ -4058,7 +4088,7 @@ function isFullWidth(str) {
4058
4088
  (0, _assertString2.default)(str);
4059
4089
  return fullWidth.test(str);
4060
4090
  }
4061
- },{"./util/assertString":65}],28:[function(require,module,exports){
4091
+ },{"./util/assertString":68}],28:[function(require,module,exports){
4062
4092
  'use strict';
4063
4093
 
4064
4094
  Object.defineProperty(exports, "__esModule", {
@@ -4079,7 +4109,43 @@ function isHalfWidth(str) {
4079
4109
  (0, _assertString2.default)(str);
4080
4110
  return halfWidth.test(str);
4081
4111
  }
4082
- },{"./util/assertString":65}],29:[function(require,module,exports){
4112
+ },{"./util/assertString":68}],29:[function(require,module,exports){
4113
+ 'use strict';
4114
+
4115
+ Object.defineProperty(exports, "__esModule", {
4116
+ value: true
4117
+ });
4118
+ exports.default = isHash;
4119
+
4120
+ var _assertString = require('./util/assertString');
4121
+
4122
+ var _assertString2 = _interopRequireDefault(_assertString);
4123
+
4124
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
4125
+
4126
+ var lengths = {
4127
+ md5: 32,
4128
+ md4: 32,
4129
+ sha1: 40,
4130
+ sha256: 64,
4131
+ sha384: 96,
4132
+ sha512: 128,
4133
+ ripemd128: 32,
4134
+ ripemd160: 40,
4135
+ tiger128: 32,
4136
+ tiger160: 40,
4137
+ tiger192: 48,
4138
+ crc32: 8,
4139
+ crc32b: 8
4140
+ };
4141
+
4142
+ function isHash(str, algorithm) {
4143
+ (0, _assertString2.default)(str);
4144
+ var hash = new RegExp('^[a-f0-9]{' + lengths[algorithm] + '}$');
4145
+ return hash.test(str);
4146
+ }
4147
+ module.exports = exports['default'];
4148
+ },{"./util/assertString":68}],30:[function(require,module,exports){
4083
4149
  'use strict';
4084
4150
 
4085
4151
  Object.defineProperty(exports, "__esModule", {
@@ -4100,7 +4166,7 @@ function isHexColor(str) {
4100
4166
  return hexcolor.test(str);
4101
4167
  }
4102
4168
  module.exports = exports['default'];
4103
- },{"./util/assertString":65}],30:[function(require,module,exports){
4169
+ },{"./util/assertString":68}],31:[function(require,module,exports){
4104
4170
  'use strict';
4105
4171
 
4106
4172
  Object.defineProperty(exports, "__esModule", {
@@ -4121,7 +4187,7 @@ function isHexadecimal(str) {
4121
4187
  return hexadecimal.test(str);
4122
4188
  }
4123
4189
  module.exports = exports['default'];
4124
- },{"./util/assertString":65}],31:[function(require,module,exports){
4190
+ },{"./util/assertString":68}],32:[function(require,module,exports){
4125
4191
  'use strict';
4126
4192
 
4127
4193
  Object.defineProperty(exports, "__esModule", {
@@ -4203,7 +4269,7 @@ function isIP(str) {
4203
4269
  return false;
4204
4270
  }
4205
4271
  module.exports = exports['default'];
4206
- },{"./util/assertString":65}],32:[function(require,module,exports){
4272
+ },{"./util/assertString":68}],33:[function(require,module,exports){
4207
4273
  'use strict';
4208
4274
 
4209
4275
  Object.defineProperty(exports, "__esModule", {
@@ -4261,7 +4327,7 @@ function isISBN(str) {
4261
4327
  return false;
4262
4328
  }
4263
4329
  module.exports = exports['default'];
4264
- },{"./util/assertString":65}],33:[function(require,module,exports){
4330
+ },{"./util/assertString":68}],34:[function(require,module,exports){
4265
4331
  'use strict';
4266
4332
 
4267
4333
  Object.defineProperty(exports, "__esModule", {
@@ -4310,18 +4376,13 @@ function isISIN(str) {
4310
4376
  return parseInt(str.substr(str.length - 1), 10) === (10000 - sum) % 10;
4311
4377
  }
4312
4378
  module.exports = exports['default'];
4313
- },{"./util/assertString":65}],34:[function(require,module,exports){
4379
+ },{"./util/assertString":68}],35:[function(require,module,exports){
4314
4380
  'use strict';
4315
4381
 
4316
4382
  Object.defineProperty(exports, "__esModule", {
4317
4383
  value: true
4318
4384
  });
4319
- exports.iso8601 = undefined;
4320
-
4321
- exports.default = function (str) {
4322
- (0, _assertString2.default)(str);
4323
- return iso8601.test(str);
4324
- };
4385
+ exports.default = isISO8601;
4325
4386
 
4326
4387
  var _assertString = require('./util/assertString');
4327
4388
 
@@ -4331,9 +4392,15 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
4331
4392
 
4332
4393
  /* eslint-disable max-len */
4333
4394
  // from http://goo.gl/0ejHHW
4334
- var iso8601 = exports.iso8601 = /^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/;
4395
+ var iso8601 = /^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/;
4335
4396
  /* eslint-enable max-len */
4336
- },{"./util/assertString":65}],35:[function(require,module,exports){
4397
+
4398
+ function isISO8601(str) {
4399
+ (0, _assertString2.default)(str);
4400
+ return iso8601.test(str);
4401
+ }
4402
+ module.exports = exports['default'];
4403
+ },{"./util/assertString":68}],36:[function(require,module,exports){
4337
4404
  'use strict';
4338
4405
 
4339
4406
  Object.defineProperty(exports, "__esModule", {
@@ -4355,7 +4422,7 @@ function isISRC(str) {
4355
4422
  return isrc.test(str);
4356
4423
  }
4357
4424
  module.exports = exports['default'];
4358
- },{"./util/assertString":65}],36:[function(require,module,exports){
4425
+ },{"./util/assertString":68}],37:[function(require,module,exports){
4359
4426
  'use strict';
4360
4427
 
4361
4428
  Object.defineProperty(exports, "__esModule", {
@@ -4414,7 +4481,7 @@ function isISSN(str) {
4414
4481
  return checksum % 11 === 0;
4415
4482
  }
4416
4483
  module.exports = exports['default'];
4417
- },{"./util/assertString":65}],37:[function(require,module,exports){
4484
+ },{"./util/assertString":68}],38:[function(require,module,exports){
4418
4485
  'use strict';
4419
4486
 
4420
4487
  Object.defineProperty(exports, "__esModule", {
@@ -4454,7 +4521,7 @@ function isIn(str, options) {
4454
4521
  return false;
4455
4522
  }
4456
4523
  module.exports = exports['default'];
4457
- },{"./util/assertString":65,"./util/toString":67}],38:[function(require,module,exports){
4524
+ },{"./util/assertString":68,"./util/toString":70}],39:[function(require,module,exports){
4458
4525
  'use strict';
4459
4526
 
4460
4527
  Object.defineProperty(exports, "__esModule", {
@@ -4488,7 +4555,7 @@ function isInt(str, options) {
4488
4555
  return regex.test(str) && minCheckPassed && maxCheckPassed && ltCheckPassed && gtCheckPassed;
4489
4556
  }
4490
4557
  module.exports = exports['default'];
4491
- },{"./util/assertString":65}],39:[function(require,module,exports){
4558
+ },{"./util/assertString":68}],40:[function(require,module,exports){
4492
4559
  'use strict';
4493
4560
 
4494
4561
  Object.defineProperty(exports, "__esModule", {
@@ -4514,7 +4581,31 @@ function isJSON(str) {
4514
4581
  return false;
4515
4582
  }
4516
4583
  module.exports = exports['default'];
4517
- },{"./util/assertString":65}],40:[function(require,module,exports){
4584
+ },{"./util/assertString":68}],41:[function(require,module,exports){
4585
+ 'use strict';
4586
+
4587
+ Object.defineProperty(exports, "__esModule", {
4588
+ value: true
4589
+ });
4590
+
4591
+ exports.default = function (str) {
4592
+ (0, _assertString2.default)(str);
4593
+ if (!str.includes(',')) return false;
4594
+ var pair = str.split(',');
4595
+ return lat.test(pair[0]) && long.test(pair[1]);
4596
+ };
4597
+
4598
+ var _assertString = require('./util/assertString');
4599
+
4600
+ var _assertString2 = _interopRequireDefault(_assertString);
4601
+
4602
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
4603
+
4604
+ var lat = /^\(?[+-]?(90(\.0+)?|[1-8]?\d(\.\d+)?)$/;
4605
+ var long = /^\s?[+-]?(180(\.0+)?|1[0-7]\d(\.\d+)?|\d{1,2}(\.\d+)?)\)?$/;
4606
+
4607
+ module.exports = exports['default'];
4608
+ },{"./util/assertString":68}],42:[function(require,module,exports){
4518
4609
  'use strict';
4519
4610
 
4520
4611
  Object.defineProperty(exports, "__esModule", {
@@ -4549,7 +4640,7 @@ function isLength(str, options) {
4549
4640
  return len >= min && (typeof max === 'undefined' || len <= max);
4550
4641
  }
4551
4642
  module.exports = exports['default'];
4552
- },{"./util/assertString":65}],41:[function(require,module,exports){
4643
+ },{"./util/assertString":68}],43:[function(require,module,exports){
4553
4644
  'use strict';
4554
4645
 
4555
4646
  Object.defineProperty(exports, "__esModule", {
@@ -4568,7 +4659,7 @@ function isLowercase(str) {
4568
4659
  return str === str.toLowerCase();
4569
4660
  }
4570
4661
  module.exports = exports['default'];
4571
- },{"./util/assertString":65}],42:[function(require,module,exports){
4662
+ },{"./util/assertString":68}],44:[function(require,module,exports){
4572
4663
  'use strict';
4573
4664
 
4574
4665
  Object.defineProperty(exports, "__esModule", {
@@ -4589,7 +4680,7 @@ function isMACAddress(str) {
4589
4680
  return macAddress.test(str);
4590
4681
  }
4591
4682
  module.exports = exports['default'];
4592
- },{"./util/assertString":65}],43:[function(require,module,exports){
4683
+ },{"./util/assertString":68}],45:[function(require,module,exports){
4593
4684
  'use strict';
4594
4685
 
4595
4686
  Object.defineProperty(exports, "__esModule", {
@@ -4610,7 +4701,7 @@ function isMD5(str) {
4610
4701
  return md5.test(str);
4611
4702
  }
4612
4703
  module.exports = exports['default'];
4613
- },{"./util/assertString":65}],44:[function(require,module,exports){
4704
+ },{"./util/assertString":68}],46:[function(require,module,exports){
4614
4705
  'use strict';
4615
4706
 
4616
4707
  Object.defineProperty(exports, "__esModule", {
@@ -4626,11 +4717,15 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
4626
4717
 
4627
4718
  /* eslint-disable max-len */
4628
4719
  var phones = {
4720
+ 'ar-AE': /^((\+?971)|0)?5[024568]\d{7}$/,
4629
4721
  'ar-DZ': /^(\+?213|0)(5|6|7)\d{8}$/,
4722
+ 'ar-EG': /^((\+?20)|0)?1[012]\d{8}$/,
4723
+ 'ar-JO': /^(\+?962|0)?7[789]\d{7}$/,
4630
4724
  'ar-SY': /^(!?(\+?963)|0)?9\d{8}$/,
4631
4725
  'ar-SA': /^(!?(\+?966)|0)?5\d{8}$/,
4632
4726
  'en-US': /^(\+?1)?[2-9]\d{2}[2-9](?!11)\d{6}$/,
4633
4727
  'cs-CZ': /^(\+?420)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,
4728
+ 'sk-SK': /^(\+?421)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,
4634
4729
  'de-DE': /^(\+?49[ \.\-])?([\(]{1}[0-9]{1,6}[\)])?([0-9 \.\-\/]{3,20})((x|ext|extension)[ ]?[0-9]{1,4})?$/,
4635
4730
  'da-DK': /^(\+?45)?(\d{8})$/,
4636
4731
  'el-GR': /^(\+?30)?(69\d{8})$/,
@@ -4685,14 +4780,20 @@ function isMobilePhone(str, locale) {
4685
4780
  if (locale in phones) {
4686
4781
  return phones[locale].test(str);
4687
4782
  } else if (locale === 'any') {
4688
- return !!Object.values(phones).find(function (phone) {
4689
- return phone.test(str);
4690
- });
4783
+ for (var key in phones) {
4784
+ if (phones.hasOwnProperty(key)) {
4785
+ var phone = phones[key];
4786
+ if (phone.test(str)) {
4787
+ return true;
4788
+ }
4789
+ }
4790
+ }
4791
+ return false;
4691
4792
  }
4692
4793
  throw new Error('Invalid locale \'' + locale + '\'');
4693
4794
  }
4694
4795
  module.exports = exports['default'];
4695
- },{"./util/assertString":65}],45:[function(require,module,exports){
4796
+ },{"./util/assertString":68}],47:[function(require,module,exports){
4696
4797
  'use strict';
4697
4798
 
4698
4799
  Object.defineProperty(exports, "__esModule", {
@@ -4715,7 +4816,7 @@ function isMongoId(str) {
4715
4816
  return (0, _isHexadecimal2.default)(str) && str.length === 24;
4716
4817
  }
4717
4818
  module.exports = exports['default'];
4718
- },{"./isHexadecimal":30,"./util/assertString":65}],46:[function(require,module,exports){
4819
+ },{"./isHexadecimal":31,"./util/assertString":68}],48:[function(require,module,exports){
4719
4820
  'use strict';
4720
4821
 
4721
4822
  Object.defineProperty(exports, "__esModule", {
@@ -4738,7 +4839,7 @@ function isMultibyte(str) {
4738
4839
  return multibyte.test(str);
4739
4840
  }
4740
4841
  module.exports = exports['default'];
4741
- },{"./util/assertString":65}],47:[function(require,module,exports){
4842
+ },{"./util/assertString":68}],49:[function(require,module,exports){
4742
4843
  'use strict';
4743
4844
 
4744
4845
  Object.defineProperty(exports, "__esModule", {
@@ -4759,7 +4860,83 @@ function isNumeric(str) {
4759
4860
  return numeric.test(str);
4760
4861
  }
4761
4862
  module.exports = exports['default'];
4762
- },{"./util/assertString":65}],48:[function(require,module,exports){
4863
+ },{"./util/assertString":68}],50:[function(require,module,exports){
4864
+ 'use strict';
4865
+
4866
+ Object.defineProperty(exports, "__esModule", {
4867
+ value: true
4868
+ });
4869
+ exports.locales = undefined;
4870
+
4871
+ exports.default = function (str, locale) {
4872
+ (0, _assertString2.default)(str);
4873
+ if (locale in patterns) {
4874
+ return patterns[locale].test(str);
4875
+ } else if (locale === 'any') {
4876
+ for (var key in patterns) {
4877
+ if (patterns.hasOwnProperty(key)) {
4878
+ var pattern = patterns[key];
4879
+ if (pattern.test(str)) {
4880
+ return true;
4881
+ }
4882
+ }
4883
+ }
4884
+ return false;
4885
+ }
4886
+ throw new Error('Invalid locale \'' + locale + '\'');
4887
+ };
4888
+
4889
+ var _assertString = require('./util/assertString');
4890
+
4891
+ var _assertString2 = _interopRequireDefault(_assertString);
4892
+
4893
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
4894
+
4895
+ // common patterns
4896
+ var threeDigit = /^\d{3}$/;
4897
+ var fourDigit = /^\d{4}$/;
4898
+ var fiveDigit = /^\d{5}$/;
4899
+ var sixDigit = /^\d{6}$/;
4900
+
4901
+ var patterns = {
4902
+ AT: fourDigit,
4903
+ AU: sixDigit,
4904
+ BE: fourDigit,
4905
+ CA: /^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJ-NPRSTV-Z][\s\-]?\d[ABCEGHJ-NPRSTV-Z]\d$/i,
4906
+ CH: fourDigit,
4907
+ CZ: /^\d{3}\s?\d{2}$/,
4908
+ DE: fiveDigit,
4909
+ DK: fourDigit,
4910
+ DZ: fiveDigit,
4911
+ ES: fiveDigit,
4912
+ FI: fiveDigit,
4913
+ FR: /^\d{2}\s?\d{3}$/,
4914
+ GB: /^(gir\s?0aa|[a-z]{1,2}\d[\da-z]?\s?(\d[a-z]{2})?)$/i,
4915
+ GR: /^\d{3}\s?\d{2}$/,
4916
+ IL: fiveDigit,
4917
+ IN: sixDigit,
4918
+ IS: threeDigit,
4919
+ IT: fiveDigit,
4920
+ JP: /^\d{3}\-\d{4}$/,
4921
+ KE: fiveDigit,
4922
+ LI: /^(948[5-9]|949[0-7])$/,
4923
+ MX: fiveDigit,
4924
+ NL: /^\d{4}\s?[a-z]{2}$/i,
4925
+ NO: fourDigit,
4926
+ PL: /^\d{2}\-\d{3}$/,
4927
+ PT: /^\d{4}(\-\d{3})?$/,
4928
+ RO: sixDigit,
4929
+ RU: sixDigit,
4930
+ SA: fiveDigit,
4931
+ SE: /^\d{3}\s?\d{2}$/,
4932
+ TW: /^\d{3}(\d{2})?$/,
4933
+ US: /^\d{5}(-\d{4})?$/,
4934
+ ZA: fourDigit,
4935
+ ZM: fiveDigit
4936
+ };
4937
+
4938
+ var locales = exports.locales = Object.keys(patterns);
4939
+ },{"./util/assertString":68}],51:[function(require,module,exports){
4763
4940
  'use strict';
4764
4941
 
4765
4942
  Object.defineProperty(exports, "__esModule", {
@@ -4780,7 +4957,7 @@ function isSurrogatePair(str) {
4780
4957
  return surrogatePair.test(str);
4781
4958
  }
4782
4959
  module.exports = exports['default'];
4783
- },{"./util/assertString":65}],49:[function(require,module,exports){
4960
+ },{"./util/assertString":68}],52:[function(require,module,exports){
4784
4961
  'use strict';
4785
4962
 
4786
4963
  Object.defineProperty(exports, "__esModule", {
@@ -4928,7 +5105,7 @@ function isURL(url, options) {
4928
5105
  return true;
4929
5106
  }
4930
5107
  module.exports = exports['default'];
4931
- },{"./isFQDN":25,"./isIP":31,"./util/assertString":65,"./util/merge":66}],50:[function(require,module,exports){
5108
+ },{"./isFQDN":25,"./isIP":32,"./util/assertString":68,"./util/merge":69}],53:[function(require,module,exports){
4932
5109
  'use strict';
4933
5110
 
4934
5111
  Object.defineProperty(exports, "__esModule", {
@@ -4957,7 +5134,7 @@ function isUUID(str) {
4957
5134
  return pattern && pattern.test(str);
4958
5135
  }
4959
5136
  module.exports = exports['default'];
4960
- },{"./util/assertString":65}],51:[function(require,module,exports){
5137
+ },{"./util/assertString":68}],54:[function(require,module,exports){
4961
5138
  'use strict';
4962
5139
 
4963
5140
  Object.defineProperty(exports, "__esModule", {
@@ -4976,7 +5153,7 @@ function isUppercase(str) {
4976
5153
  return str === str.toUpperCase();
4977
5154
  }
4978
5155
  module.exports = exports['default'];
4979
- },{"./util/assertString":65}],52:[function(require,module,exports){
5156
+ },{"./util/assertString":68}],55:[function(require,module,exports){
4980
5157
  'use strict';
4981
5158
 
4982
5159
  Object.defineProperty(exports, "__esModule", {
@@ -4999,7 +5176,7 @@ function isVariableWidth(str) {
4999
5176
  return _isFullWidth.fullWidth.test(str) && _isHalfWidth.halfWidth.test(str);
5000
5177
  }
5001
5178
  module.exports = exports['default'];
5002
- },{"./isFullWidth":27,"./isHalfWidth":28,"./util/assertString":65}],53:[function(require,module,exports){
5179
+ },{"./isFullWidth":27,"./isHalfWidth":28,"./util/assertString":68}],56:[function(require,module,exports){
5003
5180
  'use strict';
5004
5181
 
5005
5182
  Object.defineProperty(exports, "__esModule", {
@@ -5023,7 +5200,7 @@ function isWhitelisted(str, chars) {
5023
5200
  return true;
5024
5201
  }
5025
5202
  module.exports = exports['default'];
5026
- },{"./util/assertString":65}],54:[function(require,module,exports){
5203
+ },{"./util/assertString":68}],57:[function(require,module,exports){
5027
5204
  'use strict';
5028
5205
 
5029
5206
  Object.defineProperty(exports, "__esModule", {
@@ -5043,7 +5220,7 @@ function ltrim(str, chars) {
5043
5220
  return str.replace(pattern, '');
5044
5221
  }
5045
5222
  module.exports = exports['default'];
5046
- },{"./util/assertString":65}],55:[function(require,module,exports){
5223
+ },{"./util/assertString":68}],58:[function(require,module,exports){
5047
5224
  'use strict';
5048
5225
 
5049
5226
  Object.defineProperty(exports, "__esModule", {
@@ -5065,7 +5242,7 @@ function matches(str, pattern, modifiers) {
5065
5242
  return pattern.test(str);
5066
5243
  }
5067
5244
  module.exports = exports['default'];
5068
- },{"./util/assertString":65}],56:[function(require,module,exports){
5245
+ },{"./util/assertString":68}],59:[function(require,module,exports){
5069
5246
  'use strict';
5070
5247
 
5071
5248
  Object.defineProperty(exports, "__esModule", {
@@ -5203,7 +5380,7 @@ function normalizeEmail(email, options) {
5203
5380
  return parts.join('@');
5204
5381
  }
5205
5382
  module.exports = exports['default'];
5206
- },{"./isEmail":23,"./util/merge":66}],57:[function(require,module,exports){
5383
+ },{"./isEmail":23,"./util/merge":69}],60:[function(require,module,exports){
5207
5384
  'use strict';
5208
5385
 
5209
5386
  Object.defineProperty(exports, "__esModule", {
@@ -5229,7 +5406,7 @@ function rtrim(str, chars) {
5229
5406
  return idx < str.length ? str.substr(0, idx + 1) : str;
5230
5407
  }
5231
5408
  module.exports = exports['default'];
5232
- },{"./util/assertString":65}],58:[function(require,module,exports){
5409
+ },{"./util/assertString":68}],61:[function(require,module,exports){
5233
5410
  'use strict';
5234
5411
 
5235
5412
  Object.defineProperty(exports, "__esModule", {
@@ -5253,7 +5430,7 @@ function stripLow(str, keep_new_lines) {
5253
5430
  return (0, _blacklist2.default)(str, chars);
5254
5431
  }
5255
5432
  module.exports = exports['default'];
5256
- },{"./blacklist":6,"./util/assertString":65}],59:[function(require,module,exports){
5433
+ },{"./blacklist":6,"./util/assertString":68}],62:[function(require,module,exports){
5257
5434
  'use strict';
5258
5435
 
5259
5436
  Object.defineProperty(exports, "__esModule", {
@@ -5275,7 +5452,7 @@ function toBoolean(str, strict) {
5275
5452
  return str !== '0' && str !== 'false' && str !== '';
5276
5453
  }
5277
5454
  module.exports = exports['default'];
5278
- },{"./util/assertString":65}],60:[function(require,module,exports){
5455
+ },{"./util/assertString":68}],63:[function(require,module,exports){
5279
5456
  'use strict';
5280
5457
 
5281
5458
  Object.defineProperty(exports, "__esModule", {
@@ -5295,7 +5472,7 @@ function toDate(date) {
5295
5472
  return !isNaN(date) ? new Date(date) : null;
5296
5473
  }
5297
5474
  module.exports = exports['default'];
5298
- },{"./util/assertString":65}],61:[function(require,module,exports){
5475
+ },{"./util/assertString":68}],64:[function(require,module,exports){
5299
5476
  'use strict';
5300
5477
 
5301
5478
  Object.defineProperty(exports, "__esModule", {
@@ -5314,7 +5491,7 @@ function toFloat(str) {
5314
5491
  return parseFloat(str);
5315
5492
  }
5316
5493
  module.exports = exports['default'];
5317
- },{"./util/assertString":65}],62:[function(require,module,exports){
5494
+ },{"./util/assertString":68}],65:[function(require,module,exports){
5318
5495
  'use strict';
5319
5496
 
5320
5497
  Object.defineProperty(exports, "__esModule", {
@@ -5333,7 +5510,7 @@ function toInt(str, radix) {
5333
5510
  return parseInt(str, radix || 10);
5334
5511
  }
5335
5512
  module.exports = exports['default'];
5336
- },{"./util/assertString":65}],63:[function(require,module,exports){
5513
+ },{"./util/assertString":68}],66:[function(require,module,exports){
5337
5514
  'use strict';
5338
5515
 
5339
5516
  Object.defineProperty(exports, "__esModule", {
@@ -5355,7 +5532,7 @@ function trim(str, chars) {
5355
5532
  return (0, _rtrim2.default)((0, _ltrim2.default)(str, chars), chars);
5356
5533
  }
5357
5534
  module.exports = exports['default'];
5358
- },{"./ltrim":54,"./rtrim":57}],64:[function(require,module,exports){
5535
+ },{"./ltrim":57,"./rtrim":60}],67:[function(require,module,exports){
5359
5536
  'use strict';
5360
5537
 
5361
5538
  Object.defineProperty(exports, "__esModule", {
@@ -5371,10 +5548,10 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
5371
5548
 
5372
5549
  function unescape(str) {
5373
5550
  (0, _assertString2.default)(str);
5374
- return str.replace(/&amp;/g, '&').replace(/&quot;/g, '"').replace(/&#x27;/g, "'").replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/&#x2F;/g, '/').replace(/&#96;/g, '`');
5551
+ return str.replace(/&amp;/g, '&').replace(/&quot;/g, '"').replace(/&#x27;/g, "'").replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/&#x2F;/g, '/').replace(/&#x5C;/g, '\\').replace(/&#96;/g, '`');
5375
5552
  }
5376
5553
  module.exports = exports['default'];
5377
- },{"./util/assertString":65}],65:[function(require,module,exports){
5554
+ },{"./util/assertString":68}],68:[function(require,module,exports){
5378
5555
  'use strict';
5379
5556
 
5380
5557
  Object.defineProperty(exports, "__esModule", {
@@ -5389,7 +5566,7 @@ function assertString(input) {
5389
5566
  }
5390
5567
  }
5391
5568
  module.exports = exports['default'];
5392
- },{}],66:[function(require,module,exports){
5569
+ },{}],69:[function(require,module,exports){
5393
5570
  'use strict';
5394
5571
 
5395
5572
  Object.defineProperty(exports, "__esModule", {
@@ -5408,7 +5585,7 @@ function merge() {
5408
5585
  return obj;
5409
5586
  }
5410
5587
  module.exports = exports['default'];
5411
- },{}],67:[function(require,module,exports){
5588
+ },{}],70:[function(require,module,exports){
5412
5589
  'use strict';
5413
5590
 
5414
5591
  Object.defineProperty(exports, "__esModule", {
@@ -5431,7 +5608,7 @@ function toString(input) {
5431
5608
  return String(input);
5432
5609
  }
5433
5610
  module.exports = exports['default'];
5434
- },{}],68:[function(require,module,exports){
5611
+ },{}],71:[function(require,module,exports){
5435
5612
  'use strict';
5436
5613
 
5437
5614
  Object.defineProperty(exports, "__esModule", {
@@ -5450,7 +5627,7 @@ function whitelist(str, chars) {
5450
5627
  return str.replace(new RegExp('[^' + chars + ']+', 'g'), '');
5451
5628
  }
5452
5629
  module.exports = exports['default'];
5453
- },{"./util/assertString":65}],69:[function(require,module,exports){
5630
+ },{"./util/assertString":68}],72:[function(require,module,exports){
5454
5631
  "use strict";
5455
5632
 
5456
5633
  module.exports = {
@@ -5511,7 +5688,7 @@ module.exports = {
5511
5688
 
5512
5689
  };
5513
5690
 
5514
- },{}],70:[function(require,module,exports){
5691
+ },{}],73:[function(require,module,exports){
5515
5692
  /*jshint maxlen: false*/
5516
5693
 
5517
5694
  var validator = require("validator");
@@ -5642,7 +5819,7 @@ var FormatValidators = {
5642
5819
 
5643
5820
  module.exports = FormatValidators;
5644
5821
 
5645
- },{"validator":4}],71:[function(require,module,exports){
5822
+ },{"validator":4}],74:[function(require,module,exports){
5646
5823
  "use strict";
5647
5824
 
5648
5825
  var FormatValidators = require("./FormatValidators"),
@@ -6185,7 +6362,7 @@ exports.validate = function (report, schema, json) {
6185
6362
 
6186
6363
  };
6187
6364
 
6188
- },{"./FormatValidators":70,"./Report":74,"./Utils":78}],72:[function(require,module,exports){
6365
+ },{"./FormatValidators":73,"./Report":76,"./Utils":80}],75:[function(require,module,exports){
6189
6366
  // Number.isFinite polyfill
6190
6367
  // http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isfinite
6191
6368
  if (typeof Number.isFinite !== "function") {
@@ -6203,43 +6380,7 @@ if (typeof Number.isFinite !== "function") {
6203
6380
  };
6204
6381
  }
6205
6382
 
6206
- },{}],73:[function(require,module,exports){
6207
- var isequal = require("lodash.isequal");
6208
-
6209
- function ReferenceCache() {
6210
- this.init();
6211
- }
6212
-
6213
- if (typeof Map !== "undefined") {
6214
- ReferenceCache.prototype = {
6215
- init: function () { this.map = new Map(); },
6216
- set: function (key, value) {
6217
- this.map.set(key, value);
6218
- },
6219
- get: function (key) {
6220
- return this.map.get(key);
6221
- }
6222
- };
6223
- } else {
6224
- ReferenceCache.prototype = {
6225
- init: function () { this.map = []; },
6226
- set: function (key, value) {
6227
- this.map.push([key, value]);
6228
- },
6229
- get: function (key) {
6230
- var i = this.map.length;
6231
- while (i--) {
6232
- if (isequal(this.map[i][0], key)) {
6233
- return this.map[i][1];
6234
- }
6235
- }
6236
- }
6237
- };
6238
- }
6239
-
6240
- module.exports = ReferenceCache;
6241
-
6242
- },{"lodash.isequal":2}],74:[function(require,module,exports){
6383
+ },{}],76:[function(require,module,exports){
6243
6384
  (function (process){
6244
6385
  "use strict";
6245
6386
 
@@ -6445,9 +6586,10 @@ Report.prototype.addCustomError = function (errorCode, errorMessage, params, sub
6445
6586
  module.exports = Report;
6446
6587
 
6447
6588
  }).call(this,require('_process'))
6448
- },{"./Errors":69,"./Utils":78,"_process":3,"lodash.get":1}],75:[function(require,module,exports){
6589
+ },{"./Errors":72,"./Utils":80,"_process":3,"lodash.get":1}],77:[function(require,module,exports){
6449
6590
  "use strict";
6450
6591
 
6592
+ var isequal = require("lodash.isequal");
6451
6593
  var Report = require("./Report");
6452
6594
  var SchemaCompilation = require("./SchemaCompilation");
6453
6595
  var SchemaValidation = require("./SchemaValidation");
@@ -6541,11 +6683,15 @@ exports.getSchema = function (report, schema) {
6541
6683
  };
6542
6684
 
6543
6685
  exports.getSchemaByReference = function (report, key) {
6544
- var fromCache = this.referenceCache.get(key);
6545
- if (fromCache) { return fromCache; }
6686
+ var i = this.referenceCache.length;
6687
+ while (i--) {
6688
+ if (isequal(this.referenceCache[i][0], key)) {
6689
+ return this.referenceCache[i][1];
6690
+ }
6691
+ }
6546
6692
  // not found
6547
6693
  var schema = Utils.cloneDeep(key);
6548
- this.referenceCache.set(key, schema);
6694
+ this.referenceCache.push([key, schema]);
6549
6695
  return schema;
6550
6696
  };
6551
6697
 
@@ -6596,7 +6742,7 @@ exports.getSchemaByUri = function (report, uri, root) {
6596
6742
 
6597
6743
  exports.getRemotePath = getRemotePath;
6598
6744
 
6599
- },{"./Report":74,"./SchemaCompilation":76,"./SchemaValidation":77,"./Utils":78}],76:[function(require,module,exports){
6745
+ },{"./Report":76,"./SchemaCompilation":78,"./SchemaValidation":79,"./Utils":80,"lodash.isequal":2}],78:[function(require,module,exports){
6600
6746
  "use strict";
6601
6747
 
6602
6748
  var Report = require("./Report");
@@ -6897,7 +7043,7 @@ exports.compileSchema = function (report, schema) {
6897
7043
 
6898
7044
  };
6899
7045
 
6900
- },{"./Report":74,"./SchemaCache":75,"./Utils":78}],77:[function(require,module,exports){
7046
+ },{"./Report":76,"./SchemaCache":77,"./Utils":80}],79:[function(require,module,exports){
6901
7047
  "use strict";
6902
7048
 
6903
7049
  var FormatValidators = require("./FormatValidators"),
@@ -7506,7 +7652,7 @@ exports.validateSchema = function (report, schema) {
7506
7652
  return isValid;
7507
7653
  };
7508
7654
 
7509
- },{"./FormatValidators":70,"./JsonValidation":71,"./Report":74,"./Utils":78}],78:[function(require,module,exports){
7655
+ },{"./FormatValidators":73,"./JsonValidation":74,"./Report":76,"./Utils":80}],80:[function(require,module,exports){
7510
7656
  "use strict";
7511
7657
 
7512
7658
  exports.isAbsoluteUri = function (uri) {
@@ -7725,7 +7871,7 @@ exports.ucs2decode = function (string) {
7725
7871
  };
7726
7872
  /*jshint +W016*/
7727
7873
 
7728
- },{}],79:[function(require,module,exports){
7874
+ },{}],81:[function(require,module,exports){
7729
7875
  (function (process){
7730
7876
  "use strict";
7731
7877
 
@@ -7740,7 +7886,7 @@ var SchemaValidation = require("./SchemaValidation");
7740
7886
  var Utils = require("./Utils");
7741
7887
  var Draft4Schema = require("./schemas/schema.json");
7742
7888
  var Draft4HyperSchema = require("./schemas/hyper-schema.json");
7743
- var ReferenceCache = require("./ReferenceCache");
7889
+
7744
7890
  /*
7745
7891
  default options
7746
7892
  */
@@ -7794,7 +7940,7 @@ var defaultOptions = {
7794
7940
  */
7795
7941
  function ZSchema(options) {
7796
7942
  this.cache = {};
7797
- this.referenceCache = new ReferenceCache();
7943
+ this.referenceCache = [];
7798
7944
 
7799
7945
  this.setRemoteReference("http://json-schema.org/draft-04/schema", Draft4Schema);
7800
7946
  this.setRemoteReference("http://json-schema.org/draft-04/hyper-schema", Draft4HyperSchema);
@@ -8081,7 +8227,7 @@ ZSchema.getDefaultOptions = function () {
8081
8227
  module.exports = ZSchema;
8082
8228
 
8083
8229
  }).call(this,require('_process'))
8084
- },{"./FormatValidators":70,"./JsonValidation":71,"./Polyfills":72,"./ReferenceCache":73,"./Report":74,"./SchemaCache":75,"./SchemaCompilation":76,"./SchemaValidation":77,"./Utils":78,"./schemas/hyper-schema.json":80,"./schemas/schema.json":81,"_process":3,"lodash.get":1}],80:[function(require,module,exports){
8230
+ },{"./FormatValidators":73,"./JsonValidation":74,"./Polyfills":75,"./Report":76,"./SchemaCache":77,"./SchemaCompilation":78,"./SchemaValidation":79,"./Utils":80,"./schemas/hyper-schema.json":82,"./schemas/schema.json":83,"_process":3,"lodash.get":1}],82:[function(require,module,exports){
8085
8231
  module.exports={
8086
8232
  "$schema": "http://json-schema.org/draft-04/hyper-schema#",
8087
8233
  "id": "http://json-schema.org/draft-04/hyper-schema#",
@@ -8241,7 +8387,7 @@ module.exports={
8241
8387
  }
8242
8388
 
8243
8389
 
8244
- },{}],81:[function(require,module,exports){
8390
+ },{}],83:[function(require,module,exports){
8245
8391
  module.exports={
8246
8392
  "id": "http://json-schema.org/draft-04/schema#",
8247
8393
  "$schema": "http://json-schema.org/draft-04/schema#",
@@ -8394,5 +8540,5 @@ module.exports={
8394
8540
  "default": {}
8395
8541
  }
8396
8542
 
8397
- },{}]},{},[69,70,71,72,73,74,75,76,77,78,79])(79)
8543
+ },{}]},{},[72,73,74,75,76,77,78,79,80,81])(81)
8398
8544
  });