z-schema 3.18.4 → 3.19.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.
- package/dist/ZSchema-browser-min.js +1 -1
- package/dist/ZSchema-browser-min.js.map +1 -1
- package/dist/ZSchema-browser-test.js +359 -248
- package/dist/ZSchema-browser.js +242 -131
- package/package.json +15 -15
- package/src/SchemaCache.js +9 -1
- package/src/ZSchema.js +36 -21
package/dist/ZSchema-browser.js
CHANGED
|
@@ -3042,6 +3042,10 @@ var _isNumeric = require('./lib/isNumeric');
|
|
|
3042
3042
|
|
|
3043
3043
|
var _isNumeric2 = _interopRequireDefault(_isNumeric);
|
|
3044
3044
|
|
|
3045
|
+
var _isPort = require('./lib/isPort');
|
|
3046
|
+
|
|
3047
|
+
var _isPort2 = _interopRequireDefault(_isPort);
|
|
3048
|
+
|
|
3045
3049
|
var _isLowercase = require('./lib/isLowercase');
|
|
3046
3050
|
|
|
3047
3051
|
var _isLowercase2 = _interopRequireDefault(_isLowercase);
|
|
@@ -3174,6 +3178,10 @@ var _isISO = require('./lib/isISO8601');
|
|
|
3174
3178
|
|
|
3175
3179
|
var _isISO2 = _interopRequireDefault(_isISO);
|
|
3176
3180
|
|
|
3181
|
+
var _isISO31661Alpha = require('./lib/isISO31661Alpha2');
|
|
3182
|
+
|
|
3183
|
+
var _isISO31661Alpha2 = _interopRequireDefault(_isISO31661Alpha);
|
|
3184
|
+
|
|
3177
3185
|
var _isBase = require('./lib/isBase64');
|
|
3178
3186
|
|
|
3179
3187
|
var _isBase2 = _interopRequireDefault(_isBase);
|
|
@@ -3236,7 +3244,7 @@ var _toString2 = _interopRequireDefault(_toString);
|
|
|
3236
3244
|
|
|
3237
3245
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
3238
3246
|
|
|
3239
|
-
var version = '
|
|
3247
|
+
var version = '9.1.1';
|
|
3240
3248
|
|
|
3241
3249
|
var validator = {
|
|
3242
3250
|
version: version,
|
|
@@ -3256,6 +3264,7 @@ var validator = {
|
|
|
3256
3264
|
isAlpha: _isAlpha2.default,
|
|
3257
3265
|
isAlphanumeric: _isAlphanumeric2.default,
|
|
3258
3266
|
isNumeric: _isNumeric2.default,
|
|
3267
|
+
isPort: _isPort2.default,
|
|
3259
3268
|
isLowercase: _isLowercase2.default,
|
|
3260
3269
|
isUppercase: _isUppercase2.default,
|
|
3261
3270
|
isAscii: _isAscii2.default,
|
|
@@ -3290,6 +3299,7 @@ var validator = {
|
|
|
3290
3299
|
isPostalCode: _isPostalCode2.default,
|
|
3291
3300
|
isCurrency: _isCurrency2.default,
|
|
3292
3301
|
isISO8601: _isISO2.default,
|
|
3302
|
+
isISO31661Alpha2: _isISO31661Alpha2.default,
|
|
3293
3303
|
isBase64: _isBase2.default,
|
|
3294
3304
|
isDataURI: _isDataURI2.default,
|
|
3295
3305
|
isLatLong: _isLatLong2.default,
|
|
@@ -3308,7 +3318,7 @@ var validator = {
|
|
|
3308
3318
|
|
|
3309
3319
|
exports.default = validator;
|
|
3310
3320
|
module.exports = exports['default'];
|
|
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/
|
|
3321
|
+
},{"./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/isISO31661Alpha2":35,"./lib/isISO8601":36,"./lib/isISRC":37,"./lib/isISSN":38,"./lib/isIn":39,"./lib/isInt":40,"./lib/isJSON":41,"./lib/isLatLong":42,"./lib/isLength":43,"./lib/isLowercase":44,"./lib/isMACAddress":45,"./lib/isMD5":46,"./lib/isMobilePhone":47,"./lib/isMongoId":48,"./lib/isMultibyte":49,"./lib/isNumeric":50,"./lib/isPort":51,"./lib/isPostalCode":52,"./lib/isSurrogatePair":53,"./lib/isURL":54,"./lib/isUUID":55,"./lib/isUppercase":56,"./lib/isVariableWidth":57,"./lib/isWhitelisted":58,"./lib/ltrim":59,"./lib/matches":60,"./lib/normalizeEmail":61,"./lib/rtrim":62,"./lib/stripLow":63,"./lib/toBoolean":64,"./lib/toDate":65,"./lib/toFloat":66,"./lib/toInt":67,"./lib/trim":68,"./lib/unescape":69,"./lib/util/toString":72,"./lib/whitelist":73}],5:[function(require,module,exports){
|
|
3312
3322
|
'use strict';
|
|
3313
3323
|
|
|
3314
3324
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -3333,7 +3343,7 @@ var alpha = exports.alpha = {
|
|
|
3333
3343
|
'sr-RS': /^[А-ЯЂЈЉЊЋЏ]+$/i,
|
|
3334
3344
|
'sv-SE': /^[A-ZÅÄÖ]+$/i,
|
|
3335
3345
|
'tr-TR': /^[A-ZÇĞİıÖŞÜ]+$/i,
|
|
3336
|
-
'uk-UA': /^[А-ЩЬЮЯЄI
|
|
3346
|
+
'uk-UA': /^[А-ЩЬЮЯЄIЇҐі]+$/i,
|
|
3337
3347
|
ar: /^[ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/
|
|
3338
3348
|
};
|
|
3339
3349
|
|
|
@@ -3356,21 +3366,24 @@ var alphanumeric = exports.alphanumeric = {
|
|
|
3356
3366
|
'sr-RS': /^[0-9А-ЯЂЈЉЊЋЏ]+$/i,
|
|
3357
3367
|
'sv-SE': /^[0-9A-ZÅÄÖ]+$/i,
|
|
3358
3368
|
'tr-TR': /^[0-9A-ZÇĞİıÖŞÜ]+$/i,
|
|
3359
|
-
'uk-UA': /^[0-9А-ЩЬЮЯЄI
|
|
3369
|
+
'uk-UA': /^[0-9А-ЩЬЮЯЄIЇҐі]+$/i,
|
|
3360
3370
|
ar: /^[٠١٢٣٤٥٦٧٨٩0-9ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/
|
|
3361
3371
|
};
|
|
3362
3372
|
|
|
3373
|
+
var decimal = exports.decimal = {
|
|
3374
|
+
'en-US': '.',
|
|
3375
|
+
ar: '٫'
|
|
3376
|
+
};
|
|
3377
|
+
|
|
3363
3378
|
var englishLocales = exports.englishLocales = ['AU', 'GB', 'HK', 'IN', 'NZ', 'ZA', 'ZM'];
|
|
3364
3379
|
|
|
3365
3380
|
for (var locale, i = 0; i < englishLocales.length; i++) {
|
|
3366
3381
|
locale = 'en-' + englishLocales[i];
|
|
3367
3382
|
alpha[locale] = alpha['en-US'];
|
|
3368
3383
|
alphanumeric[locale] = alphanumeric['en-US'];
|
|
3384
|
+
decimal[locale] = decimal['en-US'];
|
|
3369
3385
|
}
|
|
3370
3386
|
|
|
3371
|
-
alpha['pt-BR'] = alpha['pt-PT'];
|
|
3372
|
-
alphanumeric['pt-BR'] = alphanumeric['pt-PT'];
|
|
3373
|
-
|
|
3374
3387
|
// Source: http://www.localeplanet.com/java/
|
|
3375
3388
|
var arabicLocales = exports.arabicLocales = ['AE', 'BH', 'DZ', 'EG', 'IQ', 'JO', 'KW', 'LB', 'LY', 'MA', 'QM', 'QA', 'SA', 'SD', 'SY', 'TN', 'YE'];
|
|
3376
3389
|
|
|
@@ -3378,7 +3391,24 @@ for (var _locale, _i = 0; _i < arabicLocales.length; _i++) {
|
|
|
3378
3391
|
_locale = 'ar-' + arabicLocales[_i];
|
|
3379
3392
|
alpha[_locale] = alpha.ar;
|
|
3380
3393
|
alphanumeric[_locale] = alphanumeric.ar;
|
|
3394
|
+
decimal[_locale] = decimal.ar;
|
|
3395
|
+
}
|
|
3396
|
+
|
|
3397
|
+
// Source: https://en.wikipedia.org/wiki/Decimal_mark
|
|
3398
|
+
var dotDecimal = exports.dotDecimal = [];
|
|
3399
|
+
var commaDecimal = exports.commaDecimal = ['cs-CZ', 'da-DK', 'de-DE', 'es-ES', 'fr-FR', 'it-IT', 'hu-HU', 'nb-NO', 'nn-NO', 'nl-NL', 'pl-Pl', 'pt-PT', 'ru-RU', 'sr-RS@latin', 'sr-RS', 'sv-SE', 'tr-TR', 'uk-UA'];
|
|
3400
|
+
|
|
3401
|
+
for (var _i2 = 0; _i2 < dotDecimal.length; _i2++) {
|
|
3402
|
+
decimal[dotDecimal[_i2]] = decimal['en-US'];
|
|
3403
|
+
}
|
|
3404
|
+
|
|
3405
|
+
for (var _i3 = 0; _i3 < commaDecimal.length; _i3++) {
|
|
3406
|
+
decimal[commaDecimal[_i3]] = ',';
|
|
3381
3407
|
}
|
|
3408
|
+
|
|
3409
|
+
alpha['pt-BR'] = alpha['pt-PT'];
|
|
3410
|
+
alphanumeric['pt-BR'] = alphanumeric['pt-PT'];
|
|
3411
|
+
decimal['pt-BR'] = decimal['pt-PT'];
|
|
3382
3412
|
},{}],6:[function(require,module,exports){
|
|
3383
3413
|
'use strict';
|
|
3384
3414
|
|
|
@@ -3398,7 +3428,7 @@ function blacklist(str, chars) {
|
|
|
3398
3428
|
return str.replace(new RegExp('[' + chars + ']+', 'g'), '');
|
|
3399
3429
|
}
|
|
3400
3430
|
module.exports = exports['default'];
|
|
3401
|
-
},{"./util/assertString":
|
|
3431
|
+
},{"./util/assertString":70}],7:[function(require,module,exports){
|
|
3402
3432
|
'use strict';
|
|
3403
3433
|
|
|
3404
3434
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -3421,7 +3451,7 @@ function contains(str, elem) {
|
|
|
3421
3451
|
return str.indexOf((0, _toString2.default)(elem)) >= 0;
|
|
3422
3452
|
}
|
|
3423
3453
|
module.exports = exports['default'];
|
|
3424
|
-
},{"./util/assertString":
|
|
3454
|
+
},{"./util/assertString":70,"./util/toString":72}],8:[function(require,module,exports){
|
|
3425
3455
|
'use strict';
|
|
3426
3456
|
|
|
3427
3457
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -3440,7 +3470,7 @@ function equals(str, comparison) {
|
|
|
3440
3470
|
return str === comparison;
|
|
3441
3471
|
}
|
|
3442
3472
|
module.exports = exports['default'];
|
|
3443
|
-
},{"./util/assertString":
|
|
3473
|
+
},{"./util/assertString":70}],9:[function(require,module,exports){
|
|
3444
3474
|
'use strict';
|
|
3445
3475
|
|
|
3446
3476
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -3459,7 +3489,7 @@ function escape(str) {
|
|
|
3459
3489
|
return str.replace(/&/g, '&').replace(/"/g, '"').replace(/'/g, ''').replace(/</g, '<').replace(/>/g, '>').replace(/\//g, '/').replace(/\\/g, '\').replace(/`/g, '`');
|
|
3460
3490
|
}
|
|
3461
3491
|
module.exports = exports['default'];
|
|
3462
|
-
},{"./util/assertString":
|
|
3492
|
+
},{"./util/assertString":70}],10:[function(require,module,exports){
|
|
3463
3493
|
'use strict';
|
|
3464
3494
|
|
|
3465
3495
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -3486,7 +3516,7 @@ function isAfter(str) {
|
|
|
3486
3516
|
return !!(original && comparison && original > comparison);
|
|
3487
3517
|
}
|
|
3488
3518
|
module.exports = exports['default'];
|
|
3489
|
-
},{"./toDate":
|
|
3519
|
+
},{"./toDate":65,"./util/assertString":70}],11:[function(require,module,exports){
|
|
3490
3520
|
'use strict';
|
|
3491
3521
|
|
|
3492
3522
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -3512,7 +3542,7 @@ function isAlpha(str) {
|
|
|
3512
3542
|
throw new Error('Invalid locale \'' + locale + '\'');
|
|
3513
3543
|
}
|
|
3514
3544
|
module.exports = exports['default'];
|
|
3515
|
-
},{"./alpha":5,"./util/assertString":
|
|
3545
|
+
},{"./alpha":5,"./util/assertString":70}],12:[function(require,module,exports){
|
|
3516
3546
|
'use strict';
|
|
3517
3547
|
|
|
3518
3548
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -3538,7 +3568,7 @@ function isAlphanumeric(str) {
|
|
|
3538
3568
|
throw new Error('Invalid locale \'' + locale + '\'');
|
|
3539
3569
|
}
|
|
3540
3570
|
module.exports = exports['default'];
|
|
3541
|
-
},{"./alpha":5,"./util/assertString":
|
|
3571
|
+
},{"./alpha":5,"./util/assertString":70}],13:[function(require,module,exports){
|
|
3542
3572
|
'use strict';
|
|
3543
3573
|
|
|
3544
3574
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -3561,7 +3591,7 @@ function isAscii(str) {
|
|
|
3561
3591
|
return ascii.test(str);
|
|
3562
3592
|
}
|
|
3563
3593
|
module.exports = exports['default'];
|
|
3564
|
-
},{"./util/assertString":
|
|
3594
|
+
},{"./util/assertString":70}],14:[function(require,module,exports){
|
|
3565
3595
|
'use strict';
|
|
3566
3596
|
|
|
3567
3597
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -3587,7 +3617,7 @@ function isBase64(str) {
|
|
|
3587
3617
|
return firstPaddingChar === -1 || firstPaddingChar === len - 1 || firstPaddingChar === len - 2 && str[len - 1] === '=';
|
|
3588
3618
|
}
|
|
3589
3619
|
module.exports = exports['default'];
|
|
3590
|
-
},{"./util/assertString":
|
|
3620
|
+
},{"./util/assertString":70}],15:[function(require,module,exports){
|
|
3591
3621
|
'use strict';
|
|
3592
3622
|
|
|
3593
3623
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -3614,7 +3644,7 @@ function isBefore(str) {
|
|
|
3614
3644
|
return !!(original && comparison && original < comparison);
|
|
3615
3645
|
}
|
|
3616
3646
|
module.exports = exports['default'];
|
|
3617
|
-
},{"./toDate":
|
|
3647
|
+
},{"./toDate":65,"./util/assertString":70}],16:[function(require,module,exports){
|
|
3618
3648
|
'use strict';
|
|
3619
3649
|
|
|
3620
3650
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -3633,7 +3663,7 @@ function isBoolean(str) {
|
|
|
3633
3663
|
return ['true', 'false', '1', '0'].indexOf(str) >= 0;
|
|
3634
3664
|
}
|
|
3635
3665
|
module.exports = exports['default'];
|
|
3636
|
-
},{"./util/assertString":
|
|
3666
|
+
},{"./util/assertString":70}],17:[function(require,module,exports){
|
|
3637
3667
|
'use strict';
|
|
3638
3668
|
|
|
3639
3669
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -3667,7 +3697,7 @@ function isByteLength(str, options) {
|
|
|
3667
3697
|
return len >= min && (typeof max === 'undefined' || len <= max);
|
|
3668
3698
|
}
|
|
3669
3699
|
module.exports = exports['default'];
|
|
3670
|
-
},{"./util/assertString":
|
|
3700
|
+
},{"./util/assertString":70}],18:[function(require,module,exports){
|
|
3671
3701
|
'use strict';
|
|
3672
3702
|
|
|
3673
3703
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -3713,7 +3743,7 @@ function isCreditCard(str) {
|
|
|
3713
3743
|
return !!(sum % 10 === 0 ? sanitized : false);
|
|
3714
3744
|
}
|
|
3715
3745
|
module.exports = exports['default'];
|
|
3716
|
-
},{"./util/assertString":
|
|
3746
|
+
},{"./util/assertString":70}],19:[function(require,module,exports){
|
|
3717
3747
|
'use strict';
|
|
3718
3748
|
|
|
3719
3749
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -3806,7 +3836,7 @@ function isCurrency(str, options) {
|
|
|
3806
3836
|
return currencyRegex(options).test(str);
|
|
3807
3837
|
}
|
|
3808
3838
|
module.exports = exports['default'];
|
|
3809
|
-
},{"./util/assertString":
|
|
3839
|
+
},{"./util/assertString":70,"./util/merge":71}],20:[function(require,module,exports){
|
|
3810
3840
|
'use strict';
|
|
3811
3841
|
|
|
3812
3842
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -3827,7 +3857,7 @@ function isDataURI(str) {
|
|
|
3827
3857
|
return dataURI.test(str);
|
|
3828
3858
|
}
|
|
3829
3859
|
module.exports = exports['default'];
|
|
3830
|
-
},{"./util/assertString":
|
|
3860
|
+
},{"./util/assertString":70}],21:[function(require,module,exports){
|
|
3831
3861
|
'use strict';
|
|
3832
3862
|
|
|
3833
3863
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -3835,20 +3865,41 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
3835
3865
|
});
|
|
3836
3866
|
exports.default = isDecimal;
|
|
3837
3867
|
|
|
3868
|
+
var _merge = require('./util/merge');
|
|
3869
|
+
|
|
3870
|
+
var _merge2 = _interopRequireDefault(_merge);
|
|
3871
|
+
|
|
3838
3872
|
var _assertString = require('./util/assertString');
|
|
3839
3873
|
|
|
3840
3874
|
var _assertString2 = _interopRequireDefault(_assertString);
|
|
3841
3875
|
|
|
3876
|
+
var _alpha = require('./alpha');
|
|
3877
|
+
|
|
3842
3878
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
3843
3879
|
|
|
3844
|
-
|
|
3880
|
+
function decimalRegExp(options) {
|
|
3881
|
+
var regExp = new RegExp('^[-+]?([0-9]+)?(\\' + _alpha.decimal[options.locale] + '[0-9]{' + options.decimal_digits + '})' + (options.force_decimal ? '' : '?') + '$');
|
|
3882
|
+
return regExp;
|
|
3883
|
+
}
|
|
3884
|
+
|
|
3885
|
+
var default_decimal_options = {
|
|
3886
|
+
force_decimal: false,
|
|
3887
|
+
decimal_digits: '1,',
|
|
3888
|
+
locale: 'en-US'
|
|
3889
|
+
};
|
|
3890
|
+
|
|
3891
|
+
var blacklist = ['', '-', '+'];
|
|
3845
3892
|
|
|
3846
|
-
function isDecimal(str) {
|
|
3893
|
+
function isDecimal(str, options) {
|
|
3847
3894
|
(0, _assertString2.default)(str);
|
|
3848
|
-
|
|
3895
|
+
options = (0, _merge2.default)(options, default_decimal_options);
|
|
3896
|
+
if (options.locale in _alpha.decimal) {
|
|
3897
|
+
return !blacklist.includes(str.replace(/ /g, '')) && decimalRegExp(options).test(str);
|
|
3898
|
+
}
|
|
3899
|
+
throw new Error('Invalid locale \'' + options.locale + '\'');
|
|
3849
3900
|
}
|
|
3850
3901
|
module.exports = exports['default'];
|
|
3851
|
-
},{"./util/assertString":
|
|
3902
|
+
},{"./alpha":5,"./util/assertString":70,"./util/merge":71}],22:[function(require,module,exports){
|
|
3852
3903
|
'use strict';
|
|
3853
3904
|
|
|
3854
3905
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -3871,7 +3922,7 @@ function isDivisibleBy(str, num) {
|
|
|
3871
3922
|
return (0, _toFloat2.default)(str) % parseInt(num, 10) === 0;
|
|
3872
3923
|
}
|
|
3873
3924
|
module.exports = exports['default'];
|
|
3874
|
-
},{"./toFloat":
|
|
3925
|
+
},{"./toFloat":66,"./util/assertString":70}],23:[function(require,module,exports){
|
|
3875
3926
|
'use strict';
|
|
3876
3927
|
|
|
3877
3928
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -3961,7 +4012,7 @@ function isEmail(str, options) {
|
|
|
3961
4012
|
return true;
|
|
3962
4013
|
}
|
|
3963
4014
|
module.exports = exports['default'];
|
|
3964
|
-
},{"./isByteLength":17,"./isFQDN":25,"./util/assertString":
|
|
4015
|
+
},{"./isByteLength":17,"./isFQDN":25,"./util/assertString":70,"./util/merge":71}],24:[function(require,module,exports){
|
|
3965
4016
|
'use strict';
|
|
3966
4017
|
|
|
3967
4018
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -3980,7 +4031,7 @@ function isEmpty(str) {
|
|
|
3980
4031
|
return str.length === 0;
|
|
3981
4032
|
}
|
|
3982
4033
|
module.exports = exports['default'];
|
|
3983
|
-
},{"./util/assertString":
|
|
4034
|
+
},{"./util/assertString":70}],25:[function(require,module,exports){
|
|
3984
4035
|
'use strict';
|
|
3985
4036
|
|
|
3986
4037
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -4042,7 +4093,7 @@ function isFDQN(str, options) {
|
|
|
4042
4093
|
return true;
|
|
4043
4094
|
}
|
|
4044
4095
|
module.exports = exports['default'];
|
|
4045
|
-
},{"./util/assertString":
|
|
4096
|
+
},{"./util/assertString":70,"./util/merge":71}],26:[function(require,module,exports){
|
|
4046
4097
|
'use strict';
|
|
4047
4098
|
|
|
4048
4099
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -4054,20 +4105,21 @@ var _assertString = require('./util/assertString');
|
|
|
4054
4105
|
|
|
4055
4106
|
var _assertString2 = _interopRequireDefault(_assertString);
|
|
4056
4107
|
|
|
4057
|
-
|
|
4108
|
+
var _alpha = require('./alpha');
|
|
4058
4109
|
|
|
4059
|
-
|
|
4110
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
4060
4111
|
|
|
4061
4112
|
function isFloat(str, options) {
|
|
4062
4113
|
(0, _assertString2.default)(str);
|
|
4063
4114
|
options = options || {};
|
|
4115
|
+
var float = new RegExp('^(?:[-+])?(?:[0-9]+)?(?:\\' + (options.locale ? _alpha.decimal[options.locale] : '.') + '[0-9]*)?(?:[eE][\\+\\-]?(?:[0-9]+))?$');
|
|
4064
4116
|
if (str === '' || str === '.') {
|
|
4065
4117
|
return false;
|
|
4066
4118
|
}
|
|
4067
4119
|
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);
|
|
4068
4120
|
}
|
|
4069
4121
|
module.exports = exports['default'];
|
|
4070
|
-
},{"./util/assertString":
|
|
4122
|
+
},{"./alpha":5,"./util/assertString":70}],27:[function(require,module,exports){
|
|
4071
4123
|
'use strict';
|
|
4072
4124
|
|
|
4073
4125
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -4088,7 +4140,7 @@ function isFullWidth(str) {
|
|
|
4088
4140
|
(0, _assertString2.default)(str);
|
|
4089
4141
|
return fullWidth.test(str);
|
|
4090
4142
|
}
|
|
4091
|
-
},{"./util/assertString":
|
|
4143
|
+
},{"./util/assertString":70}],28:[function(require,module,exports){
|
|
4092
4144
|
'use strict';
|
|
4093
4145
|
|
|
4094
4146
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -4109,7 +4161,7 @@ function isHalfWidth(str) {
|
|
|
4109
4161
|
(0, _assertString2.default)(str);
|
|
4110
4162
|
return halfWidth.test(str);
|
|
4111
4163
|
}
|
|
4112
|
-
},{"./util/assertString":
|
|
4164
|
+
},{"./util/assertString":70}],29:[function(require,module,exports){
|
|
4113
4165
|
'use strict';
|
|
4114
4166
|
|
|
4115
4167
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -4145,7 +4197,7 @@ function isHash(str, algorithm) {
|
|
|
4145
4197
|
return hash.test(str);
|
|
4146
4198
|
}
|
|
4147
4199
|
module.exports = exports['default'];
|
|
4148
|
-
},{"./util/assertString":
|
|
4200
|
+
},{"./util/assertString":70}],30:[function(require,module,exports){
|
|
4149
4201
|
'use strict';
|
|
4150
4202
|
|
|
4151
4203
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -4166,7 +4218,7 @@ function isHexColor(str) {
|
|
|
4166
4218
|
return hexcolor.test(str);
|
|
4167
4219
|
}
|
|
4168
4220
|
module.exports = exports['default'];
|
|
4169
|
-
},{"./util/assertString":
|
|
4221
|
+
},{"./util/assertString":70}],31:[function(require,module,exports){
|
|
4170
4222
|
'use strict';
|
|
4171
4223
|
|
|
4172
4224
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -4187,7 +4239,7 @@ function isHexadecimal(str) {
|
|
|
4187
4239
|
return hexadecimal.test(str);
|
|
4188
4240
|
}
|
|
4189
4241
|
module.exports = exports['default'];
|
|
4190
|
-
},{"./util/assertString":
|
|
4242
|
+
},{"./util/assertString":70}],32:[function(require,module,exports){
|
|
4191
4243
|
'use strict';
|
|
4192
4244
|
|
|
4193
4245
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -4269,7 +4321,7 @@ function isIP(str) {
|
|
|
4269
4321
|
return false;
|
|
4270
4322
|
}
|
|
4271
4323
|
module.exports = exports['default'];
|
|
4272
|
-
},{"./util/assertString":
|
|
4324
|
+
},{"./util/assertString":70}],33:[function(require,module,exports){
|
|
4273
4325
|
'use strict';
|
|
4274
4326
|
|
|
4275
4327
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -4327,7 +4379,7 @@ function isISBN(str) {
|
|
|
4327
4379
|
return false;
|
|
4328
4380
|
}
|
|
4329
4381
|
module.exports = exports['default'];
|
|
4330
|
-
},{"./util/assertString":
|
|
4382
|
+
},{"./util/assertString":70}],34:[function(require,module,exports){
|
|
4331
4383
|
'use strict';
|
|
4332
4384
|
|
|
4333
4385
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -4376,7 +4428,29 @@ function isISIN(str) {
|
|
|
4376
4428
|
return parseInt(str.substr(str.length - 1), 10) === (10000 - sum) % 10;
|
|
4377
4429
|
}
|
|
4378
4430
|
module.exports = exports['default'];
|
|
4379
|
-
},{"./util/assertString":
|
|
4431
|
+
},{"./util/assertString":70}],35:[function(require,module,exports){
|
|
4432
|
+
'use strict';
|
|
4433
|
+
|
|
4434
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4435
|
+
value: true
|
|
4436
|
+
});
|
|
4437
|
+
exports.default = isISO31661Alpha2;
|
|
4438
|
+
|
|
4439
|
+
var _assertString = require('./util/assertString');
|
|
4440
|
+
|
|
4441
|
+
var _assertString2 = _interopRequireDefault(_assertString);
|
|
4442
|
+
|
|
4443
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
4444
|
+
|
|
4445
|
+
// from https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
|
|
4446
|
+
var validISO31661Alpha2CountriesCodes = ['AD', 'AE', 'AF', 'AG', 'AI', 'AL', 'AM', 'AO', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AW', 'AX', 'AZ', 'BA', 'BB', 'BD', 'BE', 'BF', 'BG', 'BH', 'BI', 'BJ', 'BL', 'BM', 'BN', 'BO', 'BQ', 'BR', 'BS', 'BT', 'BV', 'BW', 'BY', 'BZ', 'CA', 'CC', 'CD', 'CF', 'CG', 'CH', 'CI', 'CK', 'CL', 'CM', 'CN', 'CO', 'CR', 'CU', 'CV', 'CW', 'CX', 'CY', 'CZ', 'DE', 'DJ', 'DK', 'DM', 'DO', 'DZ', 'EC', 'EE', 'EG', 'EH', 'ER', 'ES', 'ET', 'FI', 'FJ', 'FK', 'FM', 'FO', 'FR', 'GA', 'GB', 'GD', 'GE', 'GF', 'GG', 'GH', 'GI', 'GL', 'GM', 'GN', 'GP', 'GQ', 'GR', 'GS', 'GT', 'GU', 'GW', 'GY', 'HK', 'HM', 'HN', 'HR', 'HT', 'HU', 'ID', 'IE', 'IL', 'IM', 'IN', 'IO', 'IQ', 'IR', 'IS', 'IT', 'JE', 'JM', 'JO', 'JP', 'KE', 'KG', 'KH', 'KI', 'KM', 'KN', 'KP', 'KR', 'KW', 'KY', 'KZ', 'LA', 'LB', 'LC', 'LI', 'LK', 'LR', 'LS', 'LT', 'LU', 'LV', 'LY', 'MA', 'MC', 'MD', 'ME', 'MF', 'MG', 'MH', 'MK', 'ML', 'MM', 'MN', 'MO', 'MP', 'MQ', 'MR', 'MS', 'MT', 'MU', 'MV', 'MW', 'MX', 'MY', 'MZ', 'NA', 'NC', 'NE', 'NF', 'NG', 'NI', 'NL', 'NO', 'NP', 'NR', 'NU', 'NZ', 'OM', 'PA', 'PE', 'PF', 'PG', 'PH', 'PK', 'PL', 'PM', 'PN', 'PR', 'PS', 'PT', 'PW', 'PY', 'QA', 'RE', 'RO', 'RS', 'RU', 'RW', 'SA', 'SB', 'SC', 'SD', 'SE', 'SG', 'SH', 'SI', 'SJ', 'SK', 'SL', 'SM', 'SN', 'SO', 'SR', 'SS', 'ST', 'SV', 'SX', 'SY', 'SZ', 'TC', 'TD', 'TF', 'TG', 'TH', 'TJ', 'TK', 'TL', 'TM', 'TN', 'TO', 'TR', 'TT', 'TV', 'TW', 'TZ', 'UA', 'UG', 'UM', 'US', 'UY', 'UZ', 'VA', 'VC', 'VE', 'VG', 'VI', 'VN', 'VU', 'WF', 'WS', 'YE', 'YT', 'ZA', 'ZM', 'ZW'];
|
|
4447
|
+
|
|
4448
|
+
function isISO31661Alpha2(str) {
|
|
4449
|
+
(0, _assertString2.default)(str);
|
|
4450
|
+
return validISO31661Alpha2CountriesCodes.includes(str.toUpperCase());
|
|
4451
|
+
}
|
|
4452
|
+
module.exports = exports['default'];
|
|
4453
|
+
},{"./util/assertString":70}],36:[function(require,module,exports){
|
|
4380
4454
|
'use strict';
|
|
4381
4455
|
|
|
4382
4456
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -4400,7 +4474,7 @@ function isISO8601(str) {
|
|
|
4400
4474
|
return iso8601.test(str);
|
|
4401
4475
|
}
|
|
4402
4476
|
module.exports = exports['default'];
|
|
4403
|
-
},{"./util/assertString":
|
|
4477
|
+
},{"./util/assertString":70}],37:[function(require,module,exports){
|
|
4404
4478
|
'use strict';
|
|
4405
4479
|
|
|
4406
4480
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -4422,7 +4496,7 @@ function isISRC(str) {
|
|
|
4422
4496
|
return isrc.test(str);
|
|
4423
4497
|
}
|
|
4424
4498
|
module.exports = exports['default'];
|
|
4425
|
-
},{"./util/assertString":
|
|
4499
|
+
},{"./util/assertString":70}],38:[function(require,module,exports){
|
|
4426
4500
|
'use strict';
|
|
4427
4501
|
|
|
4428
4502
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -4481,7 +4555,7 @@ function isISSN(str) {
|
|
|
4481
4555
|
return checksum % 11 === 0;
|
|
4482
4556
|
}
|
|
4483
4557
|
module.exports = exports['default'];
|
|
4484
|
-
},{"./util/assertString":
|
|
4558
|
+
},{"./util/assertString":70}],39:[function(require,module,exports){
|
|
4485
4559
|
'use strict';
|
|
4486
4560
|
|
|
4487
4561
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -4521,7 +4595,7 @@ function isIn(str, options) {
|
|
|
4521
4595
|
return false;
|
|
4522
4596
|
}
|
|
4523
4597
|
module.exports = exports['default'];
|
|
4524
|
-
},{"./util/assertString":
|
|
4598
|
+
},{"./util/assertString":70,"./util/toString":72}],40:[function(require,module,exports){
|
|
4525
4599
|
'use strict';
|
|
4526
4600
|
|
|
4527
4601
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -4555,7 +4629,7 @@ function isInt(str, options) {
|
|
|
4555
4629
|
return regex.test(str) && minCheckPassed && maxCheckPassed && ltCheckPassed && gtCheckPassed;
|
|
4556
4630
|
}
|
|
4557
4631
|
module.exports = exports['default'];
|
|
4558
|
-
},{"./util/assertString":
|
|
4632
|
+
},{"./util/assertString":70}],41:[function(require,module,exports){
|
|
4559
4633
|
'use strict';
|
|
4560
4634
|
|
|
4561
4635
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -4581,7 +4655,7 @@ function isJSON(str) {
|
|
|
4581
4655
|
return false;
|
|
4582
4656
|
}
|
|
4583
4657
|
module.exports = exports['default'];
|
|
4584
|
-
},{"./util/assertString":
|
|
4658
|
+
},{"./util/assertString":70}],42:[function(require,module,exports){
|
|
4585
4659
|
'use strict';
|
|
4586
4660
|
|
|
4587
4661
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -4605,7 +4679,7 @@ var lat = /^\(?[+-]?(90(\.0+)?|[1-8]?\d(\.\d+)?)$/;
|
|
|
4605
4679
|
var long = /^\s?[+-]?(180(\.0+)?|1[0-7]\d(\.\d+)?|\d{1,2}(\.\d+)?)\)?$/;
|
|
4606
4680
|
|
|
4607
4681
|
module.exports = exports['default'];
|
|
4608
|
-
},{"./util/assertString":
|
|
4682
|
+
},{"./util/assertString":70}],43:[function(require,module,exports){
|
|
4609
4683
|
'use strict';
|
|
4610
4684
|
|
|
4611
4685
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -4640,7 +4714,7 @@ function isLength(str, options) {
|
|
|
4640
4714
|
return len >= min && (typeof max === 'undefined' || len <= max);
|
|
4641
4715
|
}
|
|
4642
4716
|
module.exports = exports['default'];
|
|
4643
|
-
},{"./util/assertString":
|
|
4717
|
+
},{"./util/assertString":70}],44:[function(require,module,exports){
|
|
4644
4718
|
'use strict';
|
|
4645
4719
|
|
|
4646
4720
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -4659,7 +4733,7 @@ function isLowercase(str) {
|
|
|
4659
4733
|
return str === str.toLowerCase();
|
|
4660
4734
|
}
|
|
4661
4735
|
module.exports = exports['default'];
|
|
4662
|
-
},{"./util/assertString":
|
|
4736
|
+
},{"./util/assertString":70}],45:[function(require,module,exports){
|
|
4663
4737
|
'use strict';
|
|
4664
4738
|
|
|
4665
4739
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -4680,7 +4754,7 @@ function isMACAddress(str) {
|
|
|
4680
4754
|
return macAddress.test(str);
|
|
4681
4755
|
}
|
|
4682
4756
|
module.exports = exports['default'];
|
|
4683
|
-
},{"./util/assertString":
|
|
4757
|
+
},{"./util/assertString":70}],46:[function(require,module,exports){
|
|
4684
4758
|
'use strict';
|
|
4685
4759
|
|
|
4686
4760
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -4701,7 +4775,7 @@ function isMD5(str) {
|
|
|
4701
4775
|
return md5.test(str);
|
|
4702
4776
|
}
|
|
4703
4777
|
module.exports = exports['default'];
|
|
4704
|
-
},{"./util/assertString":
|
|
4778
|
+
},{"./util/assertString":70}],47:[function(require,module,exports){
|
|
4705
4779
|
'use strict';
|
|
4706
4780
|
|
|
4707
4781
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -4721,37 +4795,40 @@ var phones = {
|
|
|
4721
4795
|
'ar-DZ': /^(\+?213|0)(5|6|7)\d{8}$/,
|
|
4722
4796
|
'ar-EG': /^((\+?20)|0)?1[012]\d{8}$/,
|
|
4723
4797
|
'ar-JO': /^(\+?962|0)?7[789]\d{7}$/,
|
|
4724
|
-
'ar-SY': /^(!?(\+?963)|0)?9\d{8}$/,
|
|
4725
4798
|
'ar-SA': /^(!?(\+?966)|0)?5\d{8}$/,
|
|
4726
|
-
'
|
|
4799
|
+
'ar-SY': /^(!?(\+?963)|0)?9\d{8}$/,
|
|
4727
4800
|
'cs-CZ': /^(\+?420)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,
|
|
4728
|
-
'
|
|
4801
|
+
'da-DK': /^(\+?45)?\s?\d{2}\s?\d{2}\s?\d{2}\s?\d{2}$/,
|
|
4729
4802
|
'de-DE': /^(\+?49[ \.\-])?([\(]{1}[0-9]{1,6}[\)])?([0-9 \.\-\/]{3,20})((x|ext|extension)[ ]?[0-9]{1,4})?$/,
|
|
4730
|
-
'da-DK': /^(\+?45)?(\d{8})$/,
|
|
4731
4803
|
'el-GR': /^(\+?30)?(69\d{8})$/,
|
|
4732
4804
|
'en-AU': /^(\+?61|0)4\d{8}$/,
|
|
4733
4805
|
'en-GB': /^(\+?44|0)7\d{9}$/,
|
|
4734
|
-
'en-HK': /^(\+?852\-?)?[
|
|
4806
|
+
'en-HK': /^(\+?852\-?)?[456789]\d{3}\-?\d{4}$/,
|
|
4735
4807
|
'en-IN': /^(\+?91|0)?[789]\d{9}$/,
|
|
4736
4808
|
'en-KE': /^(\+?254|0)?[7]\d{8}$/,
|
|
4737
4809
|
'en-NG': /^(\+?234|0)?[789]\d{9}$/,
|
|
4738
4810
|
'en-NZ': /^(\+?64|0)2\d{7,9}$/,
|
|
4739
|
-
'en-
|
|
4811
|
+
'en-PK': /^((\+92)|(0092))-{0,1}\d{3}-{0,1}\d{7}$|^\d{11}$|^\d{4}-\d{7}$/,
|
|
4740
4812
|
'en-RW': /^(\+?250|0)?[7]\d{8}$/,
|
|
4741
4813
|
'en-TZ': /^(\+?255|0)?[67]\d{8}$/,
|
|
4814
|
+
'en-UG': /^(\+?256|0)?[7]\d{8}$/,
|
|
4815
|
+
'en-US': /^(\+?1)?[2-9]\d{2}[2-9](?!11)\d{6}$/,
|
|
4742
4816
|
'en-ZA': /^(\+?27|0)\d{9}$/,
|
|
4743
4817
|
'en-ZM': /^(\+?26)?09[567]\d{7}$/,
|
|
4744
4818
|
'es-ES': /^(\+?34)?(6\d{1}|7[1234])\d{7}$/,
|
|
4745
|
-
'
|
|
4819
|
+
'et-EE': /^(\+?372)?\s?(5|8[1-4])\s?([0-9]\s?){6,7}$/,
|
|
4746
4820
|
'fa-IR': /^(\+?98[\-\s]?|0)9[0-39]\d[\-\s]?\d{3}[\-\s]?\d{4}$/,
|
|
4821
|
+
'fi-FI': /^(\+?358|0)\s?(4(0|1|2|4|5|6)?|50)\s?(\d\s?){4,8}\d$/,
|
|
4822
|
+
'fo-FO': /^(\+?298)?\s?\d{2}\s?\d{2}\s?\d{2}$/,
|
|
4747
4823
|
'fr-FR': /^(\+?33|0)[67]\d{8}$/,
|
|
4748
4824
|
'he-IL': /^(\+972|0)([23489]|5[0248]|77)[1-9]\d{6}/,
|
|
4749
4825
|
'hu-HU': /^(\+?36)(20|30|70)\d{7}$/,
|
|
4750
|
-
'lt-LT': /^(\+370|8)\d{8}$/,
|
|
4751
4826
|
'id-ID': /^(\+?62|0[1-9])[\s|\d]+$/,
|
|
4752
4827
|
'it-IT': /^(\+?39)?\s?3\d{2} ?\d{6,7}$/,
|
|
4828
|
+
'ja-JP': /^(\+?81|0)[789]0[ \-]?[1-9]\d{2}[ \-]?\d{5}$/,
|
|
4829
|
+
'kl-GL': /^(\+?299)?\s?\d{2}\s?\d{2}\s?\d{2}$/,
|
|
4753
4830
|
'ko-KR': /^((\+?82)[ \-]?)?0?1([0|1|6|7|8|9]{1})[ \-]?\d{3,4}[ \-]?\d{4}$/,
|
|
4754
|
-
'
|
|
4831
|
+
'lt-LT': /^(\+370|8)\d{8}$/,
|
|
4755
4832
|
'ms-MY': /^(\+?6?01){1}(([145]{1}(\-|\s)?\d{7,8})|([236789]{1}(\s|\-)?\d{7}))$/,
|
|
4756
4833
|
'nb-NO': /^(\+?47)?[49]\d{7}$/,
|
|
4757
4834
|
'nl-BE': /^(\+?32|0)4?\d{8}$/,
|
|
@@ -4760,10 +4837,11 @@ var phones = {
|
|
|
4760
4837
|
'pt-BR': /^(\+?55|0)\-?[1-9]{2}\-?[2-9]{1}\d{3,4}\-?\d{4}$/,
|
|
4761
4838
|
'pt-PT': /^(\+?351)?9[1236]\d{7}$/,
|
|
4762
4839
|
'ro-RO': /^(\+?4?0)\s?7\d{2}(\/|\s|\.|\-)?\d{3}(\s|\.|\-)?\d{3}$/,
|
|
4763
|
-
'en-PK': /^((\+92)|(0092))-{0,1}\d{3}-{0,1}\d{7}$|^\d{11}$|^\d{4}-\d{7}$/,
|
|
4764
4840
|
'ru-RU': /^(\+?7|8)?9\d{9}$/,
|
|
4841
|
+
'sk-SK': /^(\+?421)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,
|
|
4765
4842
|
'sr-RS': /^(\+3816|06)[- \d]{5,9}$/,
|
|
4766
4843
|
'tr-TR': /^(\+?90|0)?5\d{9}$/,
|
|
4844
|
+
'uk-UA': /^(\+?38|8)?0\d{9}$/,
|
|
4767
4845
|
'vi-VN': /^(\+?84|0)?((1(2([0-9])|6([2-9])|88|99))|(9((?!5)[0-9])))([0-9]{7})$/,
|
|
4768
4846
|
'zh-CN': /^(\+?0?86\-?)?1[345789]\d{9}$/,
|
|
4769
4847
|
'zh-TW': /^(\+?886\-?|0)?9\d{8}$/
|
|
@@ -4793,7 +4871,7 @@ function isMobilePhone(str, locale) {
|
|
|
4793
4871
|
throw new Error('Invalid locale \'' + locale + '\'');
|
|
4794
4872
|
}
|
|
4795
4873
|
module.exports = exports['default'];
|
|
4796
|
-
},{"./util/assertString":
|
|
4874
|
+
},{"./util/assertString":70}],48:[function(require,module,exports){
|
|
4797
4875
|
'use strict';
|
|
4798
4876
|
|
|
4799
4877
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -4816,7 +4894,7 @@ function isMongoId(str) {
|
|
|
4816
4894
|
return (0, _isHexadecimal2.default)(str) && str.length === 24;
|
|
4817
4895
|
}
|
|
4818
4896
|
module.exports = exports['default'];
|
|
4819
|
-
},{"./isHexadecimal":31,"./util/assertString":
|
|
4897
|
+
},{"./isHexadecimal":31,"./util/assertString":70}],49:[function(require,module,exports){
|
|
4820
4898
|
'use strict';
|
|
4821
4899
|
|
|
4822
4900
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -4839,7 +4917,7 @@ function isMultibyte(str) {
|
|
|
4839
4917
|
return multibyte.test(str);
|
|
4840
4918
|
}
|
|
4841
4919
|
module.exports = exports['default'];
|
|
4842
|
-
},{"./util/assertString":
|
|
4920
|
+
},{"./util/assertString":70}],50:[function(require,module,exports){
|
|
4843
4921
|
'use strict';
|
|
4844
4922
|
|
|
4845
4923
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -4860,7 +4938,25 @@ function isNumeric(str) {
|
|
|
4860
4938
|
return numeric.test(str);
|
|
4861
4939
|
}
|
|
4862
4940
|
module.exports = exports['default'];
|
|
4863
|
-
},{"./util/assertString":
|
|
4941
|
+
},{"./util/assertString":70}],51:[function(require,module,exports){
|
|
4942
|
+
'use strict';
|
|
4943
|
+
|
|
4944
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4945
|
+
value: true
|
|
4946
|
+
});
|
|
4947
|
+
exports.default = isPort;
|
|
4948
|
+
|
|
4949
|
+
var _isInt = require('./isInt');
|
|
4950
|
+
|
|
4951
|
+
var _isInt2 = _interopRequireDefault(_isInt);
|
|
4952
|
+
|
|
4953
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
4954
|
+
|
|
4955
|
+
function isPort(str) {
|
|
4956
|
+
return (0, _isInt2.default)(str, { min: 0, max: 65535 });
|
|
4957
|
+
}
|
|
4958
|
+
module.exports = exports['default'];
|
|
4959
|
+
},{"./isInt":40}],52:[function(require,module,exports){
|
|
4864
4960
|
'use strict';
|
|
4865
4961
|
|
|
4866
4962
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -4900,7 +4996,7 @@ var sixDigit = /^\d{6}$/;
|
|
|
4900
4996
|
|
|
4901
4997
|
var patterns = {
|
|
4902
4998
|
AT: fourDigit,
|
|
4903
|
-
AU:
|
|
4999
|
+
AU: fourDigit,
|
|
4904
5000
|
BE: fourDigit,
|
|
4905
5001
|
CA: /^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJ-NPRSTV-Z][\s\-]?\d[ABCEGHJ-NPRSTV-Z]\d$/i,
|
|
4906
5002
|
CH: fourDigit,
|
|
@@ -4936,7 +5032,7 @@ var patterns = {
|
|
|
4936
5032
|
};
|
|
4937
5033
|
|
|
4938
5034
|
var locales = exports.locales = Object.keys(patterns);
|
|
4939
|
-
},{"./util/assertString":
|
|
5035
|
+
},{"./util/assertString":70}],53:[function(require,module,exports){
|
|
4940
5036
|
'use strict';
|
|
4941
5037
|
|
|
4942
5038
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -4957,7 +5053,7 @@ function isSurrogatePair(str) {
|
|
|
4957
5053
|
return surrogatePair.test(str);
|
|
4958
5054
|
}
|
|
4959
5055
|
module.exports = exports['default'];
|
|
4960
|
-
},{"./util/assertString":
|
|
5056
|
+
},{"./util/assertString":70}],54:[function(require,module,exports){
|
|
4961
5057
|
'use strict';
|
|
4962
5058
|
|
|
4963
5059
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -5105,7 +5201,7 @@ function isURL(url, options) {
|
|
|
5105
5201
|
return true;
|
|
5106
5202
|
}
|
|
5107
5203
|
module.exports = exports['default'];
|
|
5108
|
-
},{"./isFQDN":25,"./isIP":32,"./util/assertString":
|
|
5204
|
+
},{"./isFQDN":25,"./isIP":32,"./util/assertString":70,"./util/merge":71}],55:[function(require,module,exports){
|
|
5109
5205
|
'use strict';
|
|
5110
5206
|
|
|
5111
5207
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -5134,7 +5230,7 @@ function isUUID(str) {
|
|
|
5134
5230
|
return pattern && pattern.test(str);
|
|
5135
5231
|
}
|
|
5136
5232
|
module.exports = exports['default'];
|
|
5137
|
-
},{"./util/assertString":
|
|
5233
|
+
},{"./util/assertString":70}],56:[function(require,module,exports){
|
|
5138
5234
|
'use strict';
|
|
5139
5235
|
|
|
5140
5236
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -5153,7 +5249,7 @@ function isUppercase(str) {
|
|
|
5153
5249
|
return str === str.toUpperCase();
|
|
5154
5250
|
}
|
|
5155
5251
|
module.exports = exports['default'];
|
|
5156
|
-
},{"./util/assertString":
|
|
5252
|
+
},{"./util/assertString":70}],57:[function(require,module,exports){
|
|
5157
5253
|
'use strict';
|
|
5158
5254
|
|
|
5159
5255
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -5176,7 +5272,7 @@ function isVariableWidth(str) {
|
|
|
5176
5272
|
return _isFullWidth.fullWidth.test(str) && _isHalfWidth.halfWidth.test(str);
|
|
5177
5273
|
}
|
|
5178
5274
|
module.exports = exports['default'];
|
|
5179
|
-
},{"./isFullWidth":27,"./isHalfWidth":28,"./util/assertString":
|
|
5275
|
+
},{"./isFullWidth":27,"./isHalfWidth":28,"./util/assertString":70}],58:[function(require,module,exports){
|
|
5180
5276
|
'use strict';
|
|
5181
5277
|
|
|
5182
5278
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -5200,7 +5296,7 @@ function isWhitelisted(str, chars) {
|
|
|
5200
5296
|
return true;
|
|
5201
5297
|
}
|
|
5202
5298
|
module.exports = exports['default'];
|
|
5203
|
-
},{"./util/assertString":
|
|
5299
|
+
},{"./util/assertString":70}],59:[function(require,module,exports){
|
|
5204
5300
|
'use strict';
|
|
5205
5301
|
|
|
5206
5302
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -5220,7 +5316,7 @@ function ltrim(str, chars) {
|
|
|
5220
5316
|
return str.replace(pattern, '');
|
|
5221
5317
|
}
|
|
5222
5318
|
module.exports = exports['default'];
|
|
5223
|
-
},{"./util/assertString":
|
|
5319
|
+
},{"./util/assertString":70}],60:[function(require,module,exports){
|
|
5224
5320
|
'use strict';
|
|
5225
5321
|
|
|
5226
5322
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -5242,7 +5338,7 @@ function matches(str, pattern, modifiers) {
|
|
|
5242
5338
|
return pattern.test(str);
|
|
5243
5339
|
}
|
|
5244
5340
|
module.exports = exports['default'];
|
|
5245
|
-
},{"./util/assertString":
|
|
5341
|
+
},{"./util/assertString":70}],61:[function(require,module,exports){
|
|
5246
5342
|
'use strict';
|
|
5247
5343
|
|
|
5248
5344
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -5250,10 +5346,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5250
5346
|
});
|
|
5251
5347
|
exports.default = normalizeEmail;
|
|
5252
5348
|
|
|
5253
|
-
var _isEmail = require('./isEmail');
|
|
5254
|
-
|
|
5255
|
-
var _isEmail2 = _interopRequireDefault(_isEmail);
|
|
5256
|
-
|
|
5257
5349
|
var _merge = require('./util/merge');
|
|
5258
5350
|
|
|
5259
5351
|
var _merge2 = _interopRequireDefault(_merge);
|
|
@@ -5312,10 +5404,6 @@ var yahoo_domains = ['rocketmail.com', 'yahoo.ca', 'yahoo.co.uk', 'yahoo.com', '
|
|
|
5312
5404
|
function normalizeEmail(email, options) {
|
|
5313
5405
|
options = (0, _merge2.default)(options, default_normalize_email_options);
|
|
5314
5406
|
|
|
5315
|
-
if (!(0, _isEmail2.default)(email)) {
|
|
5316
|
-
return false;
|
|
5317
|
-
}
|
|
5318
|
-
|
|
5319
5407
|
var raw_parts = email.split('@');
|
|
5320
5408
|
var domain = raw_parts.pop();
|
|
5321
5409
|
var user = raw_parts.join('@');
|
|
@@ -5380,7 +5468,7 @@ function normalizeEmail(email, options) {
|
|
|
5380
5468
|
return parts.join('@');
|
|
5381
5469
|
}
|
|
5382
5470
|
module.exports = exports['default'];
|
|
5383
|
-
},{"./
|
|
5471
|
+
},{"./util/merge":71}],62:[function(require,module,exports){
|
|
5384
5472
|
'use strict';
|
|
5385
5473
|
|
|
5386
5474
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -5406,7 +5494,7 @@ function rtrim(str, chars) {
|
|
|
5406
5494
|
return idx < str.length ? str.substr(0, idx + 1) : str;
|
|
5407
5495
|
}
|
|
5408
5496
|
module.exports = exports['default'];
|
|
5409
|
-
},{"./util/assertString":
|
|
5497
|
+
},{"./util/assertString":70}],63:[function(require,module,exports){
|
|
5410
5498
|
'use strict';
|
|
5411
5499
|
|
|
5412
5500
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -5430,7 +5518,7 @@ function stripLow(str, keep_new_lines) {
|
|
|
5430
5518
|
return (0, _blacklist2.default)(str, chars);
|
|
5431
5519
|
}
|
|
5432
5520
|
module.exports = exports['default'];
|
|
5433
|
-
},{"./blacklist":6,"./util/assertString":
|
|
5521
|
+
},{"./blacklist":6,"./util/assertString":70}],64:[function(require,module,exports){
|
|
5434
5522
|
'use strict';
|
|
5435
5523
|
|
|
5436
5524
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -5452,7 +5540,7 @@ function toBoolean(str, strict) {
|
|
|
5452
5540
|
return str !== '0' && str !== 'false' && str !== '';
|
|
5453
5541
|
}
|
|
5454
5542
|
module.exports = exports['default'];
|
|
5455
|
-
},{"./util/assertString":
|
|
5543
|
+
},{"./util/assertString":70}],65:[function(require,module,exports){
|
|
5456
5544
|
'use strict';
|
|
5457
5545
|
|
|
5458
5546
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -5472,7 +5560,7 @@ function toDate(date) {
|
|
|
5472
5560
|
return !isNaN(date) ? new Date(date) : null;
|
|
5473
5561
|
}
|
|
5474
5562
|
module.exports = exports['default'];
|
|
5475
|
-
},{"./util/assertString":
|
|
5563
|
+
},{"./util/assertString":70}],66:[function(require,module,exports){
|
|
5476
5564
|
'use strict';
|
|
5477
5565
|
|
|
5478
5566
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -5491,7 +5579,7 @@ function toFloat(str) {
|
|
|
5491
5579
|
return parseFloat(str);
|
|
5492
5580
|
}
|
|
5493
5581
|
module.exports = exports['default'];
|
|
5494
|
-
},{"./util/assertString":
|
|
5582
|
+
},{"./util/assertString":70}],67:[function(require,module,exports){
|
|
5495
5583
|
'use strict';
|
|
5496
5584
|
|
|
5497
5585
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -5510,7 +5598,7 @@ function toInt(str, radix) {
|
|
|
5510
5598
|
return parseInt(str, radix || 10);
|
|
5511
5599
|
}
|
|
5512
5600
|
module.exports = exports['default'];
|
|
5513
|
-
},{"./util/assertString":
|
|
5601
|
+
},{"./util/assertString":70}],68:[function(require,module,exports){
|
|
5514
5602
|
'use strict';
|
|
5515
5603
|
|
|
5516
5604
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -5532,7 +5620,7 @@ function trim(str, chars) {
|
|
|
5532
5620
|
return (0, _rtrim2.default)((0, _ltrim2.default)(str, chars), chars);
|
|
5533
5621
|
}
|
|
5534
5622
|
module.exports = exports['default'];
|
|
5535
|
-
},{"./ltrim":
|
|
5623
|
+
},{"./ltrim":59,"./rtrim":62}],69:[function(require,module,exports){
|
|
5536
5624
|
'use strict';
|
|
5537
5625
|
|
|
5538
5626
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -5551,7 +5639,7 @@ function unescape(str) {
|
|
|
5551
5639
|
return str.replace(/&/g, '&').replace(/"/g, '"').replace(/'/g, "'").replace(/</g, '<').replace(/>/g, '>').replace(///g, '/').replace(/\/g, '\\').replace(/`/g, '`');
|
|
5552
5640
|
}
|
|
5553
5641
|
module.exports = exports['default'];
|
|
5554
|
-
},{"./util/assertString":
|
|
5642
|
+
},{"./util/assertString":70}],70:[function(require,module,exports){
|
|
5555
5643
|
'use strict';
|
|
5556
5644
|
|
|
5557
5645
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -5566,7 +5654,7 @@ function assertString(input) {
|
|
|
5566
5654
|
}
|
|
5567
5655
|
}
|
|
5568
5656
|
module.exports = exports['default'];
|
|
5569
|
-
},{}],
|
|
5657
|
+
},{}],71:[function(require,module,exports){
|
|
5570
5658
|
'use strict';
|
|
5571
5659
|
|
|
5572
5660
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -5585,7 +5673,7 @@ function merge() {
|
|
|
5585
5673
|
return obj;
|
|
5586
5674
|
}
|
|
5587
5675
|
module.exports = exports['default'];
|
|
5588
|
-
},{}],
|
|
5676
|
+
},{}],72:[function(require,module,exports){
|
|
5589
5677
|
'use strict';
|
|
5590
5678
|
|
|
5591
5679
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -5608,7 +5696,7 @@ function toString(input) {
|
|
|
5608
5696
|
return String(input);
|
|
5609
5697
|
}
|
|
5610
5698
|
module.exports = exports['default'];
|
|
5611
|
-
},{}],
|
|
5699
|
+
},{}],73:[function(require,module,exports){
|
|
5612
5700
|
'use strict';
|
|
5613
5701
|
|
|
5614
5702
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -5627,7 +5715,7 @@ function whitelist(str, chars) {
|
|
|
5627
5715
|
return str.replace(new RegExp('[^' + chars + ']+', 'g'), '');
|
|
5628
5716
|
}
|
|
5629
5717
|
module.exports = exports['default'];
|
|
5630
|
-
},{"./util/assertString":
|
|
5718
|
+
},{"./util/assertString":70}],74:[function(require,module,exports){
|
|
5631
5719
|
"use strict";
|
|
5632
5720
|
|
|
5633
5721
|
module.exports = {
|
|
@@ -5688,7 +5776,7 @@ module.exports = {
|
|
|
5688
5776
|
|
|
5689
5777
|
};
|
|
5690
5778
|
|
|
5691
|
-
},{}],
|
|
5779
|
+
},{}],75:[function(require,module,exports){
|
|
5692
5780
|
/*jshint maxlen: false*/
|
|
5693
5781
|
|
|
5694
5782
|
var validator = require("validator");
|
|
@@ -5819,7 +5907,7 @@ var FormatValidators = {
|
|
|
5819
5907
|
|
|
5820
5908
|
module.exports = FormatValidators;
|
|
5821
5909
|
|
|
5822
|
-
},{"validator":4}],
|
|
5910
|
+
},{"validator":4}],76:[function(require,module,exports){
|
|
5823
5911
|
"use strict";
|
|
5824
5912
|
|
|
5825
5913
|
var FormatValidators = require("./FormatValidators"),
|
|
@@ -6362,7 +6450,7 @@ exports.validate = function (report, schema, json) {
|
|
|
6362
6450
|
|
|
6363
6451
|
};
|
|
6364
6452
|
|
|
6365
|
-
},{"./FormatValidators":
|
|
6453
|
+
},{"./FormatValidators":75,"./Report":78,"./Utils":82}],77:[function(require,module,exports){
|
|
6366
6454
|
// Number.isFinite polyfill
|
|
6367
6455
|
// http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isfinite
|
|
6368
6456
|
if (typeof Number.isFinite !== "function") {
|
|
@@ -6380,7 +6468,7 @@ if (typeof Number.isFinite !== "function") {
|
|
|
6380
6468
|
};
|
|
6381
6469
|
}
|
|
6382
6470
|
|
|
6383
|
-
},{}],
|
|
6471
|
+
},{}],78:[function(require,module,exports){
|
|
6384
6472
|
(function (process){
|
|
6385
6473
|
"use strict";
|
|
6386
6474
|
|
|
@@ -6586,7 +6674,7 @@ Report.prototype.addCustomError = function (errorCode, errorMessage, params, sub
|
|
|
6586
6674
|
module.exports = Report;
|
|
6587
6675
|
|
|
6588
6676
|
}).call(this,require('_process'))
|
|
6589
|
-
},{"./Errors":
|
|
6677
|
+
},{"./Errors":74,"./Utils":82,"_process":3,"lodash.get":1}],79:[function(require,module,exports){
|
|
6590
6678
|
"use strict";
|
|
6591
6679
|
|
|
6592
6680
|
var isequal = require("lodash.isequal");
|
|
@@ -6710,7 +6798,15 @@ exports.getSchemaByUri = function (report, uri, root) {
|
|
|
6710
6798
|
|
|
6711
6799
|
var remoteReport = new Report(report);
|
|
6712
6800
|
if (SchemaCompilation.compileSchema.call(this, remoteReport, result)) {
|
|
6713
|
-
|
|
6801
|
+
var savedOptions = this.options;
|
|
6802
|
+
try {
|
|
6803
|
+
// If custom validationOptions were provided to setRemoteReference(),
|
|
6804
|
+
// use them instead of the default options
|
|
6805
|
+
this.options = result.__$validationOptions || this.options;
|
|
6806
|
+
SchemaValidation.validateSchema.call(this, remoteReport, result);
|
|
6807
|
+
} finally {
|
|
6808
|
+
this.options = savedOptions;
|
|
6809
|
+
}
|
|
6714
6810
|
}
|
|
6715
6811
|
var remoteReportIsValid = remoteReport.isValid();
|
|
6716
6812
|
if (!remoteReportIsValid) {
|
|
@@ -6742,7 +6838,7 @@ exports.getSchemaByUri = function (report, uri, root) {
|
|
|
6742
6838
|
|
|
6743
6839
|
exports.getRemotePath = getRemotePath;
|
|
6744
6840
|
|
|
6745
|
-
},{"./Report":
|
|
6841
|
+
},{"./Report":78,"./SchemaCompilation":80,"./SchemaValidation":81,"./Utils":82,"lodash.isequal":2}],80:[function(require,module,exports){
|
|
6746
6842
|
"use strict";
|
|
6747
6843
|
|
|
6748
6844
|
var Report = require("./Report");
|
|
@@ -7043,7 +7139,7 @@ exports.compileSchema = function (report, schema) {
|
|
|
7043
7139
|
|
|
7044
7140
|
};
|
|
7045
7141
|
|
|
7046
|
-
},{"./Report":
|
|
7142
|
+
},{"./Report":78,"./SchemaCache":79,"./Utils":82}],81:[function(require,module,exports){
|
|
7047
7143
|
"use strict";
|
|
7048
7144
|
|
|
7049
7145
|
var FormatValidators = require("./FormatValidators"),
|
|
@@ -7652,7 +7748,7 @@ exports.validateSchema = function (report, schema) {
|
|
|
7652
7748
|
return isValid;
|
|
7653
7749
|
};
|
|
7654
7750
|
|
|
7655
|
-
},{"./FormatValidators":
|
|
7751
|
+
},{"./FormatValidators":75,"./JsonValidation":76,"./Report":78,"./Utils":82}],82:[function(require,module,exports){
|
|
7656
7752
|
"use strict";
|
|
7657
7753
|
|
|
7658
7754
|
exports.isAbsoluteUri = function (uri) {
|
|
@@ -7871,7 +7967,7 @@ exports.ucs2decode = function (string) {
|
|
|
7871
7967
|
};
|
|
7872
7968
|
/*jshint +W016*/
|
|
7873
7969
|
|
|
7874
|
-
},{}],
|
|
7970
|
+
},{}],83:[function(require,module,exports){
|
|
7875
7971
|
(function (process){
|
|
7876
7972
|
"use strict";
|
|
7877
7973
|
|
|
@@ -7935,15 +8031,8 @@ var defaultOptions = {
|
|
|
7935
8031
|
customValidator: null
|
|
7936
8032
|
};
|
|
7937
8033
|
|
|
7938
|
-
|
|
7939
|
-
|
|
7940
|
-
*/
|
|
7941
|
-
function ZSchema(options) {
|
|
7942
|
-
this.cache = {};
|
|
7943
|
-
this.referenceCache = [];
|
|
7944
|
-
|
|
7945
|
-
this.setRemoteReference("http://json-schema.org/draft-04/schema", Draft4Schema);
|
|
7946
|
-
this.setRemoteReference("http://json-schema.org/draft-04/hyper-schema", Draft4HyperSchema);
|
|
8034
|
+
function normalizeOptions(options) {
|
|
8035
|
+
var normalized;
|
|
7947
8036
|
|
|
7948
8037
|
// options
|
|
7949
8038
|
if (typeof options === "object") {
|
|
@@ -7969,22 +8058,39 @@ function ZSchema(options) {
|
|
|
7969
8058
|
}
|
|
7970
8059
|
}
|
|
7971
8060
|
|
|
7972
|
-
|
|
8061
|
+
normalized = options;
|
|
7973
8062
|
} else {
|
|
7974
|
-
|
|
8063
|
+
normalized = Utils.clone(defaultOptions);
|
|
7975
8064
|
}
|
|
7976
8065
|
|
|
7977
|
-
if (
|
|
7978
|
-
|
|
7979
|
-
|
|
7980
|
-
|
|
7981
|
-
|
|
7982
|
-
|
|
7983
|
-
|
|
7984
|
-
|
|
7985
|
-
|
|
8066
|
+
if (normalized.strictMode === true) {
|
|
8067
|
+
normalized.forceAdditional = true;
|
|
8068
|
+
normalized.forceItems = true;
|
|
8069
|
+
normalized.forceMaxLength = true;
|
|
8070
|
+
normalized.forceProperties = true;
|
|
8071
|
+
normalized.noExtraKeywords = true;
|
|
8072
|
+
normalized.noTypeless = true;
|
|
8073
|
+
normalized.noEmptyStrings = true;
|
|
8074
|
+
normalized.noEmptyArrays = true;
|
|
7986
8075
|
}
|
|
7987
8076
|
|
|
8077
|
+
return normalized;
|
|
8078
|
+
}
|
|
8079
|
+
|
|
8080
|
+
/*
|
|
8081
|
+
constructor
|
|
8082
|
+
*/
|
|
8083
|
+
function ZSchema(options) {
|
|
8084
|
+
this.cache = {};
|
|
8085
|
+
this.referenceCache = [];
|
|
8086
|
+
|
|
8087
|
+
this.options = normalizeOptions(options);
|
|
8088
|
+
|
|
8089
|
+
// Disable strict validation for the built-in schemas
|
|
8090
|
+
var metaschemaOptions = normalizeOptions({ });
|
|
8091
|
+
|
|
8092
|
+
this.setRemoteReference("http://json-schema.org/draft-04/schema", Draft4Schema, metaschemaOptions);
|
|
8093
|
+
this.setRemoteReference("http://json-schema.org/draft-04/hyper-schema", Draft4HyperSchema, metaschemaOptions);
|
|
7988
8094
|
}
|
|
7989
8095
|
|
|
7990
8096
|
/*
|
|
@@ -8132,12 +8238,17 @@ ZSchema.prototype.getMissingRemoteReferences = function () {
|
|
|
8132
8238
|
}
|
|
8133
8239
|
return missingRemoteReferences;
|
|
8134
8240
|
};
|
|
8135
|
-
ZSchema.prototype.setRemoteReference = function (uri, schema) {
|
|
8241
|
+
ZSchema.prototype.setRemoteReference = function (uri, schema, validationOptions) {
|
|
8136
8242
|
if (typeof schema === "string") {
|
|
8137
8243
|
schema = JSON.parse(schema);
|
|
8138
8244
|
} else {
|
|
8139
8245
|
schema = Utils.cloneDeep(schema);
|
|
8140
8246
|
}
|
|
8247
|
+
|
|
8248
|
+
if (validationOptions) {
|
|
8249
|
+
schema.__$validationOptions = normalizeOptions(validationOptions);
|
|
8250
|
+
}
|
|
8251
|
+
|
|
8141
8252
|
SchemaCache.cacheSchemaByUri.call(this, uri, schema);
|
|
8142
8253
|
};
|
|
8143
8254
|
ZSchema.prototype.getResolvedSchema = function (schema) {
|
|
@@ -8227,7 +8338,7 @@ ZSchema.getDefaultOptions = function () {
|
|
|
8227
8338
|
module.exports = ZSchema;
|
|
8228
8339
|
|
|
8229
8340
|
}).call(this,require('_process'))
|
|
8230
|
-
},{"./FormatValidators":
|
|
8341
|
+
},{"./FormatValidators":75,"./JsonValidation":76,"./Polyfills":77,"./Report":78,"./SchemaCache":79,"./SchemaCompilation":80,"./SchemaValidation":81,"./Utils":82,"./schemas/hyper-schema.json":84,"./schemas/schema.json":85,"_process":3,"lodash.get":1}],84:[function(require,module,exports){
|
|
8231
8342
|
module.exports={
|
|
8232
8343
|
"$schema": "http://json-schema.org/draft-04/hyper-schema#",
|
|
8233
8344
|
"id": "http://json-schema.org/draft-04/hyper-schema#",
|
|
@@ -8387,7 +8498,7 @@ module.exports={
|
|
|
8387
8498
|
}
|
|
8388
8499
|
|
|
8389
8500
|
|
|
8390
|
-
},{}],
|
|
8501
|
+
},{}],85:[function(require,module,exports){
|
|
8391
8502
|
module.exports={
|
|
8392
8503
|
"id": "http://json-schema.org/draft-04/schema#",
|
|
8393
8504
|
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
@@ -8540,5 +8651,5 @@ module.exports={
|
|
|
8540
8651
|
"default": {}
|
|
8541
8652
|
}
|
|
8542
8653
|
|
|
8543
|
-
},{}]},{},[
|
|
8654
|
+
},{}]},{},[74,75,76,77,78,79,80,81,82,83])(83)
|
|
8544
8655
|
});
|