z-schema 3.21.0 → 3.24.1

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.
@@ -1,4 +1,875 @@
1
1
  (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.ZSchema = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
2
+ require('../modules/es6.symbol');
3
+ require('../modules/es6.object.to-string');
4
+ module.exports = require('../modules/_core').Symbol;
5
+
6
+ },{"../modules/_core":7,"../modules/es6.object.to-string":50,"../modules/es6.symbol":51}],2:[function(require,module,exports){
7
+ module.exports = function (it) {
8
+ if (typeof it != 'function') throw TypeError(it + ' is not a function!');
9
+ return it;
10
+ };
11
+
12
+ },{}],3:[function(require,module,exports){
13
+ var isObject = require('./_is-object');
14
+ module.exports = function (it) {
15
+ if (!isObject(it)) throw TypeError(it + ' is not an object!');
16
+ return it;
17
+ };
18
+
19
+ },{"./_is-object":23}],4:[function(require,module,exports){
20
+ // false -> Array#indexOf
21
+ // true -> Array#includes
22
+ var toIObject = require('./_to-iobject');
23
+ var toLength = require('./_to-length');
24
+ var toAbsoluteIndex = require('./_to-absolute-index');
25
+ module.exports = function (IS_INCLUDES) {
26
+ return function ($this, el, fromIndex) {
27
+ var O = toIObject($this);
28
+ var length = toLength(O.length);
29
+ var index = toAbsoluteIndex(fromIndex, length);
30
+ var value;
31
+ // Array#includes uses SameValueZero equality algorithm
32
+ // eslint-disable-next-line no-self-compare
33
+ if (IS_INCLUDES && el != el) while (length > index) {
34
+ value = O[index++];
35
+ // eslint-disable-next-line no-self-compare
36
+ if (value != value) return true;
37
+ // Array#indexOf ignores holes, Array#includes - not
38
+ } else for (;length > index; index++) if (IS_INCLUDES || index in O) {
39
+ if (O[index] === el) return IS_INCLUDES || index || 0;
40
+ } return !IS_INCLUDES && -1;
41
+ };
42
+ };
43
+
44
+ },{"./_to-absolute-index":41,"./_to-iobject":43,"./_to-length":44}],5:[function(require,module,exports){
45
+ // getting tag from 19.1.3.6 Object.prototype.toString()
46
+ var cof = require('./_cof');
47
+ var TAG = require('./_wks')('toStringTag');
48
+ // ES3 wrong here
49
+ var ARG = cof(function () { return arguments; }()) == 'Arguments';
50
+
51
+ // fallback for IE11 Script Access Denied error
52
+ var tryGet = function (it, key) {
53
+ try {
54
+ return it[key];
55
+ } catch (e) { /* empty */ }
56
+ };
57
+
58
+ module.exports = function (it) {
59
+ var O, T, B;
60
+ return it === undefined ? 'Undefined' : it === null ? 'Null'
61
+ // @@toStringTag case
62
+ : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T
63
+ // builtinTag case
64
+ : ARG ? cof(O)
65
+ // ES3 arguments fallback
66
+ : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
67
+ };
68
+
69
+ },{"./_cof":6,"./_wks":49}],6:[function(require,module,exports){
70
+ var toString = {}.toString;
71
+
72
+ module.exports = function (it) {
73
+ return toString.call(it).slice(8, -1);
74
+ };
75
+
76
+ },{}],7:[function(require,module,exports){
77
+ var core = module.exports = { version: '2.5.7' };
78
+ if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
79
+
80
+ },{}],8:[function(require,module,exports){
81
+ // optional / simple context binding
82
+ var aFunction = require('./_a-function');
83
+ module.exports = function (fn, that, length) {
84
+ aFunction(fn);
85
+ if (that === undefined) return fn;
86
+ switch (length) {
87
+ case 1: return function (a) {
88
+ return fn.call(that, a);
89
+ };
90
+ case 2: return function (a, b) {
91
+ return fn.call(that, a, b);
92
+ };
93
+ case 3: return function (a, b, c) {
94
+ return fn.call(that, a, b, c);
95
+ };
96
+ }
97
+ return function (/* ...args */) {
98
+ return fn.apply(that, arguments);
99
+ };
100
+ };
101
+
102
+ },{"./_a-function":2}],9:[function(require,module,exports){
103
+ // 7.2.1 RequireObjectCoercible(argument)
104
+ module.exports = function (it) {
105
+ if (it == undefined) throw TypeError("Can't call method on " + it);
106
+ return it;
107
+ };
108
+
109
+ },{}],10:[function(require,module,exports){
110
+ // Thank's IE8 for his funny defineProperty
111
+ module.exports = !require('./_fails')(function () {
112
+ return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
113
+ });
114
+
115
+ },{"./_fails":15}],11:[function(require,module,exports){
116
+ var isObject = require('./_is-object');
117
+ var document = require('./_global').document;
118
+ // typeof document.createElement is 'object' in old IE
119
+ var is = isObject(document) && isObject(document.createElement);
120
+ module.exports = function (it) {
121
+ return is ? document.createElement(it) : {};
122
+ };
123
+
124
+ },{"./_global":16,"./_is-object":23}],12:[function(require,module,exports){
125
+ // IE 8- don't enum bug keys
126
+ module.exports = (
127
+ 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
128
+ ).split(',');
129
+
130
+ },{}],13:[function(require,module,exports){
131
+ // all enumerable object keys, includes symbols
132
+ var getKeys = require('./_object-keys');
133
+ var gOPS = require('./_object-gops');
134
+ var pIE = require('./_object-pie');
135
+ module.exports = function (it) {
136
+ var result = getKeys(it);
137
+ var getSymbols = gOPS.f;
138
+ if (getSymbols) {
139
+ var symbols = getSymbols(it);
140
+ var isEnum = pIE.f;
141
+ var i = 0;
142
+ var key;
143
+ while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);
144
+ } return result;
145
+ };
146
+
147
+ },{"./_object-gops":32,"./_object-keys":34,"./_object-pie":35}],14:[function(require,module,exports){
148
+ var global = require('./_global');
149
+ var core = require('./_core');
150
+ var hide = require('./_hide');
151
+ var redefine = require('./_redefine');
152
+ var ctx = require('./_ctx');
153
+ var PROTOTYPE = 'prototype';
154
+
155
+ var $export = function (type, name, source) {
156
+ var IS_FORCED = type & $export.F;
157
+ var IS_GLOBAL = type & $export.G;
158
+ var IS_STATIC = type & $export.S;
159
+ var IS_PROTO = type & $export.P;
160
+ var IS_BIND = type & $export.B;
161
+ var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE];
162
+ var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});
163
+ var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});
164
+ var key, own, out, exp;
165
+ if (IS_GLOBAL) source = name;
166
+ for (key in source) {
167
+ // contains in native
168
+ own = !IS_FORCED && target && target[key] !== undefined;
169
+ // export native or passed
170
+ out = (own ? target : source)[key];
171
+ // bind timers to global for call from export context
172
+ exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
173
+ // extend global
174
+ if (target) redefine(target, key, out, type & $export.U);
175
+ // export
176
+ if (exports[key] != out) hide(exports, key, exp);
177
+ if (IS_PROTO && expProto[key] != out) expProto[key] = out;
178
+ }
179
+ };
180
+ global.core = core;
181
+ // type bitmap
182
+ $export.F = 1; // forced
183
+ $export.G = 2; // global
184
+ $export.S = 4; // static
185
+ $export.P = 8; // proto
186
+ $export.B = 16; // bind
187
+ $export.W = 32; // wrap
188
+ $export.U = 64; // safe
189
+ $export.R = 128; // real proto method for `library`
190
+ module.exports = $export;
191
+
192
+ },{"./_core":7,"./_ctx":8,"./_global":16,"./_hide":18,"./_redefine":37}],15:[function(require,module,exports){
193
+ module.exports = function (exec) {
194
+ try {
195
+ return !!exec();
196
+ } catch (e) {
197
+ return true;
198
+ }
199
+ };
200
+
201
+ },{}],16:[function(require,module,exports){
202
+ // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
203
+ var global = module.exports = typeof window != 'undefined' && window.Math == Math
204
+ ? window : typeof self != 'undefined' && self.Math == Math ? self
205
+ // eslint-disable-next-line no-new-func
206
+ : Function('return this')();
207
+ if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
208
+
209
+ },{}],17:[function(require,module,exports){
210
+ var hasOwnProperty = {}.hasOwnProperty;
211
+ module.exports = function (it, key) {
212
+ return hasOwnProperty.call(it, key);
213
+ };
214
+
215
+ },{}],18:[function(require,module,exports){
216
+ var dP = require('./_object-dp');
217
+ var createDesc = require('./_property-desc');
218
+ module.exports = require('./_descriptors') ? function (object, key, value) {
219
+ return dP.f(object, key, createDesc(1, value));
220
+ } : function (object, key, value) {
221
+ object[key] = value;
222
+ return object;
223
+ };
224
+
225
+ },{"./_descriptors":10,"./_object-dp":27,"./_property-desc":36}],19:[function(require,module,exports){
226
+ var document = require('./_global').document;
227
+ module.exports = document && document.documentElement;
228
+
229
+ },{"./_global":16}],20:[function(require,module,exports){
230
+ module.exports = !require('./_descriptors') && !require('./_fails')(function () {
231
+ return Object.defineProperty(require('./_dom-create')('div'), 'a', { get: function () { return 7; } }).a != 7;
232
+ });
233
+
234
+ },{"./_descriptors":10,"./_dom-create":11,"./_fails":15}],21:[function(require,module,exports){
235
+ // fallback for non-array-like ES3 and non-enumerable old V8 strings
236
+ var cof = require('./_cof');
237
+ // eslint-disable-next-line no-prototype-builtins
238
+ module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
239
+ return cof(it) == 'String' ? it.split('') : Object(it);
240
+ };
241
+
242
+ },{"./_cof":6}],22:[function(require,module,exports){
243
+ // 7.2.2 IsArray(argument)
244
+ var cof = require('./_cof');
245
+ module.exports = Array.isArray || function isArray(arg) {
246
+ return cof(arg) == 'Array';
247
+ };
248
+
249
+ },{"./_cof":6}],23:[function(require,module,exports){
250
+ module.exports = function (it) {
251
+ return typeof it === 'object' ? it !== null : typeof it === 'function';
252
+ };
253
+
254
+ },{}],24:[function(require,module,exports){
255
+ module.exports = false;
256
+
257
+ },{}],25:[function(require,module,exports){
258
+ var META = require('./_uid')('meta');
259
+ var isObject = require('./_is-object');
260
+ var has = require('./_has');
261
+ var setDesc = require('./_object-dp').f;
262
+ var id = 0;
263
+ var isExtensible = Object.isExtensible || function () {
264
+ return true;
265
+ };
266
+ var FREEZE = !require('./_fails')(function () {
267
+ return isExtensible(Object.preventExtensions({}));
268
+ });
269
+ var setMeta = function (it) {
270
+ setDesc(it, META, { value: {
271
+ i: 'O' + ++id, // object ID
272
+ w: {} // weak collections IDs
273
+ } });
274
+ };
275
+ var fastKey = function (it, create) {
276
+ // return primitive with prefix
277
+ if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
278
+ if (!has(it, META)) {
279
+ // can't set metadata to uncaught frozen object
280
+ if (!isExtensible(it)) return 'F';
281
+ // not necessary to add metadata
282
+ if (!create) return 'E';
283
+ // add missing metadata
284
+ setMeta(it);
285
+ // return object ID
286
+ } return it[META].i;
287
+ };
288
+ var getWeak = function (it, create) {
289
+ if (!has(it, META)) {
290
+ // can't set metadata to uncaught frozen object
291
+ if (!isExtensible(it)) return true;
292
+ // not necessary to add metadata
293
+ if (!create) return false;
294
+ // add missing metadata
295
+ setMeta(it);
296
+ // return hash weak collections IDs
297
+ } return it[META].w;
298
+ };
299
+ // add metadata on freeze-family methods calling
300
+ var onFreeze = function (it) {
301
+ if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);
302
+ return it;
303
+ };
304
+ var meta = module.exports = {
305
+ KEY: META,
306
+ NEED: false,
307
+ fastKey: fastKey,
308
+ getWeak: getWeak,
309
+ onFreeze: onFreeze
310
+ };
311
+
312
+ },{"./_fails":15,"./_has":17,"./_is-object":23,"./_object-dp":27,"./_uid":46}],26:[function(require,module,exports){
313
+ // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
314
+ var anObject = require('./_an-object');
315
+ var dPs = require('./_object-dps');
316
+ var enumBugKeys = require('./_enum-bug-keys');
317
+ var IE_PROTO = require('./_shared-key')('IE_PROTO');
318
+ var Empty = function () { /* empty */ };
319
+ var PROTOTYPE = 'prototype';
320
+
321
+ // Create object with fake `null` prototype: use iframe Object with cleared prototype
322
+ var createDict = function () {
323
+ // Thrash, waste and sodomy: IE GC bug
324
+ var iframe = require('./_dom-create')('iframe');
325
+ var i = enumBugKeys.length;
326
+ var lt = '<';
327
+ var gt = '>';
328
+ var iframeDocument;
329
+ iframe.style.display = 'none';
330
+ require('./_html').appendChild(iframe);
331
+ iframe.src = 'javascript:'; // eslint-disable-line no-script-url
332
+ // createDict = iframe.contentWindow.Object;
333
+ // html.removeChild(iframe);
334
+ iframeDocument = iframe.contentWindow.document;
335
+ iframeDocument.open();
336
+ iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
337
+ iframeDocument.close();
338
+ createDict = iframeDocument.F;
339
+ while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];
340
+ return createDict();
341
+ };
342
+
343
+ module.exports = Object.create || function create(O, Properties) {
344
+ var result;
345
+ if (O !== null) {
346
+ Empty[PROTOTYPE] = anObject(O);
347
+ result = new Empty();
348
+ Empty[PROTOTYPE] = null;
349
+ // add "__proto__" for Object.getPrototypeOf polyfill
350
+ result[IE_PROTO] = O;
351
+ } else result = createDict();
352
+ return Properties === undefined ? result : dPs(result, Properties);
353
+ };
354
+
355
+ },{"./_an-object":3,"./_dom-create":11,"./_enum-bug-keys":12,"./_html":19,"./_object-dps":28,"./_shared-key":39}],27:[function(require,module,exports){
356
+ var anObject = require('./_an-object');
357
+ var IE8_DOM_DEFINE = require('./_ie8-dom-define');
358
+ var toPrimitive = require('./_to-primitive');
359
+ var dP = Object.defineProperty;
360
+
361
+ exports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes) {
362
+ anObject(O);
363
+ P = toPrimitive(P, true);
364
+ anObject(Attributes);
365
+ if (IE8_DOM_DEFINE) try {
366
+ return dP(O, P, Attributes);
367
+ } catch (e) { /* empty */ }
368
+ if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
369
+ if ('value' in Attributes) O[P] = Attributes.value;
370
+ return O;
371
+ };
372
+
373
+ },{"./_an-object":3,"./_descriptors":10,"./_ie8-dom-define":20,"./_to-primitive":45}],28:[function(require,module,exports){
374
+ var dP = require('./_object-dp');
375
+ var anObject = require('./_an-object');
376
+ var getKeys = require('./_object-keys');
377
+
378
+ module.exports = require('./_descriptors') ? Object.defineProperties : function defineProperties(O, Properties) {
379
+ anObject(O);
380
+ var keys = getKeys(Properties);
381
+ var length = keys.length;
382
+ var i = 0;
383
+ var P;
384
+ while (length > i) dP.f(O, P = keys[i++], Properties[P]);
385
+ return O;
386
+ };
387
+
388
+ },{"./_an-object":3,"./_descriptors":10,"./_object-dp":27,"./_object-keys":34}],29:[function(require,module,exports){
389
+ var pIE = require('./_object-pie');
390
+ var createDesc = require('./_property-desc');
391
+ var toIObject = require('./_to-iobject');
392
+ var toPrimitive = require('./_to-primitive');
393
+ var has = require('./_has');
394
+ var IE8_DOM_DEFINE = require('./_ie8-dom-define');
395
+ var gOPD = Object.getOwnPropertyDescriptor;
396
+
397
+ exports.f = require('./_descriptors') ? gOPD : function getOwnPropertyDescriptor(O, P) {
398
+ O = toIObject(O);
399
+ P = toPrimitive(P, true);
400
+ if (IE8_DOM_DEFINE) try {
401
+ return gOPD(O, P);
402
+ } catch (e) { /* empty */ }
403
+ if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);
404
+ };
405
+
406
+ },{"./_descriptors":10,"./_has":17,"./_ie8-dom-define":20,"./_object-pie":35,"./_property-desc":36,"./_to-iobject":43,"./_to-primitive":45}],30:[function(require,module,exports){
407
+ // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
408
+ var toIObject = require('./_to-iobject');
409
+ var gOPN = require('./_object-gopn').f;
410
+ var toString = {}.toString;
411
+
412
+ var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
413
+ ? Object.getOwnPropertyNames(window) : [];
414
+
415
+ var getWindowNames = function (it) {
416
+ try {
417
+ return gOPN(it);
418
+ } catch (e) {
419
+ return windowNames.slice();
420
+ }
421
+ };
422
+
423
+ module.exports.f = function getOwnPropertyNames(it) {
424
+ return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));
425
+ };
426
+
427
+ },{"./_object-gopn":31,"./_to-iobject":43}],31:[function(require,module,exports){
428
+ // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
429
+ var $keys = require('./_object-keys-internal');
430
+ var hiddenKeys = require('./_enum-bug-keys').concat('length', 'prototype');
431
+
432
+ exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
433
+ return $keys(O, hiddenKeys);
434
+ };
435
+
436
+ },{"./_enum-bug-keys":12,"./_object-keys-internal":33}],32:[function(require,module,exports){
437
+ exports.f = Object.getOwnPropertySymbols;
438
+
439
+ },{}],33:[function(require,module,exports){
440
+ var has = require('./_has');
441
+ var toIObject = require('./_to-iobject');
442
+ var arrayIndexOf = require('./_array-includes')(false);
443
+ var IE_PROTO = require('./_shared-key')('IE_PROTO');
444
+
445
+ module.exports = function (object, names) {
446
+ var O = toIObject(object);
447
+ var i = 0;
448
+ var result = [];
449
+ var key;
450
+ for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);
451
+ // Don't enum bug & hidden keys
452
+ while (names.length > i) if (has(O, key = names[i++])) {
453
+ ~arrayIndexOf(result, key) || result.push(key);
454
+ }
455
+ return result;
456
+ };
457
+
458
+ },{"./_array-includes":4,"./_has":17,"./_shared-key":39,"./_to-iobject":43}],34:[function(require,module,exports){
459
+ // 19.1.2.14 / 15.2.3.14 Object.keys(O)
460
+ var $keys = require('./_object-keys-internal');
461
+ var enumBugKeys = require('./_enum-bug-keys');
462
+
463
+ module.exports = Object.keys || function keys(O) {
464
+ return $keys(O, enumBugKeys);
465
+ };
466
+
467
+ },{"./_enum-bug-keys":12,"./_object-keys-internal":33}],35:[function(require,module,exports){
468
+ exports.f = {}.propertyIsEnumerable;
469
+
470
+ },{}],36:[function(require,module,exports){
471
+ module.exports = function (bitmap, value) {
472
+ return {
473
+ enumerable: !(bitmap & 1),
474
+ configurable: !(bitmap & 2),
475
+ writable: !(bitmap & 4),
476
+ value: value
477
+ };
478
+ };
479
+
480
+ },{}],37:[function(require,module,exports){
481
+ var global = require('./_global');
482
+ var hide = require('./_hide');
483
+ var has = require('./_has');
484
+ var SRC = require('./_uid')('src');
485
+ var TO_STRING = 'toString';
486
+ var $toString = Function[TO_STRING];
487
+ var TPL = ('' + $toString).split(TO_STRING);
488
+
489
+ require('./_core').inspectSource = function (it) {
490
+ return $toString.call(it);
491
+ };
492
+
493
+ (module.exports = function (O, key, val, safe) {
494
+ var isFunction = typeof val == 'function';
495
+ if (isFunction) has(val, 'name') || hide(val, 'name', key);
496
+ if (O[key] === val) return;
497
+ if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));
498
+ if (O === global) {
499
+ O[key] = val;
500
+ } else if (!safe) {
501
+ delete O[key];
502
+ hide(O, key, val);
503
+ } else if (O[key]) {
504
+ O[key] = val;
505
+ } else {
506
+ hide(O, key, val);
507
+ }
508
+ // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
509
+ })(Function.prototype, TO_STRING, function toString() {
510
+ return typeof this == 'function' && this[SRC] || $toString.call(this);
511
+ });
512
+
513
+ },{"./_core":7,"./_global":16,"./_has":17,"./_hide":18,"./_uid":46}],38:[function(require,module,exports){
514
+ var def = require('./_object-dp').f;
515
+ var has = require('./_has');
516
+ var TAG = require('./_wks')('toStringTag');
517
+
518
+ module.exports = function (it, tag, stat) {
519
+ if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
520
+ };
521
+
522
+ },{"./_has":17,"./_object-dp":27,"./_wks":49}],39:[function(require,module,exports){
523
+ var shared = require('./_shared')('keys');
524
+ var uid = require('./_uid');
525
+ module.exports = function (key) {
526
+ return shared[key] || (shared[key] = uid(key));
527
+ };
528
+
529
+ },{"./_shared":40,"./_uid":46}],40:[function(require,module,exports){
530
+ var core = require('./_core');
531
+ var global = require('./_global');
532
+ var SHARED = '__core-js_shared__';
533
+ var store = global[SHARED] || (global[SHARED] = {});
534
+
535
+ (module.exports = function (key, value) {
536
+ return store[key] || (store[key] = value !== undefined ? value : {});
537
+ })('versions', []).push({
538
+ version: core.version,
539
+ mode: require('./_library') ? 'pure' : 'global',
540
+ copyright: '© 2018 Denis Pushkarev (zloirock.ru)'
541
+ });
542
+
543
+ },{"./_core":7,"./_global":16,"./_library":24}],41:[function(require,module,exports){
544
+ var toInteger = require('./_to-integer');
545
+ var max = Math.max;
546
+ var min = Math.min;
547
+ module.exports = function (index, length) {
548
+ index = toInteger(index);
549
+ return index < 0 ? max(index + length, 0) : min(index, length);
550
+ };
551
+
552
+ },{"./_to-integer":42}],42:[function(require,module,exports){
553
+ // 7.1.4 ToInteger
554
+ var ceil = Math.ceil;
555
+ var floor = Math.floor;
556
+ module.exports = function (it) {
557
+ return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
558
+ };
559
+
560
+ },{}],43:[function(require,module,exports){
561
+ // to indexed object, toObject with fallback for non-array-like ES3 strings
562
+ var IObject = require('./_iobject');
563
+ var defined = require('./_defined');
564
+ module.exports = function (it) {
565
+ return IObject(defined(it));
566
+ };
567
+
568
+ },{"./_defined":9,"./_iobject":21}],44:[function(require,module,exports){
569
+ // 7.1.15 ToLength
570
+ var toInteger = require('./_to-integer');
571
+ var min = Math.min;
572
+ module.exports = function (it) {
573
+ return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
574
+ };
575
+
576
+ },{"./_to-integer":42}],45:[function(require,module,exports){
577
+ // 7.1.1 ToPrimitive(input [, PreferredType])
578
+ var isObject = require('./_is-object');
579
+ // instead of the ES6 spec version, we didn't implement @@toPrimitive case
580
+ // and the second argument - flag - preferred type is a string
581
+ module.exports = function (it, S) {
582
+ if (!isObject(it)) return it;
583
+ var fn, val;
584
+ if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
585
+ if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
586
+ if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
587
+ throw TypeError("Can't convert object to primitive value");
588
+ };
589
+
590
+ },{"./_is-object":23}],46:[function(require,module,exports){
591
+ var id = 0;
592
+ var px = Math.random();
593
+ module.exports = function (key) {
594
+ return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
595
+ };
596
+
597
+ },{}],47:[function(require,module,exports){
598
+ var global = require('./_global');
599
+ var core = require('./_core');
600
+ var LIBRARY = require('./_library');
601
+ var wksExt = require('./_wks-ext');
602
+ var defineProperty = require('./_object-dp').f;
603
+ module.exports = function (name) {
604
+ var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});
605
+ if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });
606
+ };
607
+
608
+ },{"./_core":7,"./_global":16,"./_library":24,"./_object-dp":27,"./_wks-ext":48}],48:[function(require,module,exports){
609
+ exports.f = require('./_wks');
610
+
611
+ },{"./_wks":49}],49:[function(require,module,exports){
612
+ var store = require('./_shared')('wks');
613
+ var uid = require('./_uid');
614
+ var Symbol = require('./_global').Symbol;
615
+ var USE_SYMBOL = typeof Symbol == 'function';
616
+
617
+ var $exports = module.exports = function (name) {
618
+ return store[name] || (store[name] =
619
+ USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
620
+ };
621
+
622
+ $exports.store = store;
623
+
624
+ },{"./_global":16,"./_shared":40,"./_uid":46}],50:[function(require,module,exports){
625
+ 'use strict';
626
+ // 19.1.3.6 Object.prototype.toString()
627
+ var classof = require('./_classof');
628
+ var test = {};
629
+ test[require('./_wks')('toStringTag')] = 'z';
630
+ if (test + '' != '[object z]') {
631
+ require('./_redefine')(Object.prototype, 'toString', function toString() {
632
+ return '[object ' + classof(this) + ']';
633
+ }, true);
634
+ }
635
+
636
+ },{"./_classof":5,"./_redefine":37,"./_wks":49}],51:[function(require,module,exports){
637
+ 'use strict';
638
+ // ECMAScript 6 symbols shim
639
+ var global = require('./_global');
640
+ var has = require('./_has');
641
+ var DESCRIPTORS = require('./_descriptors');
642
+ var $export = require('./_export');
643
+ var redefine = require('./_redefine');
644
+ var META = require('./_meta').KEY;
645
+ var $fails = require('./_fails');
646
+ var shared = require('./_shared');
647
+ var setToStringTag = require('./_set-to-string-tag');
648
+ var uid = require('./_uid');
649
+ var wks = require('./_wks');
650
+ var wksExt = require('./_wks-ext');
651
+ var wksDefine = require('./_wks-define');
652
+ var enumKeys = require('./_enum-keys');
653
+ var isArray = require('./_is-array');
654
+ var anObject = require('./_an-object');
655
+ var isObject = require('./_is-object');
656
+ var toIObject = require('./_to-iobject');
657
+ var toPrimitive = require('./_to-primitive');
658
+ var createDesc = require('./_property-desc');
659
+ var _create = require('./_object-create');
660
+ var gOPNExt = require('./_object-gopn-ext');
661
+ var $GOPD = require('./_object-gopd');
662
+ var $DP = require('./_object-dp');
663
+ var $keys = require('./_object-keys');
664
+ var gOPD = $GOPD.f;
665
+ var dP = $DP.f;
666
+ var gOPN = gOPNExt.f;
667
+ var $Symbol = global.Symbol;
668
+ var $JSON = global.JSON;
669
+ var _stringify = $JSON && $JSON.stringify;
670
+ var PROTOTYPE = 'prototype';
671
+ var HIDDEN = wks('_hidden');
672
+ var TO_PRIMITIVE = wks('toPrimitive');
673
+ var isEnum = {}.propertyIsEnumerable;
674
+ var SymbolRegistry = shared('symbol-registry');
675
+ var AllSymbols = shared('symbols');
676
+ var OPSymbols = shared('op-symbols');
677
+ var ObjectProto = Object[PROTOTYPE];
678
+ var USE_NATIVE = typeof $Symbol == 'function';
679
+ var QObject = global.QObject;
680
+ // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
681
+ var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
682
+
683
+ // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
684
+ var setSymbolDesc = DESCRIPTORS && $fails(function () {
685
+ return _create(dP({}, 'a', {
686
+ get: function () { return dP(this, 'a', { value: 7 }).a; }
687
+ })).a != 7;
688
+ }) ? function (it, key, D) {
689
+ var protoDesc = gOPD(ObjectProto, key);
690
+ if (protoDesc) delete ObjectProto[key];
691
+ dP(it, key, D);
692
+ if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);
693
+ } : dP;
694
+
695
+ var wrap = function (tag) {
696
+ var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);
697
+ sym._k = tag;
698
+ return sym;
699
+ };
700
+
701
+ var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {
702
+ return typeof it == 'symbol';
703
+ } : function (it) {
704
+ return it instanceof $Symbol;
705
+ };
706
+
707
+ var $defineProperty = function defineProperty(it, key, D) {
708
+ if (it === ObjectProto) $defineProperty(OPSymbols, key, D);
709
+ anObject(it);
710
+ key = toPrimitive(key, true);
711
+ anObject(D);
712
+ if (has(AllSymbols, key)) {
713
+ if (!D.enumerable) {
714
+ if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));
715
+ it[HIDDEN][key] = true;
716
+ } else {
717
+ if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;
718
+ D = _create(D, { enumerable: createDesc(0, false) });
719
+ } return setSymbolDesc(it, key, D);
720
+ } return dP(it, key, D);
721
+ };
722
+ var $defineProperties = function defineProperties(it, P) {
723
+ anObject(it);
724
+ var keys = enumKeys(P = toIObject(P));
725
+ var i = 0;
726
+ var l = keys.length;
727
+ var key;
728
+ while (l > i) $defineProperty(it, key = keys[i++], P[key]);
729
+ return it;
730
+ };
731
+ var $create = function create(it, P) {
732
+ return P === undefined ? _create(it) : $defineProperties(_create(it), P);
733
+ };
734
+ var $propertyIsEnumerable = function propertyIsEnumerable(key) {
735
+ var E = isEnum.call(this, key = toPrimitive(key, true));
736
+ if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;
737
+ return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;
738
+ };
739
+ var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {
740
+ it = toIObject(it);
741
+ key = toPrimitive(key, true);
742
+ if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;
743
+ var D = gOPD(it, key);
744
+ if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;
745
+ return D;
746
+ };
747
+ var $getOwnPropertyNames = function getOwnPropertyNames(it) {
748
+ var names = gOPN(toIObject(it));
749
+ var result = [];
750
+ var i = 0;
751
+ var key;
752
+ while (names.length > i) {
753
+ if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);
754
+ } return result;
755
+ };
756
+ var $getOwnPropertySymbols = function getOwnPropertySymbols(it) {
757
+ var IS_OP = it === ObjectProto;
758
+ var names = gOPN(IS_OP ? OPSymbols : toIObject(it));
759
+ var result = [];
760
+ var i = 0;
761
+ var key;
762
+ while (names.length > i) {
763
+ if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);
764
+ } return result;
765
+ };
766
+
767
+ // 19.4.1.1 Symbol([description])
768
+ if (!USE_NATIVE) {
769
+ $Symbol = function Symbol() {
770
+ if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');
771
+ var tag = uid(arguments.length > 0 ? arguments[0] : undefined);
772
+ var $set = function (value) {
773
+ if (this === ObjectProto) $set.call(OPSymbols, value);
774
+ if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
775
+ setSymbolDesc(this, tag, createDesc(1, value));
776
+ };
777
+ if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });
778
+ return wrap(tag);
779
+ };
780
+ redefine($Symbol[PROTOTYPE], 'toString', function toString() {
781
+ return this._k;
782
+ });
783
+
784
+ $GOPD.f = $getOwnPropertyDescriptor;
785
+ $DP.f = $defineProperty;
786
+ require('./_object-gopn').f = gOPNExt.f = $getOwnPropertyNames;
787
+ require('./_object-pie').f = $propertyIsEnumerable;
788
+ require('./_object-gops').f = $getOwnPropertySymbols;
789
+
790
+ if (DESCRIPTORS && !require('./_library')) {
791
+ redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);
792
+ }
793
+
794
+ wksExt.f = function (name) {
795
+ return wrap(wks(name));
796
+ };
797
+ }
798
+
799
+ $export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });
800
+
801
+ for (var es6Symbols = (
802
+ // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14
803
+ 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'
804
+ ).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);
805
+
806
+ for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);
807
+
808
+ $export($export.S + $export.F * !USE_NATIVE, 'Symbol', {
809
+ // 19.4.2.1 Symbol.for(key)
810
+ 'for': function (key) {
811
+ return has(SymbolRegistry, key += '')
812
+ ? SymbolRegistry[key]
813
+ : SymbolRegistry[key] = $Symbol(key);
814
+ },
815
+ // 19.4.2.5 Symbol.keyFor(sym)
816
+ keyFor: function keyFor(sym) {
817
+ if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');
818
+ for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;
819
+ },
820
+ useSetter: function () { setter = true; },
821
+ useSimple: function () { setter = false; }
822
+ });
823
+
824
+ $export($export.S + $export.F * !USE_NATIVE, 'Object', {
825
+ // 19.1.2.2 Object.create(O [, Properties])
826
+ create: $create,
827
+ // 19.1.2.4 Object.defineProperty(O, P, Attributes)
828
+ defineProperty: $defineProperty,
829
+ // 19.1.2.3 Object.defineProperties(O, Properties)
830
+ defineProperties: $defineProperties,
831
+ // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
832
+ getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
833
+ // 19.1.2.7 Object.getOwnPropertyNames(O)
834
+ getOwnPropertyNames: $getOwnPropertyNames,
835
+ // 19.1.2.8 Object.getOwnPropertySymbols(O)
836
+ getOwnPropertySymbols: $getOwnPropertySymbols
837
+ });
838
+
839
+ // 24.3.2 JSON.stringify(value [, replacer [, space]])
840
+ $JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {
841
+ var S = $Symbol();
842
+ // MS Edge converts symbol values to JSON as {}
843
+ // WebKit converts symbol values to JSON as null
844
+ // V8 throws on boxed symbols
845
+ return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';
846
+ })), 'JSON', {
847
+ stringify: function stringify(it) {
848
+ var args = [it];
849
+ var i = 1;
850
+ var replacer, $replacer;
851
+ while (arguments.length > i) args.push(arguments[i++]);
852
+ $replacer = replacer = args[1];
853
+ if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
854
+ if (!isArray(replacer)) replacer = function (key, value) {
855
+ if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
856
+ if (!isSymbol(value)) return value;
857
+ };
858
+ args[1] = replacer;
859
+ return _stringify.apply($JSON, args);
860
+ }
861
+ });
862
+
863
+ // 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)
864
+ $Symbol[PROTOTYPE][TO_PRIMITIVE] || require('./_hide')($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
865
+ // 19.4.3.5 Symbol.prototype[@@toStringTag]
866
+ setToStringTag($Symbol, 'Symbol');
867
+ // 20.2.1.9 Math[@@toStringTag]
868
+ setToStringTag(Math, 'Math', true);
869
+ // 24.3.3 JSON[@@toStringTag]
870
+ setToStringTag(global.JSON, 'JSON', true);
871
+
872
+ },{"./_an-object":3,"./_descriptors":10,"./_enum-keys":13,"./_export":14,"./_fails":15,"./_global":16,"./_has":17,"./_hide":18,"./_is-array":22,"./_is-object":23,"./_library":24,"./_meta":25,"./_object-create":26,"./_object-dp":27,"./_object-gopd":29,"./_object-gopn":31,"./_object-gopn-ext":30,"./_object-gops":32,"./_object-keys":34,"./_object-pie":35,"./_property-desc":36,"./_redefine":37,"./_set-to-string-tag":38,"./_shared":40,"./_to-iobject":43,"./_to-primitive":45,"./_uid":46,"./_wks":49,"./_wks-define":47,"./_wks-ext":48}],52:[function(require,module,exports){
2
873
  (function (global){
3
874
  /**
4
875
  * lodash (Custom Build) <https://lodash.com/>
@@ -933,7 +1804,7 @@ function get(object, path, defaultValue) {
933
1804
  module.exports = get;
934
1805
 
935
1806
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
936
- },{}],2:[function(require,module,exports){
1807
+ },{}],53:[function(require,module,exports){
937
1808
  (function (global){
938
1809
  /**
939
1810
  * Lodash (Custom Build) <https://lodash.com/>
@@ -2785,7 +3656,7 @@ function stubFalse() {
2785
3656
  module.exports = isEqual;
2786
3657
 
2787
3658
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
2788
- },{}],3:[function(require,module,exports){
3659
+ },{}],54:[function(require,module,exports){
2789
3660
  // shim for using process in browser
2790
3661
  var process = module.exports = {};
2791
3662
 
@@ -2971,7 +3842,7 @@ process.chdir = function (dir) {
2971
3842
  };
2972
3843
  process.umask = function() { return 0; };
2973
3844
 
2974
- },{}],4:[function(require,module,exports){
3845
+ },{}],55:[function(require,module,exports){
2975
3846
  'use strict';
2976
3847
 
2977
3848
  Object.defineProperty(exports, "__esModule", {
@@ -3022,6 +3893,10 @@ var _isIP = require('./lib/isIP');
3022
3893
 
3023
3894
  var _isIP2 = _interopRequireDefault(_isIP);
3024
3895
 
3896
+ var _isIPRange = require('./lib/isIPRange');
3897
+
3898
+ var _isIPRange2 = _interopRequireDefault(_isIPRange);
3899
+
3025
3900
  var _isFQDN = require('./lib/isFQDN');
3026
3901
 
3027
3902
  var _isFQDN2 = _interopRequireDefault(_isFQDN);
@@ -3114,6 +3989,10 @@ var _isHash = require('./lib/isHash');
3114
3989
 
3115
3990
  var _isHash2 = _interopRequireDefault(_isHash);
3116
3991
 
3992
+ var _isJWT = require('./lib/isJWT');
3993
+
3994
+ var _isJWT2 = _interopRequireDefault(_isJWT);
3995
+
3117
3996
  var _isJSON = require('./lib/isJSON');
3118
3997
 
3119
3998
  var _isJSON2 = _interopRequireDefault(_isJSON);
@@ -3198,6 +4077,10 @@ var _isDataURI = require('./lib/isDataURI');
3198
4077
 
3199
4078
  var _isDataURI2 = _interopRequireDefault(_isDataURI);
3200
4079
 
4080
+ var _isMagnetURI = require('./lib/isMagnetURI');
4081
+
4082
+ var _isMagnetURI2 = _interopRequireDefault(_isMagnetURI);
4083
+
3201
4084
  var _isMimeType = require('./lib/isMimeType');
3202
4085
 
3203
4086
  var _isMimeType2 = _interopRequireDefault(_isMimeType);
@@ -3256,7 +4139,7 @@ var _toString2 = _interopRequireDefault(_toString);
3256
4139
 
3257
4140
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3258
4141
 
3259
- var version = '10.2.0';
4142
+ var version = '10.7.1';
3260
4143
 
3261
4144
  var validator = {
3262
4145
  version: version,
@@ -3271,6 +4154,7 @@ var validator = {
3271
4154
  isURL: _isURL2.default,
3272
4155
  isMACAddress: _isMACAddress2.default,
3273
4156
  isIP: _isIP2.default,
4157
+ isIPRange: _isIPRange2.default,
3274
4158
  isFQDN: _isFQDN2.default,
3275
4159
  isBoolean: _isBoolean2.default,
3276
4160
  isAlpha: _isAlpha2.default,
@@ -3294,6 +4178,7 @@ var validator = {
3294
4178
  isISRC: _isISRC2.default,
3295
4179
  isMD5: _isMD2.default,
3296
4180
  isHash: _isHash2.default,
4181
+ isJWT: _isJWT2.default,
3297
4182
  isJSON: _isJSON2.default,
3298
4183
  isEmpty: _isEmpty2.default,
3299
4184
  isLength: _isLength2.default,
@@ -3317,6 +4202,7 @@ var validator = {
3317
4202
  isISO31661Alpha3: _isISO31661Alpha4.default,
3318
4203
  isBase64: _isBase2.default,
3319
4204
  isDataURI: _isDataURI2.default,
4205
+ isMagnetURI: _isMagnetURI2.default,
3320
4206
  isMimeType: _isMimeType2.default,
3321
4207
  isLatLong: _isLatLong2.default,
3322
4208
  ltrim: _ltrim2.default,
@@ -3334,7 +4220,7 @@ var validator = {
3334
4220
 
3335
4221
  exports.default = validator;
3336
4222
  module.exports = exports['default'];
3337
- },{"./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/isISO31661Alpha3":36,"./lib/isISO8601":37,"./lib/isISRC":38,"./lib/isISSN":39,"./lib/isIn":40,"./lib/isInt":41,"./lib/isJSON":42,"./lib/isLatLong":43,"./lib/isLength":44,"./lib/isLowercase":45,"./lib/isMACAddress":46,"./lib/isMD5":47,"./lib/isMimeType":48,"./lib/isMobilePhone":49,"./lib/isMongoId":50,"./lib/isMultibyte":51,"./lib/isNumeric":52,"./lib/isPort":53,"./lib/isPostalCode":54,"./lib/isRFC3339":55,"./lib/isSurrogatePair":56,"./lib/isURL":57,"./lib/isUUID":58,"./lib/isUppercase":59,"./lib/isVariableWidth":60,"./lib/isWhitelisted":61,"./lib/ltrim":62,"./lib/matches":63,"./lib/normalizeEmail":64,"./lib/rtrim":65,"./lib/stripLow":66,"./lib/toBoolean":67,"./lib/toDate":68,"./lib/toFloat":69,"./lib/toInt":70,"./lib/trim":71,"./lib/unescape":72,"./lib/util/toString":75,"./lib/whitelist":76}],5:[function(require,module,exports){
4223
+ },{"./lib/blacklist":57,"./lib/contains":58,"./lib/equals":59,"./lib/escape":60,"./lib/isAfter":61,"./lib/isAlpha":62,"./lib/isAlphanumeric":63,"./lib/isAscii":64,"./lib/isBase64":65,"./lib/isBefore":66,"./lib/isBoolean":67,"./lib/isByteLength":68,"./lib/isCreditCard":69,"./lib/isCurrency":70,"./lib/isDataURI":71,"./lib/isDecimal":72,"./lib/isDivisibleBy":73,"./lib/isEmail":74,"./lib/isEmpty":75,"./lib/isFQDN":76,"./lib/isFloat":77,"./lib/isFullWidth":78,"./lib/isHalfWidth":79,"./lib/isHash":80,"./lib/isHexColor":81,"./lib/isHexadecimal":82,"./lib/isIP":83,"./lib/isIPRange":84,"./lib/isISBN":85,"./lib/isISIN":86,"./lib/isISO31661Alpha2":87,"./lib/isISO31661Alpha3":88,"./lib/isISO8601":89,"./lib/isISRC":90,"./lib/isISSN":91,"./lib/isIn":92,"./lib/isInt":93,"./lib/isJSON":94,"./lib/isJWT":95,"./lib/isLatLong":96,"./lib/isLength":97,"./lib/isLowercase":98,"./lib/isMACAddress":99,"./lib/isMD5":100,"./lib/isMagnetURI":101,"./lib/isMimeType":102,"./lib/isMobilePhone":103,"./lib/isMongoId":104,"./lib/isMultibyte":105,"./lib/isNumeric":106,"./lib/isPort":107,"./lib/isPostalCode":108,"./lib/isRFC3339":109,"./lib/isSurrogatePair":110,"./lib/isURL":111,"./lib/isUUID":112,"./lib/isUppercase":113,"./lib/isVariableWidth":114,"./lib/isWhitelisted":115,"./lib/ltrim":116,"./lib/matches":117,"./lib/normalizeEmail":118,"./lib/rtrim":119,"./lib/stripLow":120,"./lib/toBoolean":121,"./lib/toDate":122,"./lib/toFloat":123,"./lib/toInt":124,"./lib/trim":125,"./lib/unescape":126,"./lib/util/toString":130,"./lib/whitelist":131}],56:[function(require,module,exports){
3338
4224
  'use strict';
3339
4225
 
3340
4226
  Object.defineProperty(exports, "__esModule", {
@@ -3363,6 +4249,7 @@ var alpha = exports.alpha = {
3363
4249
  'sv-SE': /^[A-ZÅÄÖ]+$/i,
3364
4250
  'tr-TR': /^[A-ZÇĞİıÖŞÜ]+$/i,
3365
4251
  'uk-UA': /^[А-ЩЬЮЯЄIЇҐі]+$/i,
4252
+ 'ku-IQ': /^[ئابپتجچحخدرڕزژسشعغفڤقکگلڵمنوۆھەیێيطؤثآإأكضصةظذ]+$/i,
3366
4253
  ar: /^[ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/
3367
4254
  };
3368
4255
 
@@ -3389,6 +4276,7 @@ var alphanumeric = exports.alphanumeric = {
3389
4276
  'sv-SE': /^[0-9A-ZÅÄÖ]+$/i,
3390
4277
  'tr-TR': /^[0-9A-ZÇĞİıÖŞÜ]+$/i,
3391
4278
  'uk-UA': /^[0-9А-ЩЬЮЯЄIЇҐі]+$/i,
4279
+ 'ku-IQ': /^[٠١٢٣٤٥٦٧٨٩0-9ئابپتجچحخدرڕزژسشعغفڤقکگلڵمنوۆھەیێيطؤثآإأكضصةظذ]+$/i,
3392
4280
  ar: /^[٠١٢٣٤٥٦٧٨٩0-9ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/
3393
4281
  };
3394
4282
 
@@ -3418,7 +4306,7 @@ for (var _locale, _i = 0; _i < arabicLocales.length; _i++) {
3418
4306
 
3419
4307
  // Source: https://en.wikipedia.org/wiki/Decimal_mark
3420
4308
  var dotDecimal = exports.dotDecimal = [];
3421
- var commaDecimal = exports.commaDecimal = ['bg-BG', 'cs-CZ', 'da-DK', 'de-DE', 'el-GR', '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'];
4309
+ var commaDecimal = exports.commaDecimal = ['bg-BG', 'cs-CZ', 'da-DK', 'de-DE', 'el-GR', 'es-ES', 'fr-FR', 'it-IT', 'ku-IQ', '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'];
3422
4310
 
3423
4311
  for (var _i2 = 0; _i2 < dotDecimal.length; _i2++) {
3424
4312
  decimal[dotDecimal[_i2]] = decimal['en-US'];
@@ -3431,7 +4319,12 @@ for (var _i3 = 0; _i3 < commaDecimal.length; _i3++) {
3431
4319
  alpha['pt-BR'] = alpha['pt-PT'];
3432
4320
  alphanumeric['pt-BR'] = alphanumeric['pt-PT'];
3433
4321
  decimal['pt-BR'] = decimal['pt-PT'];
3434
- },{}],6:[function(require,module,exports){
4322
+
4323
+ // see #862
4324
+ alpha['pl-Pl'] = alpha['pl-PL'];
4325
+ alphanumeric['pl-Pl'] = alphanumeric['pl-PL'];
4326
+ decimal['pl-Pl'] = decimal['pl-PL'];
4327
+ },{}],57:[function(require,module,exports){
3435
4328
  'use strict';
3436
4329
 
3437
4330
  Object.defineProperty(exports, "__esModule", {
@@ -3450,7 +4343,7 @@ function blacklist(str, chars) {
3450
4343
  return str.replace(new RegExp('[' + chars + ']+', 'g'), '');
3451
4344
  }
3452
4345
  module.exports = exports['default'];
3453
- },{"./util/assertString":73}],7:[function(require,module,exports){
4346
+ },{"./util/assertString":127}],58:[function(require,module,exports){
3454
4347
  'use strict';
3455
4348
 
3456
4349
  Object.defineProperty(exports, "__esModule", {
@@ -3473,7 +4366,7 @@ function contains(str, elem) {
3473
4366
  return str.indexOf((0, _toString2.default)(elem)) >= 0;
3474
4367
  }
3475
4368
  module.exports = exports['default'];
3476
- },{"./util/assertString":73,"./util/toString":75}],8:[function(require,module,exports){
4369
+ },{"./util/assertString":127,"./util/toString":130}],59:[function(require,module,exports){
3477
4370
  'use strict';
3478
4371
 
3479
4372
  Object.defineProperty(exports, "__esModule", {
@@ -3492,7 +4385,7 @@ function equals(str, comparison) {
3492
4385
  return str === comparison;
3493
4386
  }
3494
4387
  module.exports = exports['default'];
3495
- },{"./util/assertString":73}],9:[function(require,module,exports){
4388
+ },{"./util/assertString":127}],60:[function(require,module,exports){
3496
4389
  'use strict';
3497
4390
 
3498
4391
  Object.defineProperty(exports, "__esModule", {
@@ -3511,7 +4404,7 @@ function escape(str) {
3511
4404
  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;');
3512
4405
  }
3513
4406
  module.exports = exports['default'];
3514
- },{"./util/assertString":73}],10:[function(require,module,exports){
4407
+ },{"./util/assertString":127}],61:[function(require,module,exports){
3515
4408
  'use strict';
3516
4409
 
3517
4410
  Object.defineProperty(exports, "__esModule", {
@@ -3538,7 +4431,7 @@ function isAfter(str) {
3538
4431
  return !!(original && comparison && original > comparison);
3539
4432
  }
3540
4433
  module.exports = exports['default'];
3541
- },{"./toDate":68,"./util/assertString":73}],11:[function(require,module,exports){
4434
+ },{"./toDate":122,"./util/assertString":127}],62:[function(require,module,exports){
3542
4435
  'use strict';
3543
4436
 
3544
4437
  Object.defineProperty(exports, "__esModule", {
@@ -3564,7 +4457,7 @@ function isAlpha(str) {
3564
4457
  throw new Error('Invalid locale \'' + locale + '\'');
3565
4458
  }
3566
4459
  module.exports = exports['default'];
3567
- },{"./alpha":5,"./util/assertString":73}],12:[function(require,module,exports){
4460
+ },{"./alpha":56,"./util/assertString":127}],63:[function(require,module,exports){
3568
4461
  'use strict';
3569
4462
 
3570
4463
  Object.defineProperty(exports, "__esModule", {
@@ -3590,7 +4483,7 @@ function isAlphanumeric(str) {
3590
4483
  throw new Error('Invalid locale \'' + locale + '\'');
3591
4484
  }
3592
4485
  module.exports = exports['default'];
3593
- },{"./alpha":5,"./util/assertString":73}],13:[function(require,module,exports){
4486
+ },{"./alpha":56,"./util/assertString":127}],64:[function(require,module,exports){
3594
4487
  'use strict';
3595
4488
 
3596
4489
  Object.defineProperty(exports, "__esModule", {
@@ -3613,7 +4506,7 @@ function isAscii(str) {
3613
4506
  return ascii.test(str);
3614
4507
  }
3615
4508
  module.exports = exports['default'];
3616
- },{"./util/assertString":73}],14:[function(require,module,exports){
4509
+ },{"./util/assertString":127}],65:[function(require,module,exports){
3617
4510
  'use strict';
3618
4511
 
3619
4512
  Object.defineProperty(exports, "__esModule", {
@@ -3639,7 +4532,7 @@ function isBase64(str) {
3639
4532
  return firstPaddingChar === -1 || firstPaddingChar === len - 1 || firstPaddingChar === len - 2 && str[len - 1] === '=';
3640
4533
  }
3641
4534
  module.exports = exports['default'];
3642
- },{"./util/assertString":73}],15:[function(require,module,exports){
4535
+ },{"./util/assertString":127}],66:[function(require,module,exports){
3643
4536
  'use strict';
3644
4537
 
3645
4538
  Object.defineProperty(exports, "__esModule", {
@@ -3666,7 +4559,7 @@ function isBefore(str) {
3666
4559
  return !!(original && comparison && original < comparison);
3667
4560
  }
3668
4561
  module.exports = exports['default'];
3669
- },{"./toDate":68,"./util/assertString":73}],16:[function(require,module,exports){
4562
+ },{"./toDate":122,"./util/assertString":127}],67:[function(require,module,exports){
3670
4563
  'use strict';
3671
4564
 
3672
4565
  Object.defineProperty(exports, "__esModule", {
@@ -3685,7 +4578,7 @@ function isBoolean(str) {
3685
4578
  return ['true', 'false', '1', '0'].indexOf(str) >= 0;
3686
4579
  }
3687
4580
  module.exports = exports['default'];
3688
- },{"./util/assertString":73}],17:[function(require,module,exports){
4581
+ },{"./util/assertString":127}],68:[function(require,module,exports){
3689
4582
  'use strict';
3690
4583
 
3691
4584
  Object.defineProperty(exports, "__esModule", {
@@ -3719,7 +4612,7 @@ function isByteLength(str, options) {
3719
4612
  return len >= min && (typeof max === 'undefined' || len <= max);
3720
4613
  }
3721
4614
  module.exports = exports['default'];
3722
- },{"./util/assertString":73}],18:[function(require,module,exports){
4615
+ },{"./util/assertString":127}],69:[function(require,module,exports){
3723
4616
  'use strict';
3724
4617
 
3725
4618
  Object.defineProperty(exports, "__esModule", {
@@ -3765,7 +4658,7 @@ function isCreditCard(str) {
3765
4658
  return !!(sum % 10 === 0 ? sanitized : false);
3766
4659
  }
3767
4660
  module.exports = exports['default'];
3768
- },{"./util/assertString":73}],19:[function(require,module,exports){
4661
+ },{"./util/assertString":127}],70:[function(require,module,exports){
3769
4662
  'use strict';
3770
4663
 
3771
4664
  Object.defineProperty(exports, "__esModule", {
@@ -3858,7 +4751,7 @@ function isCurrency(str, options) {
3858
4751
  return currencyRegex(options).test(str);
3859
4752
  }
3860
4753
  module.exports = exports['default'];
3861
- },{"./util/assertString":73,"./util/merge":74}],20:[function(require,module,exports){
4754
+ },{"./util/assertString":127,"./util/merge":129}],71:[function(require,module,exports){
3862
4755
  'use strict';
3863
4756
 
3864
4757
  Object.defineProperty(exports, "__esModule", {
@@ -3908,7 +4801,7 @@ function isDataURI(str) {
3908
4801
  return true;
3909
4802
  }
3910
4803
  module.exports = exports['default'];
3911
- },{"./util/assertString":73}],21:[function(require,module,exports){
4804
+ },{"./util/assertString":127}],72:[function(require,module,exports){
3912
4805
  'use strict';
3913
4806
 
3914
4807
  Object.defineProperty(exports, "__esModule", {
@@ -3924,6 +4817,10 @@ var _assertString = require('./util/assertString');
3924
4817
 
3925
4818
  var _assertString2 = _interopRequireDefault(_assertString);
3926
4819
 
4820
+ var _includes = require('./util/includes');
4821
+
4822
+ var _includes2 = _interopRequireDefault(_includes);
4823
+
3927
4824
  var _alpha = require('./alpha');
3928
4825
 
3929
4826
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -3945,12 +4842,12 @@ function isDecimal(str, options) {
3945
4842
  (0, _assertString2.default)(str);
3946
4843
  options = (0, _merge2.default)(options, default_decimal_options);
3947
4844
  if (options.locale in _alpha.decimal) {
3948
- return !blacklist.includes(str.replace(/ /g, '')) && decimalRegExp(options).test(str);
4845
+ return !(0, _includes2.default)(blacklist, str.replace(/ /g, '')) && decimalRegExp(options).test(str);
3949
4846
  }
3950
4847
  throw new Error('Invalid locale \'' + options.locale + '\'');
3951
4848
  }
3952
4849
  module.exports = exports['default'];
3953
- },{"./alpha":5,"./util/assertString":73,"./util/merge":74}],22:[function(require,module,exports){
4850
+ },{"./alpha":56,"./util/assertString":127,"./util/includes":128,"./util/merge":129}],73:[function(require,module,exports){
3954
4851
  'use strict';
3955
4852
 
3956
4853
  Object.defineProperty(exports, "__esModule", {
@@ -3973,7 +4870,7 @@ function isDivisibleBy(str, num) {
3973
4870
  return (0, _toFloat2.default)(str) % parseInt(num, 10) === 0;
3974
4871
  }
3975
4872
  module.exports = exports['default'];
3976
- },{"./toFloat":69,"./util/assertString":73}],23:[function(require,module,exports){
4873
+ },{"./toFloat":123,"./util/assertString":127}],74:[function(require,module,exports){
3977
4874
  'use strict';
3978
4875
 
3979
4876
  Object.defineProperty(exports, "__esModule", {
@@ -3997,6 +4894,10 @@ var _isFQDN = require('./isFQDN');
3997
4894
 
3998
4895
  var _isFQDN2 = _interopRequireDefault(_isFQDN);
3999
4896
 
4897
+ var _isIP = require('./isIP');
4898
+
4899
+ var _isIP2 = _interopRequireDefault(_isIP);
4900
+
4000
4901
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
4001
4902
 
4002
4903
  var default_email_options = {
@@ -4010,6 +4911,7 @@ var default_email_options = {
4010
4911
  /* eslint-disable no-control-regex */
4011
4912
  var displayName = /^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\.\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\,\.\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF\s]*<(.+)>$/i;
4012
4913
  var emailUserPart = /^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i;
4914
+ var gmailUserPart = /^[a-z\d]+$/;
4013
4915
  var quotedEmailUser = /^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i;
4014
4916
  var emailUserUtf8Part = /^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i;
4015
4917
  var quotedEmailUserUtf8 = /^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i;
@@ -4035,7 +4937,7 @@ function isEmail(str, options) {
4035
4937
 
4036
4938
  var lower_domain = domain.toLowerCase();
4037
4939
 
4038
- if (lower_domain === 'gmail.com' || lower_domain === 'googlemail.com') {
4940
+ if (options.domain_specific_validation && (lower_domain === 'gmail.com' || lower_domain === 'googlemail.com')) {
4039
4941
  /*
4040
4942
  Previously we removed dots for gmail addresses before validating.
4041
4943
  This was removed because it allows `multiple..dots@gmail.com`
@@ -4044,6 +4946,21 @@ function isEmail(str, options) {
4044
4946
  should be done in normalizeEmail
4045
4947
  */
4046
4948
  user = user.toLowerCase();
4949
+
4950
+ // Removing sub-address from username before gmail validation
4951
+ var username = user.split('+')[0];
4952
+
4953
+ // Dots are not included in gmail length restriction
4954
+ if (!(0, _isByteLength2.default)(username.replace('.', ''), { min: 6, max: 30 })) {
4955
+ return false;
4956
+ }
4957
+
4958
+ var _user_parts = username.split('.');
4959
+ for (var i = 0; i < _user_parts.length; i++) {
4960
+ if (!gmailUserPart.test(_user_parts[i])) {
4961
+ return false;
4962
+ }
4963
+ }
4047
4964
  }
4048
4965
 
4049
4966
  if (!(0, _isByteLength2.default)(user, { max: 64 }) || !(0, _isByteLength2.default)(domain, { max: 254 })) {
@@ -4051,7 +4968,21 @@ function isEmail(str, options) {
4051
4968
  }
4052
4969
 
4053
4970
  if (!(0, _isFQDN2.default)(domain, { require_tld: options.require_tld })) {
4054
- return false;
4971
+ if (!options.allow_ip_domain) {
4972
+ return false;
4973
+ }
4974
+
4975
+ if (!(0, _isIP2.default)(domain)) {
4976
+ if (!domain.startsWith('[') || !domain.endsWith(']')) {
4977
+ return false;
4978
+ }
4979
+
4980
+ var noBracketdomain = domain.substr(1, domain.length - 2);
4981
+
4982
+ if (noBracketdomain.length === 0 || !(0, _isIP2.default)(noBracketdomain)) {
4983
+ return false;
4984
+ }
4985
+ }
4055
4986
  }
4056
4987
 
4057
4988
  if (user[0] === '"') {
@@ -4062,8 +4993,8 @@ function isEmail(str, options) {
4062
4993
  var pattern = options.allow_utf8_local_part ? emailUserUtf8Part : emailUserPart;
4063
4994
 
4064
4995
  var user_parts = user.split('.');
4065
- for (var i = 0; i < user_parts.length; i++) {
4066
- if (!pattern.test(user_parts[i])) {
4996
+ for (var _i = 0; _i < user_parts.length; _i++) {
4997
+ if (!pattern.test(user_parts[_i])) {
4067
4998
  return false;
4068
4999
  }
4069
5000
  }
@@ -4071,7 +5002,7 @@ function isEmail(str, options) {
4071
5002
  return true;
4072
5003
  }
4073
5004
  module.exports = exports['default'];
4074
- },{"./isByteLength":17,"./isFQDN":25,"./util/assertString":73,"./util/merge":74}],24:[function(require,module,exports){
5005
+ },{"./isByteLength":68,"./isFQDN":76,"./isIP":83,"./util/assertString":127,"./util/merge":129}],75:[function(require,module,exports){
4075
5006
  'use strict';
4076
5007
 
4077
5008
  Object.defineProperty(exports, "__esModule", {
@@ -4083,14 +5014,24 @@ var _assertString = require('./util/assertString');
4083
5014
 
4084
5015
  var _assertString2 = _interopRequireDefault(_assertString);
4085
5016
 
5017
+ var _merge = require('./util/merge');
5018
+
5019
+ var _merge2 = _interopRequireDefault(_merge);
5020
+
4086
5021
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
4087
5022
 
4088
- function isEmpty(str) {
5023
+ var default_is_empty_options = {
5024
+ ignore_whitespace: false
5025
+ };
5026
+
5027
+ function isEmpty(str, options) {
4089
5028
  (0, _assertString2.default)(str);
4090
- return str.length === 0;
5029
+ options = (0, _merge2.default)(options, default_is_empty_options);
5030
+
5031
+ return (options.ignore_whitespace ? str.trim().length : str.length) === 0;
4091
5032
  }
4092
5033
  module.exports = exports['default'];
4093
- },{"./util/assertString":73}],25:[function(require,module,exports){
5034
+ },{"./util/assertString":127,"./util/merge":129}],76:[function(require,module,exports){
4094
5035
  'use strict';
4095
5036
 
4096
5037
  Object.defineProperty(exports, "__esModule", {
@@ -4157,7 +5098,7 @@ function isFQDN(str, options) {
4157
5098
  return true;
4158
5099
  }
4159
5100
  module.exports = exports['default'];
4160
- },{"./util/assertString":73,"./util/merge":74}],26:[function(require,module,exports){
5101
+ },{"./util/assertString":127,"./util/merge":129}],77:[function(require,module,exports){
4161
5102
  'use strict';
4162
5103
 
4163
5104
  Object.defineProperty(exports, "__esModule", {
@@ -4184,7 +5125,7 @@ function isFloat(str, options) {
4184
5125
  return float.test(str) && (!options.hasOwnProperty('min') || value >= options.min) && (!options.hasOwnProperty('max') || value <= options.max) && (!options.hasOwnProperty('lt') || value < options.lt) && (!options.hasOwnProperty('gt') || value > options.gt);
4185
5126
  }
4186
5127
  module.exports = exports['default'];
4187
- },{"./alpha":5,"./util/assertString":73}],27:[function(require,module,exports){
5128
+ },{"./alpha":56,"./util/assertString":127}],78:[function(require,module,exports){
4188
5129
  'use strict';
4189
5130
 
4190
5131
  Object.defineProperty(exports, "__esModule", {
@@ -4205,7 +5146,7 @@ function isFullWidth(str) {
4205
5146
  (0, _assertString2.default)(str);
4206
5147
  return fullWidth.test(str);
4207
5148
  }
4208
- },{"./util/assertString":73}],28:[function(require,module,exports){
5149
+ },{"./util/assertString":127}],79:[function(require,module,exports){
4209
5150
  'use strict';
4210
5151
 
4211
5152
  Object.defineProperty(exports, "__esModule", {
@@ -4226,7 +5167,7 @@ function isHalfWidth(str) {
4226
5167
  (0, _assertString2.default)(str);
4227
5168
  return halfWidth.test(str);
4228
5169
  }
4229
- },{"./util/assertString":73}],29:[function(require,module,exports){
5170
+ },{"./util/assertString":127}],80:[function(require,module,exports){
4230
5171
  'use strict';
4231
5172
 
4232
5173
  Object.defineProperty(exports, "__esModule", {
@@ -4262,7 +5203,7 @@ function isHash(str, algorithm) {
4262
5203
  return hash.test(str);
4263
5204
  }
4264
5205
  module.exports = exports['default'];
4265
- },{"./util/assertString":73}],30:[function(require,module,exports){
5206
+ },{"./util/assertString":127}],81:[function(require,module,exports){
4266
5207
  'use strict';
4267
5208
 
4268
5209
  Object.defineProperty(exports, "__esModule", {
@@ -4283,7 +5224,7 @@ function isHexColor(str) {
4283
5224
  return hexcolor.test(str);
4284
5225
  }
4285
5226
  module.exports = exports['default'];
4286
- },{"./util/assertString":73}],31:[function(require,module,exports){
5227
+ },{"./util/assertString":127}],82:[function(require,module,exports){
4287
5228
  'use strict';
4288
5229
 
4289
5230
  Object.defineProperty(exports, "__esModule", {
@@ -4304,7 +5245,7 @@ function isHexadecimal(str) {
4304
5245
  return hexadecimal.test(str);
4305
5246
  }
4306
5247
  module.exports = exports['default'];
4307
- },{"./util/assertString":73}],32:[function(require,module,exports){
5248
+ },{"./util/assertString":127}],83:[function(require,module,exports){
4308
5249
  'use strict';
4309
5250
 
4310
5251
  Object.defineProperty(exports, "__esModule", {
@@ -4386,7 +5327,48 @@ function isIP(str) {
4386
5327
  return false;
4387
5328
  }
4388
5329
  module.exports = exports['default'];
4389
- },{"./util/assertString":73}],33:[function(require,module,exports){
5330
+ },{"./util/assertString":127}],84:[function(require,module,exports){
5331
+ 'use strict';
5332
+
5333
+ Object.defineProperty(exports, "__esModule", {
5334
+ value: true
5335
+ });
5336
+ exports.default = isIPRange;
5337
+
5338
+ var _assertString = require('./util/assertString');
5339
+
5340
+ var _assertString2 = _interopRequireDefault(_assertString);
5341
+
5342
+ var _isIP = require('./isIP');
5343
+
5344
+ var _isIP2 = _interopRequireDefault(_isIP);
5345
+
5346
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
5347
+
5348
+ var subnetMaybe = /^\d{1,2}$/;
5349
+
5350
+ function isIPRange(str) {
5351
+ (0, _assertString2.default)(str);
5352
+ var parts = str.split('/');
5353
+
5354
+ // parts[0] -> ip, parts[1] -> subnet
5355
+ if (parts.length !== 2) {
5356
+ return false;
5357
+ }
5358
+
5359
+ if (!subnetMaybe.test(parts[1])) {
5360
+ return false;
5361
+ }
5362
+
5363
+ // Disallow preceding 0 i.e. 01, 02, ...
5364
+ if (parts[1].length > 1 && parts[1].startsWith('0')) {
5365
+ return false;
5366
+ }
5367
+
5368
+ return (0, _isIP2.default)(parts[0], 4) && parts[1] <= 32 && parts[1] >= 0;
5369
+ }
5370
+ module.exports = exports['default'];
5371
+ },{"./isIP":83,"./util/assertString":127}],85:[function(require,module,exports){
4390
5372
  'use strict';
4391
5373
 
4392
5374
  Object.defineProperty(exports, "__esModule", {
@@ -4444,7 +5426,7 @@ function isISBN(str) {
4444
5426
  return false;
4445
5427
  }
4446
5428
  module.exports = exports['default'];
4447
- },{"./util/assertString":73}],34:[function(require,module,exports){
5429
+ },{"./util/assertString":127}],86:[function(require,module,exports){
4448
5430
  'use strict';
4449
5431
 
4450
5432
  Object.defineProperty(exports, "__esModule", {
@@ -4493,7 +5475,7 @@ function isISIN(str) {
4493
5475
  return parseInt(str.substr(str.length - 1), 10) === (10000 - sum) % 10;
4494
5476
  }
4495
5477
  module.exports = exports['default'];
4496
- },{"./util/assertString":73}],35:[function(require,module,exports){
5478
+ },{"./util/assertString":127}],87:[function(require,module,exports){
4497
5479
  'use strict';
4498
5480
 
4499
5481
  Object.defineProperty(exports, "__esModule", {
@@ -4505,6 +5487,10 @@ var _assertString = require('./util/assertString');
4505
5487
 
4506
5488
  var _assertString2 = _interopRequireDefault(_assertString);
4507
5489
 
5490
+ var _includes = require('./util/includes');
5491
+
5492
+ var _includes2 = _interopRequireDefault(_includes);
5493
+
4508
5494
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
4509
5495
 
4510
5496
  // from https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
@@ -4512,10 +5498,10 @@ var validISO31661Alpha2CountriesCodes = ['AD', 'AE', 'AF', 'AG', 'AI', 'AL', 'AM
4512
5498
 
4513
5499
  function isISO31661Alpha2(str) {
4514
5500
  (0, _assertString2.default)(str);
4515
- return validISO31661Alpha2CountriesCodes.includes(str.toUpperCase());
5501
+ return (0, _includes2.default)(validISO31661Alpha2CountriesCodes, str.toUpperCase());
4516
5502
  }
4517
5503
  module.exports = exports['default'];
4518
- },{"./util/assertString":73}],36:[function(require,module,exports){
5504
+ },{"./util/assertString":127,"./util/includes":128}],88:[function(require,module,exports){
4519
5505
  'use strict';
4520
5506
 
4521
5507
  Object.defineProperty(exports, "__esModule", {
@@ -4527,6 +5513,10 @@ var _assertString = require('./util/assertString');
4527
5513
 
4528
5514
  var _assertString2 = _interopRequireDefault(_assertString);
4529
5515
 
5516
+ var _includes = require('./util/includes');
5517
+
5518
+ var _includes2 = _interopRequireDefault(_includes);
5519
+
4530
5520
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
4531
5521
 
4532
5522
  // from https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3
@@ -4534,10 +5524,10 @@ var validISO31661Alpha3CountriesCodes = ['AFG', 'ALA', 'ALB', 'DZA', 'ASM', 'AND
4534
5524
 
4535
5525
  function isISO31661Alpha3(str) {
4536
5526
  (0, _assertString2.default)(str);
4537
- return validISO31661Alpha3CountriesCodes.includes(str.toUpperCase());
5527
+ return (0, _includes2.default)(validISO31661Alpha3CountriesCodes, str.toUpperCase());
4538
5528
  }
4539
5529
  module.exports = exports['default'];
4540
- },{"./util/assertString":73}],37:[function(require,module,exports){
5530
+ },{"./util/assertString":127,"./util/includes":128}],89:[function(require,module,exports){
4541
5531
  'use strict';
4542
5532
 
4543
5533
  Object.defineProperty(exports, "__esModule", {
@@ -4561,7 +5551,7 @@ function isISO8601(str) {
4561
5551
  return iso8601.test(str);
4562
5552
  }
4563
5553
  module.exports = exports['default'];
4564
- },{"./util/assertString":73}],38:[function(require,module,exports){
5554
+ },{"./util/assertString":127}],90:[function(require,module,exports){
4565
5555
  'use strict';
4566
5556
 
4567
5557
  Object.defineProperty(exports, "__esModule", {
@@ -4583,7 +5573,7 @@ function isISRC(str) {
4583
5573
  return isrc.test(str);
4584
5574
  }
4585
5575
  module.exports = exports['default'];
4586
- },{"./util/assertString":73}],39:[function(require,module,exports){
5576
+ },{"./util/assertString":127}],91:[function(require,module,exports){
4587
5577
  'use strict';
4588
5578
 
4589
5579
  Object.defineProperty(exports, "__esModule", {
@@ -4609,40 +5599,16 @@ function isISSN(str) {
4609
5599
  if (!testIssn.test(str)) {
4610
5600
  return false;
4611
5601
  }
4612
- var issnDigits = str.replace('-', '');
4613
- var position = 8;
5602
+ var digits = str.replace('-', '').toUpperCase();
4614
5603
  var checksum = 0;
4615
- var _iteratorNormalCompletion = true;
4616
- var _didIteratorError = false;
4617
- var _iteratorError = undefined;
4618
-
4619
- try {
4620
- for (var _iterator = issnDigits[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
4621
- var digit = _step.value;
4622
-
4623
- var digitValue = digit.toUpperCase() === 'X' ? 10 : +digit;
4624
- checksum += digitValue * position;
4625
- --position;
4626
- }
4627
- } catch (err) {
4628
- _didIteratorError = true;
4629
- _iteratorError = err;
4630
- } finally {
4631
- try {
4632
- if (!_iteratorNormalCompletion && _iterator.return) {
4633
- _iterator.return();
4634
- }
4635
- } finally {
4636
- if (_didIteratorError) {
4637
- throw _iteratorError;
4638
- }
4639
- }
5604
+ for (var i = 0; i < digits.length; i++) {
5605
+ var digit = digits[i];
5606
+ checksum += (digit === 'X' ? 10 : +digit) * (8 - i);
4640
5607
  }
4641
-
4642
5608
  return checksum % 11 === 0;
4643
5609
  }
4644
5610
  module.exports = exports['default'];
4645
- },{"./util/assertString":73}],40:[function(require,module,exports){
5611
+ },{"./util/assertString":127}],92:[function(require,module,exports){
4646
5612
  'use strict';
4647
5613
 
4648
5614
  Object.defineProperty(exports, "__esModule", {
@@ -4682,7 +5648,7 @@ function isIn(str, options) {
4682
5648
  return false;
4683
5649
  }
4684
5650
  module.exports = exports['default'];
4685
- },{"./util/assertString":73,"./util/toString":75}],41:[function(require,module,exports){
5651
+ },{"./util/assertString":127,"./util/toString":130}],93:[function(require,module,exports){
4686
5652
  'use strict';
4687
5653
 
4688
5654
  Object.defineProperty(exports, "__esModule", {
@@ -4716,7 +5682,7 @@ function isInt(str, options) {
4716
5682
  return regex.test(str) && minCheckPassed && maxCheckPassed && ltCheckPassed && gtCheckPassed;
4717
5683
  }
4718
5684
  module.exports = exports['default'];
4719
- },{"./util/assertString":73}],42:[function(require,module,exports){
5685
+ },{"./util/assertString":127}],94:[function(require,module,exports){
4720
5686
  'use strict';
4721
5687
 
4722
5688
  Object.defineProperty(exports, "__esModule", {
@@ -4742,7 +5708,28 @@ function isJSON(str) {
4742
5708
  return false;
4743
5709
  }
4744
5710
  module.exports = exports['default'];
4745
- },{"./util/assertString":73}],43:[function(require,module,exports){
5711
+ },{"./util/assertString":127}],95:[function(require,module,exports){
5712
+ 'use strict';
5713
+
5714
+ Object.defineProperty(exports, "__esModule", {
5715
+ value: true
5716
+ });
5717
+ exports.default = isJWT;
5718
+
5719
+ var _assertString = require('./util/assertString');
5720
+
5721
+ var _assertString2 = _interopRequireDefault(_assertString);
5722
+
5723
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
5724
+
5725
+ var jwt = /^[a-zA-Z0-9\-_]+\.[a-zA-Z0-9\-_]+\.[a-zA-Z0-9\-_]+$/;
5726
+
5727
+ function isJWT(str) {
5728
+ (0, _assertString2.default)(str);
5729
+ return jwt.test(str);
5730
+ }
5731
+ module.exports = exports['default'];
5732
+ },{"./util/assertString":127}],96:[function(require,module,exports){
4746
5733
  'use strict';
4747
5734
 
4748
5735
  Object.defineProperty(exports, "__esModule", {
@@ -4766,7 +5753,7 @@ var lat = /^\(?[+-]?(90(\.0+)?|[1-8]?\d(\.\d+)?)$/;
4766
5753
  var long = /^\s?[+-]?(180(\.0+)?|1[0-7]\d(\.\d+)?|\d{1,2}(\.\d+)?)\)?$/;
4767
5754
 
4768
5755
  module.exports = exports['default'];
4769
- },{"./util/assertString":73}],44:[function(require,module,exports){
5756
+ },{"./util/assertString":127}],97:[function(require,module,exports){
4770
5757
  'use strict';
4771
5758
 
4772
5759
  Object.defineProperty(exports, "__esModule", {
@@ -4801,7 +5788,7 @@ function isLength(str, options) {
4801
5788
  return len >= min && (typeof max === 'undefined' || len <= max);
4802
5789
  }
4803
5790
  module.exports = exports['default'];
4804
- },{"./util/assertString":73}],45:[function(require,module,exports){
5791
+ },{"./util/assertString":127}],98:[function(require,module,exports){
4805
5792
  'use strict';
4806
5793
 
4807
5794
  Object.defineProperty(exports, "__esModule", {
@@ -4820,7 +5807,7 @@ function isLowercase(str) {
4820
5807
  return str === str.toLowerCase();
4821
5808
  }
4822
5809
  module.exports = exports['default'];
4823
- },{"./util/assertString":73}],46:[function(require,module,exports){
5810
+ },{"./util/assertString":127}],99:[function(require,module,exports){
4824
5811
  'use strict';
4825
5812
 
4826
5813
  Object.defineProperty(exports, "__esModule", {
@@ -4835,13 +5822,17 @@ var _assertString2 = _interopRequireDefault(_assertString);
4835
5822
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
4836
5823
 
4837
5824
  var macAddress = /^([0-9a-fA-F][0-9a-fA-F]:){5}([0-9a-fA-F][0-9a-fA-F])$/;
5825
+ var macAddressNoColons = /^([0-9a-fA-F]){12}$/;
4838
5826
 
4839
- function isMACAddress(str) {
5827
+ function isMACAddress(str, options) {
4840
5828
  (0, _assertString2.default)(str);
5829
+ if (options && options.no_colons) {
5830
+ return macAddressNoColons.test(str);
5831
+ }
4841
5832
  return macAddress.test(str);
4842
5833
  }
4843
5834
  module.exports = exports['default'];
4844
- },{"./util/assertString":73}],47:[function(require,module,exports){
5835
+ },{"./util/assertString":127}],100:[function(require,module,exports){
4845
5836
  'use strict';
4846
5837
 
4847
5838
  Object.defineProperty(exports, "__esModule", {
@@ -4862,7 +5853,28 @@ function isMD5(str) {
4862
5853
  return md5.test(str);
4863
5854
  }
4864
5855
  module.exports = exports['default'];
4865
- },{"./util/assertString":73}],48:[function(require,module,exports){
5856
+ },{"./util/assertString":127}],101:[function(require,module,exports){
5857
+ 'use strict';
5858
+
5859
+ Object.defineProperty(exports, "__esModule", {
5860
+ value: true
5861
+ });
5862
+ exports.default = isMagnetURI;
5863
+
5864
+ var _assertString = require('./util/assertString');
5865
+
5866
+ var _assertString2 = _interopRequireDefault(_assertString);
5867
+
5868
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
5869
+
5870
+ var magnetURI = /^magnet:\?xt=urn:[a-z0-9]+:[a-z0-9]{32,40}&dn=.+&tr=.+$/i;
5871
+
5872
+ function isMagnetURI(url) {
5873
+ (0, _assertString2.default)(url);
5874
+ return magnetURI.test(url.trim());
5875
+ }
5876
+ module.exports = exports['default'];
5877
+ },{"./util/assertString":127}],102:[function(require,module,exports){
4866
5878
  'use strict';
4867
5879
 
4868
5880
  Object.defineProperty(exports, "__esModule", {
@@ -4915,7 +5927,7 @@ function isMimeType(str) {
4915
5927
  return mimeTypeSimple.test(str) || mimeTypeText.test(str) || mimeTypeMultipart.test(str);
4916
5928
  }
4917
5929
  module.exports = exports['default'];
4918
- },{"./util/assertString":73}],49:[function(require,module,exports){
5930
+ },{"./util/assertString":127}],103:[function(require,module,exports){
4919
5931
  'use strict';
4920
5932
 
4921
5933
  Object.defineProperty(exports, "__esModule", {
@@ -4934,14 +5946,18 @@ var phones = {
4934
5946
  'ar-AE': /^((\+?971)|0)?5[024568]\d{7}$/,
4935
5947
  'ar-DZ': /^(\+?213|0)(5|6|7)\d{8}$/,
4936
5948
  'ar-EG': /^((\+?20)|0)?1[012]\d{8}$/,
5949
+ 'ar-IQ': /^(\+?964|0)?7[0-9]\d{8}$/,
4937
5950
  'ar-JO': /^(\+?962|0)?7[789]\d{7}$/,
5951
+ 'ar-KW': /^(\+?965)[569]\d{7}$/,
4938
5952
  'ar-SA': /^(!?(\+?966)|0)?5\d{8}$/,
4939
5953
  'ar-SY': /^(!?(\+?963)|0)?9\d{8}$/,
5954
+ 'ar-TN': /^(\+?216)?[2459]\d{7}$/,
4940
5955
  'be-BY': /^(\+?375)?(24|25|29|33|44)\d{7}$/,
4941
5956
  'bg-BG': /^(\+?359|0)?8[789]\d{7}$/,
5957
+ 'bn-BD': /\+?(88)?0?1[156789][0-9]{8}\b/,
4942
5958
  'cs-CZ': /^(\+?420)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,
4943
5959
  'da-DK': /^(\+?45)?\s?\d{2}\s?\d{2}\s?\d{2}\s?\d{2}$/,
4944
- 'de-DE': /^(\+?49[ \.\-])?([\(]{1}[0-9]{1,6}[\)])?([0-9 \.\-\/]{3,20})((x|ext|extension)[ ]?[0-9]{1,4})?$/,
5960
+ 'de-DE': /^(\+?49[ \.\-]?)?([\(]{1}[0-9]{1,6}[\)])?([0-9 \.\-\/]{3,20})((x|ext|extension)[ ]?[0-9]{1,4})?$/,
4945
5961
  'el-GR': /^(\+?30|0)?(69\d{8})$/,
4946
5962
  'en-AU': /^(\+?61|0)4\d{8}$/,
4947
5963
  'en-GB': /^(\+?44|0)7\d{9}$/,
@@ -4949,24 +5965,25 @@ var phones = {
4949
5965
  'en-IN': /^(\+?91|0)?[6789]\d{9}$/,
4950
5966
  'en-KE': /^(\+?254|0)?[7]\d{8}$/,
4951
5967
  'en-NG': /^(\+?234|0)?[789]\d{9}$/,
4952
- 'en-NZ': /^(\+?64|0)2\d{7,9}$/,
5968
+ 'en-NZ': /^(\+?64|0)[28]\d{7,9}$/,
4953
5969
  'en-PK': /^((\+92)|(0092))-{0,1}\d{3}-{0,1}\d{7}$|^\d{11}$|^\d{4}-\d{7}$/,
4954
5970
  'en-RW': /^(\+?250|0)?[7]\d{8}$/,
4955
5971
  'en-SG': /^(\+65)?[89]\d{7}$/,
4956
5972
  'en-TZ': /^(\+?255|0)?[67]\d{8}$/,
4957
5973
  'en-UG': /^(\+?256|0)?[7]\d{8}$/,
4958
- 'en-US': /^(\+?1)?[2-9]\d{2}[2-9](?!11)\d{6}$/,
5974
+ 'en-US': /^(\+?1?( |-)?)?(\([2-9][0-9]{2}\)|[2-9][0-9]{2})( |-)?([2-9][0-9]{2}( |-)?[0-9]{4})$/,
4959
5975
  'en-ZA': /^(\+?27|0)\d{9}$/,
4960
5976
  'en-ZM': /^(\+?26)?09[567]\d{7}$/,
4961
5977
  'es-ES': /^(\+?34)?(6\d{1}|7[1234])\d{7}$/,
5978
+ 'es-MX': /^(\+?52)?(1|01)?\d{10,11}$/,
4962
5979
  'et-EE': /^(\+?372)?\s?(5|8[1-4])\s?([0-9]\s?){6,7}$/,
4963
5980
  'fa-IR': /^(\+?98[\-\s]?|0)9[0-39]\d[\-\s]?\d{3}[\-\s]?\d{4}$/,
4964
5981
  'fi-FI': /^(\+?358|0)\s?(4(0|1|2|4|5|6)?|50)\s?(\d\s?){4,8}\d$/,
4965
5982
  'fo-FO': /^(\+?298)?\s?\d{2}\s?\d{2}\s?\d{2}$/,
4966
5983
  'fr-FR': /^(\+?33|0)[67]\d{8}$/,
4967
- 'he-IL': /^(\+972|0)([23489]|5[012345689]|77)[1-9]\d{6}/,
5984
+ 'he-IL': /^(\+972|0)([23489]|5[012345689]|77)[1-9]\d{6}$/,
4968
5985
  'hu-HU': /^(\+?36)(20|30|70)\d{7}$/,
4969
- 'id-ID': /^(\+?62|0[1-9])[\s|\d]+$/,
5986
+ 'id-ID': /^(\+?62|0)(0?8?\d\d\s?\d?)([\s?|\d]{7,12})$/,
4970
5987
  'it-IT': /^(\+?39)?\s?3\d{2} ?\d{6,7}$/,
4971
5988
  'ja-JP': /^(\+?81|0)[789]0[ \-]?[1-9]\d{2}[ \-]?\d{5}$/,
4972
5989
  'kk-KZ': /^(\+?7|8)?7\d{9}$/,
@@ -4978,17 +5995,18 @@ var phones = {
4978
5995
  'nl-BE': /^(\+?32|0)4?\d{8}$/,
4979
5996
  'nn-NO': /^(\+?47)?[49]\d{7}$/,
4980
5997
  'pl-PL': /^(\+?48)? ?[5-8]\d ?\d{3} ?\d{2} ?\d{2}$/,
4981
- 'pt-BR': /^(\+?55|0)\-?[1-9]{2}\-?[2-9]{1}\d{3,4}\-?\d{4}$/,
5998
+ 'pt-BR': /(?=^(\+?5{2}\-?|0)[1-9]{2}\-?\d{4}\-?\d{4}$)(^(\+?5{2}\-?|0)[1-9]{2}\-?[6-9]{1}\d{3}\-?\d{4}$)|(^(\+?5{2}\-?|0)[1-9]{2}\-?9[6-9]{1}\d{3}\-?\d{4}$)/,
4982
5999
  'pt-PT': /^(\+?351)?9[1236]\d{7}$/,
4983
6000
  'ro-RO': /^(\+?4?0)\s?7\d{2}(\/|\s|\.|\-)?\d{3}(\s|\.|\-)?\d{3}$/,
4984
6001
  'ru-RU': /^(\+?7|8)?9\d{9}$/,
4985
6002
  'sk-SK': /^(\+?421)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,
4986
6003
  'sr-RS': /^(\+3816|06)[- \d]{5,9}$/,
6004
+ 'sv-SE': /^(\+?46|0)[\s\-]?7[\s\-]?[02369]([\s\-]?\d){7}$/,
4987
6005
  'th-TH': /^(\+66|66|0)\d{9}$/,
4988
6006
  'tr-TR': /^(\+?90|0)?5\d{9}$/,
4989
6007
  'uk-UA': /^(\+?38|8)?0\d{9}$/,
4990
6008
  'vi-VN': /^(\+?84|0)?((1(2([0-9])|6([2-9])|88|99))|(9((?!5)[0-9])))([0-9]{7})$/,
4991
- 'zh-CN': /^(\+?0?86\-?)?1[3456789]\d{9}$/,
6009
+ 'zh-CN': /^((\+|00)86)?1([358][0-9]|4[579]|66|7[0135678]|9[89])[0-9]{8}$/,
4992
6010
  'zh-TW': /^(\+?886\-?|0)?9\d{8}$/
4993
6011
  };
4994
6012
  /* eslint-enable max-len */
@@ -5003,9 +6021,20 @@ function isMobilePhone(str, locale, options) {
5003
6021
  if (options && options.strictMode && !str.startsWith('+')) {
5004
6022
  return false;
5005
6023
  }
5006
- if (locale in phones) {
6024
+ if (Array.isArray(locale)) {
6025
+ return locale.some(function (key) {
6026
+ if (phones.hasOwnProperty(key)) {
6027
+ var phone = phones[key];
6028
+ if (phone.test(str)) {
6029
+ return true;
6030
+ }
6031
+ }
6032
+ return false;
6033
+ });
6034
+ } else if (locale in phones) {
5007
6035
  return phones[locale].test(str);
5008
- } else if (locale === 'any') {
6036
+ // alias falsey locale as 'any'
6037
+ } else if (!locale || locale === 'any') {
5009
6038
  for (var key in phones) {
5010
6039
  if (phones.hasOwnProperty(key)) {
5011
6040
  var phone = phones[key];
@@ -5019,7 +6048,7 @@ function isMobilePhone(str, locale, options) {
5019
6048
  throw new Error('Invalid locale \'' + locale + '\'');
5020
6049
  }
5021
6050
  module.exports = exports['default'];
5022
- },{"./util/assertString":73}],50:[function(require,module,exports){
6051
+ },{"./util/assertString":127}],104:[function(require,module,exports){
5023
6052
  'use strict';
5024
6053
 
5025
6054
  Object.defineProperty(exports, "__esModule", {
@@ -5042,7 +6071,7 @@ function isMongoId(str) {
5042
6071
  return (0, _isHexadecimal2.default)(str) && str.length === 24;
5043
6072
  }
5044
6073
  module.exports = exports['default'];
5045
- },{"./isHexadecimal":31,"./util/assertString":73}],51:[function(require,module,exports){
6074
+ },{"./isHexadecimal":82,"./util/assertString":127}],105:[function(require,module,exports){
5046
6075
  'use strict';
5047
6076
 
5048
6077
  Object.defineProperty(exports, "__esModule", {
@@ -5065,7 +6094,7 @@ function isMultibyte(str) {
5065
6094
  return multibyte.test(str);
5066
6095
  }
5067
6096
  module.exports = exports['default'];
5068
- },{"./util/assertString":73}],52:[function(require,module,exports){
6097
+ },{"./util/assertString":127}],106:[function(require,module,exports){
5069
6098
  'use strict';
5070
6099
 
5071
6100
  Object.defineProperty(exports, "__esModule", {
@@ -5080,13 +6109,17 @@ var _assertString2 = _interopRequireDefault(_assertString);
5080
6109
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
5081
6110
 
5082
6111
  var numeric = /^[+-]?([0-9]*[.])?[0-9]+$/;
6112
+ var numericNoSymbols = /^[0-9]+$/;
5083
6113
 
5084
- function isNumeric(str) {
6114
+ function isNumeric(str, options) {
5085
6115
  (0, _assertString2.default)(str);
6116
+ if (options && options.no_symbols) {
6117
+ return numericNoSymbols.test(str);
6118
+ }
5086
6119
  return numeric.test(str);
5087
6120
  }
5088
6121
  module.exports = exports['default'];
5089
- },{"./util/assertString":73}],53:[function(require,module,exports){
6122
+ },{"./util/assertString":127}],107:[function(require,module,exports){
5090
6123
  'use strict';
5091
6124
 
5092
6125
  Object.defineProperty(exports, "__esModule", {
@@ -5104,7 +6137,7 @@ function isPort(str) {
5104
6137
  return (0, _isInt2.default)(str, { min: 0, max: 65535 });
5105
6138
  }
5106
6139
  module.exports = exports['default'];
5107
- },{"./isInt":41}],54:[function(require,module,exports){
6140
+ },{"./isInt":93}],108:[function(require,module,exports){
5108
6141
  'use strict';
5109
6142
 
5110
6143
  Object.defineProperty(exports, "__esModule", {
@@ -5143,6 +6176,7 @@ var fiveDigit = /^\d{5}$/;
5143
6176
  var sixDigit = /^\d{6}$/;
5144
6177
 
5145
6178
  var patterns = {
6179
+ AD: /^AD\d{3}$/,
5146
6180
  AT: fourDigit,
5147
6181
  AU: fourDigit,
5148
6182
  BE: fourDigit,
@@ -5153,11 +6187,14 @@ var patterns = {
5153
6187
  DE: fiveDigit,
5154
6188
  DK: fourDigit,
5155
6189
  DZ: fiveDigit,
6190
+ EE: fiveDigit,
5156
6191
  ES: fiveDigit,
5157
6192
  FI: fiveDigit,
5158
6193
  FR: /^\d{2}\s?\d{3}$/,
5159
6194
  GB: /^(gir\s?0aa|[a-z]{1,2}\d[\da-z]?\s?(\d[a-z]{2})?)$/i,
5160
6195
  GR: /^\d{3}\s?\d{2}$/,
6196
+ HR: /^([1-5]\d{4}$)/,
6197
+ HU: fourDigit,
5161
6198
  IL: fiveDigit,
5162
6199
  IN: sixDigit,
5163
6200
  IS: threeDigit,
@@ -5165,6 +6202,9 @@ var patterns = {
5165
6202
  JP: /^\d{3}\-\d{4}$/,
5166
6203
  KE: fiveDigit,
5167
6204
  LI: /^(948[5-9]|949[0-7])$/,
6205
+ LT: /^LT\-\d{5}$/,
6206
+ LU: fourDigit,
6207
+ LV: /^LV\-\d{4}$/,
5168
6208
  MX: fiveDigit,
5169
6209
  NL: /^\d{4}\s?[a-z]{2}$/i,
5170
6210
  NO: fourDigit,
@@ -5174,7 +6214,9 @@ var patterns = {
5174
6214
  RU: sixDigit,
5175
6215
  SA: fiveDigit,
5176
6216
  SE: /^\d{3}\s?\d{2}$/,
6217
+ SI: fourDigit,
5177
6218
  SK: /^\d{3}\s?\d{2}$/,
6219
+ TN: fourDigit,
5178
6220
  TW: /^\d{3}(\d{2})?$/,
5179
6221
  US: /^\d{5}(-\d{4})?$/,
5180
6222
  ZA: fourDigit,
@@ -5182,7 +6224,7 @@ var patterns = {
5182
6224
  };
5183
6225
 
5184
6226
  var locales = exports.locales = Object.keys(patterns);
5185
- },{"./util/assertString":73}],55:[function(require,module,exports){
6227
+ },{"./util/assertString":127}],109:[function(require,module,exports){
5186
6228
  'use strict';
5187
6229
 
5188
6230
  Object.defineProperty(exports, "__esModule", {
@@ -5222,7 +6264,7 @@ function isRFC3339(str) {
5222
6264
  return rfc3339.test(str);
5223
6265
  }
5224
6266
  module.exports = exports['default'];
5225
- },{"./util/assertString":73}],56:[function(require,module,exports){
6267
+ },{"./util/assertString":127}],110:[function(require,module,exports){
5226
6268
  'use strict';
5227
6269
 
5228
6270
  Object.defineProperty(exports, "__esModule", {
@@ -5243,7 +6285,7 @@ function isSurrogatePair(str) {
5243
6285
  return surrogatePair.test(str);
5244
6286
  }
5245
6287
  module.exports = exports['default'];
5246
- },{"./util/assertString":73}],57:[function(require,module,exports){
6288
+ },{"./util/assertString":127}],111:[function(require,module,exports){
5247
6289
  'use strict';
5248
6290
 
5249
6291
  Object.defineProperty(exports, "__esModule", {
@@ -5322,13 +6364,16 @@ function isURL(url, options) {
5322
6364
 
5323
6365
  split = url.split('://');
5324
6366
  if (split.length > 1) {
5325
- protocol = split.shift();
6367
+ protocol = split.shift().toLowerCase();
5326
6368
  if (options.require_valid_protocol && options.protocols.indexOf(protocol) === -1) {
5327
6369
  return false;
5328
6370
  }
5329
6371
  } else if (options.require_protocol) {
5330
6372
  return false;
5331
- } else if (options.allow_protocol_relative_urls && url.substr(0, 2) === '//') {
6373
+ } else if (url.substr(0, 2) === '//') {
6374
+ if (!options.allow_protocol_relative_urls) {
6375
+ return false;
6376
+ }
5332
6377
  split[0] = url.substr(2);
5333
6378
  }
5334
6379
  url = split.join('://');
@@ -5391,7 +6436,7 @@ function isURL(url, options) {
5391
6436
  return true;
5392
6437
  }
5393
6438
  module.exports = exports['default'];
5394
- },{"./isFQDN":25,"./isIP":32,"./util/assertString":73,"./util/merge":74}],58:[function(require,module,exports){
6439
+ },{"./isFQDN":76,"./isIP":83,"./util/assertString":127,"./util/merge":129}],112:[function(require,module,exports){
5395
6440
  'use strict';
5396
6441
 
5397
6442
  Object.defineProperty(exports, "__esModule", {
@@ -5420,7 +6465,7 @@ function isUUID(str) {
5420
6465
  return pattern && pattern.test(str);
5421
6466
  }
5422
6467
  module.exports = exports['default'];
5423
- },{"./util/assertString":73}],59:[function(require,module,exports){
6468
+ },{"./util/assertString":127}],113:[function(require,module,exports){
5424
6469
  'use strict';
5425
6470
 
5426
6471
  Object.defineProperty(exports, "__esModule", {
@@ -5439,7 +6484,7 @@ function isUppercase(str) {
5439
6484
  return str === str.toUpperCase();
5440
6485
  }
5441
6486
  module.exports = exports['default'];
5442
- },{"./util/assertString":73}],60:[function(require,module,exports){
6487
+ },{"./util/assertString":127}],114:[function(require,module,exports){
5443
6488
  'use strict';
5444
6489
 
5445
6490
  Object.defineProperty(exports, "__esModule", {
@@ -5462,7 +6507,7 @@ function isVariableWidth(str) {
5462
6507
  return _isFullWidth.fullWidth.test(str) && _isHalfWidth.halfWidth.test(str);
5463
6508
  }
5464
6509
  module.exports = exports['default'];
5465
- },{"./isFullWidth":27,"./isHalfWidth":28,"./util/assertString":73}],61:[function(require,module,exports){
6510
+ },{"./isFullWidth":78,"./isHalfWidth":79,"./util/assertString":127}],115:[function(require,module,exports){
5466
6511
  'use strict';
5467
6512
 
5468
6513
  Object.defineProperty(exports, "__esModule", {
@@ -5486,7 +6531,7 @@ function isWhitelisted(str, chars) {
5486
6531
  return true;
5487
6532
  }
5488
6533
  module.exports = exports['default'];
5489
- },{"./util/assertString":73}],62:[function(require,module,exports){
6534
+ },{"./util/assertString":127}],116:[function(require,module,exports){
5490
6535
  'use strict';
5491
6536
 
5492
6537
  Object.defineProperty(exports, "__esModule", {
@@ -5506,7 +6551,7 @@ function ltrim(str, chars) {
5506
6551
  return str.replace(pattern, '');
5507
6552
  }
5508
6553
  module.exports = exports['default'];
5509
- },{"./util/assertString":73}],63:[function(require,module,exports){
6554
+ },{"./util/assertString":127}],117:[function(require,module,exports){
5510
6555
  'use strict';
5511
6556
 
5512
6557
  Object.defineProperty(exports, "__esModule", {
@@ -5528,7 +6573,7 @@ function matches(str, pattern, modifiers) {
5528
6573
  return pattern.test(str);
5529
6574
  }
5530
6575
  module.exports = exports['default'];
5531
- },{"./util/assertString":73}],64:[function(require,module,exports){
6576
+ },{"./util/assertString":127}],118:[function(require,module,exports){
5532
6577
  'use strict';
5533
6578
 
5534
6579
  Object.defineProperty(exports, "__esModule", {
@@ -5633,7 +6678,7 @@ function normalizeEmail(email, options) {
5633
6678
  parts[0] = parts[0].toLowerCase();
5634
6679
  }
5635
6680
  parts[1] = options.gmail_convert_googlemaildotcom ? 'gmail.com' : parts[1];
5636
- } else if (~icloud_domains.indexOf(parts[1])) {
6681
+ } else if (icloud_domains.indexOf(parts[1]) >= 0) {
5637
6682
  // Address is iCloud
5638
6683
  if (options.icloud_remove_subaddress) {
5639
6684
  parts[0] = parts[0].split('+')[0];
@@ -5644,7 +6689,7 @@ function normalizeEmail(email, options) {
5644
6689
  if (options.all_lowercase || options.icloud_lowercase) {
5645
6690
  parts[0] = parts[0].toLowerCase();
5646
6691
  }
5647
- } else if (~outlookdotcom_domains.indexOf(parts[1])) {
6692
+ } else if (outlookdotcom_domains.indexOf(parts[1]) >= 0) {
5648
6693
  // Address is Outlook.com
5649
6694
  if (options.outlookdotcom_remove_subaddress) {
5650
6695
  parts[0] = parts[0].split('+')[0];
@@ -5655,7 +6700,7 @@ function normalizeEmail(email, options) {
5655
6700
  if (options.all_lowercase || options.outlookdotcom_lowercase) {
5656
6701
  parts[0] = parts[0].toLowerCase();
5657
6702
  }
5658
- } else if (~yahoo_domains.indexOf(parts[1])) {
6703
+ } else if (yahoo_domains.indexOf(parts[1]) >= 0) {
5659
6704
  // Address is Yahoo
5660
6705
  if (options.yahoo_remove_subaddress) {
5661
6706
  var components = parts[0].split('-');
@@ -5667,7 +6712,7 @@ function normalizeEmail(email, options) {
5667
6712
  if (options.all_lowercase || options.yahoo_lowercase) {
5668
6713
  parts[0] = parts[0].toLowerCase();
5669
6714
  }
5670
- } else if (~yandex_domains.indexOf(parts[1])) {
6715
+ } else if (yandex_domains.indexOf(parts[1]) >= 0) {
5671
6716
  if (options.all_lowercase || options.yandex_lowercase) {
5672
6717
  parts[0] = parts[0].toLowerCase();
5673
6718
  }
@@ -5679,7 +6724,7 @@ function normalizeEmail(email, options) {
5679
6724
  return parts.join('@');
5680
6725
  }
5681
6726
  module.exports = exports['default'];
5682
- },{"./util/merge":74}],65:[function(require,module,exports){
6727
+ },{"./util/merge":129}],119:[function(require,module,exports){
5683
6728
  'use strict';
5684
6729
 
5685
6730
  Object.defineProperty(exports, "__esModule", {
@@ -5698,14 +6743,12 @@ function rtrim(str, chars) {
5698
6743
  var pattern = chars ? new RegExp('[' + chars + ']') : /\s/;
5699
6744
 
5700
6745
  var idx = str.length - 1;
5701
- while (idx >= 0 && pattern.test(str[idx])) {
5702
- idx--;
5703
- }
6746
+ for (; idx >= 0 && pattern.test(str[idx]); idx--) {}
5704
6747
 
5705
6748
  return idx < str.length ? str.substr(0, idx + 1) : str;
5706
6749
  }
5707
6750
  module.exports = exports['default'];
5708
- },{"./util/assertString":73}],66:[function(require,module,exports){
6751
+ },{"./util/assertString":127}],120:[function(require,module,exports){
5709
6752
  'use strict';
5710
6753
 
5711
6754
  Object.defineProperty(exports, "__esModule", {
@@ -5729,7 +6772,7 @@ function stripLow(str, keep_new_lines) {
5729
6772
  return (0, _blacklist2.default)(str, chars);
5730
6773
  }
5731
6774
  module.exports = exports['default'];
5732
- },{"./blacklist":6,"./util/assertString":73}],67:[function(require,module,exports){
6775
+ },{"./blacklist":57,"./util/assertString":127}],121:[function(require,module,exports){
5733
6776
  'use strict';
5734
6777
 
5735
6778
  Object.defineProperty(exports, "__esModule", {
@@ -5751,7 +6794,7 @@ function toBoolean(str, strict) {
5751
6794
  return str !== '0' && str !== 'false' && str !== '';
5752
6795
  }
5753
6796
  module.exports = exports['default'];
5754
- },{"./util/assertString":73}],68:[function(require,module,exports){
6797
+ },{"./util/assertString":127}],122:[function(require,module,exports){
5755
6798
  'use strict';
5756
6799
 
5757
6800
  Object.defineProperty(exports, "__esModule", {
@@ -5771,7 +6814,7 @@ function toDate(date) {
5771
6814
  return !isNaN(date) ? new Date(date) : null;
5772
6815
  }
5773
6816
  module.exports = exports['default'];
5774
- },{"./util/assertString":73}],69:[function(require,module,exports){
6817
+ },{"./util/assertString":127}],123:[function(require,module,exports){
5775
6818
  'use strict';
5776
6819
 
5777
6820
  Object.defineProperty(exports, "__esModule", {
@@ -5790,7 +6833,7 @@ function toFloat(str) {
5790
6833
  return parseFloat(str);
5791
6834
  }
5792
6835
  module.exports = exports['default'];
5793
- },{"./util/assertString":73}],70:[function(require,module,exports){
6836
+ },{"./util/assertString":127}],124:[function(require,module,exports){
5794
6837
  'use strict';
5795
6838
 
5796
6839
  Object.defineProperty(exports, "__esModule", {
@@ -5809,7 +6852,7 @@ function toInt(str, radix) {
5809
6852
  return parseInt(str, radix || 10);
5810
6853
  }
5811
6854
  module.exports = exports['default'];
5812
- },{"./util/assertString":73}],71:[function(require,module,exports){
6855
+ },{"./util/assertString":127}],125:[function(require,module,exports){
5813
6856
  'use strict';
5814
6857
 
5815
6858
  Object.defineProperty(exports, "__esModule", {
@@ -5831,7 +6874,7 @@ function trim(str, chars) {
5831
6874
  return (0, _rtrim2.default)((0, _ltrim2.default)(str, chars), chars);
5832
6875
  }
5833
6876
  module.exports = exports['default'];
5834
- },{"./ltrim":62,"./rtrim":65}],72:[function(require,module,exports){
6877
+ },{"./ltrim":116,"./rtrim":119}],126:[function(require,module,exports){
5835
6878
  'use strict';
5836
6879
 
5837
6880
  Object.defineProperty(exports, "__esModule", {
@@ -5850,7 +6893,7 @@ function unescape(str) {
5850
6893
  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, '`');
5851
6894
  }
5852
6895
  module.exports = exports['default'];
5853
- },{"./util/assertString":73}],73:[function(require,module,exports){
6896
+ },{"./util/assertString":127}],127:[function(require,module,exports){
5854
6897
  'use strict';
5855
6898
 
5856
6899
  Object.defineProperty(exports, "__esModule", {
@@ -5865,7 +6908,21 @@ function assertString(input) {
5865
6908
  }
5866
6909
  }
5867
6910
  module.exports = exports['default'];
5868
- },{}],74:[function(require,module,exports){
6911
+ },{}],128:[function(require,module,exports){
6912
+ "use strict";
6913
+
6914
+ Object.defineProperty(exports, "__esModule", {
6915
+ value: true
6916
+ });
6917
+ var includes = function includes(arr, val) {
6918
+ return arr.some(function (arrVal) {
6919
+ return val === arrVal;
6920
+ });
6921
+ };
6922
+
6923
+ exports.default = includes;
6924
+ module.exports = exports["default"];
6925
+ },{}],129:[function(require,module,exports){
5869
6926
  'use strict';
5870
6927
 
5871
6928
  Object.defineProperty(exports, "__esModule", {
@@ -5884,7 +6941,7 @@ function merge() {
5884
6941
  return obj;
5885
6942
  }
5886
6943
  module.exports = exports['default'];
5887
- },{}],75:[function(require,module,exports){
6944
+ },{}],130:[function(require,module,exports){
5888
6945
  'use strict';
5889
6946
 
5890
6947
  Object.defineProperty(exports, "__esModule", {
@@ -5907,7 +6964,7 @@ function toString(input) {
5907
6964
  return String(input);
5908
6965
  }
5909
6966
  module.exports = exports['default'];
5910
- },{}],76:[function(require,module,exports){
6967
+ },{}],131:[function(require,module,exports){
5911
6968
  'use strict';
5912
6969
 
5913
6970
  Object.defineProperty(exports, "__esModule", {
@@ -5926,7 +6983,7 @@ function whitelist(str, chars) {
5926
6983
  return str.replace(new RegExp('[^' + chars + ']+', 'g'), '');
5927
6984
  }
5928
6985
  module.exports = exports['default'];
5929
- },{"./util/assertString":73}],77:[function(require,module,exports){
6986
+ },{"./util/assertString":127}],132:[function(require,module,exports){
5930
6987
  "use strict";
5931
6988
 
5932
6989
  module.exports = {
@@ -5988,7 +7045,7 @@ module.exports = {
5988
7045
 
5989
7046
  };
5990
7047
 
5991
- },{}],78:[function(require,module,exports){
7048
+ },{}],133:[function(require,module,exports){
5992
7049
  /*jshint maxlen: false*/
5993
7050
 
5994
7051
  var validator = require("validator");
@@ -6119,12 +7176,12 @@ var FormatValidators = {
6119
7176
 
6120
7177
  module.exports = FormatValidators;
6121
7178
 
6122
- },{"validator":4}],79:[function(require,module,exports){
7179
+ },{"validator":55}],134:[function(require,module,exports){
6123
7180
  "use strict";
6124
7181
 
6125
- var FormatValidators = require("./FormatValidators"),
6126
- Report = require("./Report"),
6127
- Utils = require("./Utils");
7182
+ var FormatValidators = require("./FormatValidators"),
7183
+ Report = require("./Report"),
7184
+ Utils = require("./Utils");
6128
7185
 
6129
7186
  var JsonValidators = {
6130
7187
  multipleOf: function (report, schema, json) {
@@ -6133,7 +7190,7 @@ var JsonValidators = {
6133
7190
  return;
6134
7191
  }
6135
7192
  if (Utils.whatIs(json / schema.multipleOf) !== "integer") {
6136
- report.addError("MULTIPLE_OF", [json, schema.multipleOf], null, schema.description);
7193
+ report.addError("MULTIPLE_OF", [json, schema.multipleOf], null, schema);
6137
7194
  }
6138
7195
  },
6139
7196
  maximum: function (report, schema, json) {
@@ -6143,11 +7200,11 @@ var JsonValidators = {
6143
7200
  }
6144
7201
  if (schema.exclusiveMaximum !== true) {
6145
7202
  if (json > schema.maximum) {
6146
- report.addError("MAXIMUM", [json, schema.maximum], null, schema.description);
7203
+ report.addError("MAXIMUM", [json, schema.maximum], null, schema);
6147
7204
  }
6148
7205
  } else {
6149
7206
  if (json >= schema.maximum) {
6150
- report.addError("MAXIMUM_EXCLUSIVE", [json, schema.maximum], null, schema.description);
7207
+ report.addError("MAXIMUM_EXCLUSIVE", [json, schema.maximum], null, schema);
6151
7208
  }
6152
7209
  }
6153
7210
  },
@@ -6161,11 +7218,11 @@ var JsonValidators = {
6161
7218
  }
6162
7219
  if (schema.exclusiveMinimum !== true) {
6163
7220
  if (json < schema.minimum) {
6164
- report.addError("MINIMUM", [json, schema.minimum], null, schema.description);
7221
+ report.addError("MINIMUM", [json, schema.minimum], null, schema);
6165
7222
  }
6166
7223
  } else {
6167
7224
  if (json <= schema.minimum) {
6168
- report.addError("MINIMUM_EXCLUSIVE", [json, schema.minimum], null, schema.description);
7225
+ report.addError("MINIMUM_EXCLUSIVE", [json, schema.minimum], null, schema);
6169
7226
  }
6170
7227
  }
6171
7228
  },
@@ -6178,7 +7235,7 @@ var JsonValidators = {
6178
7235
  return;
6179
7236
  }
6180
7237
  if (Utils.ucs2decode(json).length > schema.maxLength) {
6181
- report.addError("MAX_LENGTH", [json.length, schema.maxLength], null, schema.description);
7238
+ report.addError("MAX_LENGTH", [json.length, schema.maxLength], null, schema);
6182
7239
  }
6183
7240
  },
6184
7241
  minLength: function (report, schema, json) {
@@ -6187,7 +7244,7 @@ var JsonValidators = {
6187
7244
  return;
6188
7245
  }
6189
7246
  if (Utils.ucs2decode(json).length < schema.minLength) {
6190
- report.addError("MIN_LENGTH", [json.length, schema.minLength], null, schema.description);
7247
+ report.addError("MIN_LENGTH", [json.length, schema.minLength], null, schema);
6191
7248
  }
6192
7249
  },
6193
7250
  pattern: function (report, schema, json) {
@@ -6196,7 +7253,7 @@ var JsonValidators = {
6196
7253
  return;
6197
7254
  }
6198
7255
  if (RegExp(schema.pattern).test(json) === false) {
6199
- report.addError("PATTERN", [schema.pattern, json], null, schema.description);
7256
+ report.addError("PATTERN", [schema.pattern, json], null, schema);
6200
7257
  }
6201
7258
  },
6202
7259
  additionalItems: function (report, schema, json) {
@@ -6208,7 +7265,7 @@ var JsonValidators = {
6208
7265
  // the json is valid if its size is less than, or equal to, the size of "items".
6209
7266
  if (schema.additionalItems === false && Array.isArray(schema.items)) {
6210
7267
  if (json.length > schema.items.length) {
6211
- report.addError("ARRAY_ADDITIONAL_ITEMS", null, null, schema.description);
7268
+ report.addError("ARRAY_ADDITIONAL_ITEMS", null, null, schema);
6212
7269
  }
6213
7270
  }
6214
7271
  },
@@ -6221,7 +7278,7 @@ var JsonValidators = {
6221
7278
  return;
6222
7279
  }
6223
7280
  if (json.length > schema.maxItems) {
6224
- report.addError("ARRAY_LENGTH_LONG", [json.length, schema.maxItems], null, schema.description);
7281
+ report.addError("ARRAY_LENGTH_LONG", [json.length, schema.maxItems], null, schema);
6225
7282
  }
6226
7283
  },
6227
7284
  minItems: function (report, schema, json) {
@@ -6230,7 +7287,7 @@ var JsonValidators = {
6230
7287
  return;
6231
7288
  }
6232
7289
  if (json.length < schema.minItems) {
6233
- report.addError("ARRAY_LENGTH_SHORT", [json.length, schema.minItems], null, schema.description);
7290
+ report.addError("ARRAY_LENGTH_SHORT", [json.length, schema.minItems], null, schema);
6234
7291
  }
6235
7292
  },
6236
7293
  uniqueItems: function (report, schema, json) {
@@ -6241,7 +7298,7 @@ var JsonValidators = {
6241
7298
  if (schema.uniqueItems === true) {
6242
7299
  var matches = [];
6243
7300
  if (Utils.isUniqueArray(json, matches) === false) {
6244
- report.addError("ARRAY_UNIQUE", matches, null, schema.description);
7301
+ report.addError("ARRAY_UNIQUE", matches, null, schema);
6245
7302
  }
6246
7303
  }
6247
7304
  },
@@ -6252,7 +7309,7 @@ var JsonValidators = {
6252
7309
  }
6253
7310
  var keysCount = Object.keys(json).length;
6254
7311
  if (keysCount > schema.maxProperties) {
6255
- report.addError("OBJECT_PROPERTIES_MAXIMUM", [keysCount, schema.maxProperties], null, schema.description);
7312
+ report.addError("OBJECT_PROPERTIES_MAXIMUM", [keysCount, schema.maxProperties], null, schema);
6256
7313
  }
6257
7314
  },
6258
7315
  minProperties: function (report, schema, json) {
@@ -6262,7 +7319,7 @@ var JsonValidators = {
6262
7319
  }
6263
7320
  var keysCount = Object.keys(json).length;
6264
7321
  if (keysCount < schema.minProperties) {
6265
- report.addError("OBJECT_PROPERTIES_MINIMUM", [keysCount, schema.minProperties], null, schema.description);
7322
+ report.addError("OBJECT_PROPERTIES_MINIMUM", [keysCount, schema.minProperties], null, schema);
6266
7323
  }
6267
7324
  },
6268
7325
  required: function (report, schema, json) {
@@ -6274,7 +7331,7 @@ var JsonValidators = {
6274
7331
  while (idx--) {
6275
7332
  var requiredPropertyName = schema.required[idx];
6276
7333
  if (json[requiredPropertyName] === undefined) {
6277
- report.addError("OBJECT_MISSING_REQUIRED_PROPERTY", [requiredPropertyName], null, schema.description);
7334
+ report.addError("OBJECT_MISSING_REQUIRED_PROPERTY", [requiredPropertyName], null, schema);
6278
7335
  }
6279
7336
  }
6280
7337
  },
@@ -6330,7 +7387,7 @@ var JsonValidators = {
6330
7387
  }
6331
7388
  }
6332
7389
  if (s.length > 0) {
6333
- report.addError("OBJECT_ADDITIONAL_PROPERTIES", [s], null, schema.description);
7390
+ report.addError("OBJECT_ADDITIONAL_PROPERTIES", [s], null, schema);
6334
7391
  }
6335
7392
  }
6336
7393
  }
@@ -6358,7 +7415,7 @@ var JsonValidators = {
6358
7415
  while (idx2--) {
6359
7416
  var requiredPropertyName = dependencyDefinition[idx2];
6360
7417
  if (json[requiredPropertyName] === undefined) {
6361
- report.addError("OBJECT_DEPENDENCY_KEY", [requiredPropertyName, dependencyName], null, schema.description);
7418
+ report.addError("OBJECT_DEPENDENCY_KEY", [requiredPropertyName, dependencyName], null, schema);
6362
7419
  }
6363
7420
  }
6364
7421
  }
@@ -6381,15 +7438,22 @@ var JsonValidators = {
6381
7438
 
6382
7439
  if (match === false) {
6383
7440
  var error = caseInsensitiveMatch && this.options.enumCaseInsensitiveComparison ? "ENUM_CASE_MISMATCH" : "ENUM_MISMATCH";
6384
- report.addError(error, [json], null, schema.description);
7441
+ report.addError(error, [json], null, schema);
6385
7442
  }
6386
7443
  },
6387
- /*
6388
7444
  type: function (report, schema, json) {
6389
7445
  // http://json-schema.org/latest/json-schema-validation.html#rfc.section.5.5.2.2
6390
- // type is handled before this is called so ignore
7446
+ var jsonType = Utils.whatIs(json);
7447
+ if (typeof schema.type === "string") {
7448
+ if (jsonType !== schema.type && (jsonType !== "integer" || schema.type !== "number")) {
7449
+ report.addError("INVALID_TYPE", [schema.type, jsonType], null, schema);
7450
+ }
7451
+ } else {
7452
+ if (schema.type.indexOf(jsonType) === -1 && (jsonType !== "integer" || schema.type.indexOf("number") === -1)) {
7453
+ report.addError("INVALID_TYPE", [schema.type, jsonType], null, schema);
7454
+ }
7455
+ }
6391
7456
  },
6392
- */
6393
7457
  allOf: function (report, schema, json) {
6394
7458
  // http://json-schema.org/latest/json-schema-validation.html#rfc.section.5.5.3.2
6395
7459
  var idx = schema.allOf.length;
@@ -6413,7 +7477,7 @@ var JsonValidators = {
6413
7477
  }
6414
7478
 
6415
7479
  if (passed === false) {
6416
- report.addError("ANY_OF_MISSING", undefined, subReports, schema.description);
7480
+ report.addError("ANY_OF_MISSING", undefined, subReports, schema);
6417
7481
  }
6418
7482
  },
6419
7483
  oneOf: function (report, schema, json) {
@@ -6431,16 +7495,16 @@ var JsonValidators = {
6431
7495
  }
6432
7496
 
6433
7497
  if (passes === 0) {
6434
- report.addError("ONE_OF_MISSING", undefined, subReports, schema.description);
7498
+ report.addError("ONE_OF_MISSING", undefined, subReports, schema);
6435
7499
  } else if (passes > 1) {
6436
- report.addError("ONE_OF_MULTIPLE", null, null, schema.description);
7500
+ report.addError("ONE_OF_MULTIPLE", null, null, schema);
6437
7501
  }
6438
7502
  },
6439
7503
  not: function (report, schema, json) {
6440
7504
  // http://json-schema.org/latest/json-schema-validation.html#rfc.section.5.5.6.2
6441
7505
  var subReport = new Report(report);
6442
7506
  if (exports.validate.call(this, subReport, schema.not, json) === true) {
6443
- report.addError("NOT_PASSED", null, null, schema.description);
7507
+ report.addError("NOT_PASSED", null, null, schema);
6444
7508
  }
6445
7509
  },
6446
7510
  definitions: function () { /*report, schema, json*/
@@ -6455,17 +7519,17 @@ var JsonValidators = {
6455
7519
  // async
6456
7520
  report.addAsyncTask(formatValidatorFn, [json], function (result) {
6457
7521
  if (result !== true) {
6458
- report.addError("INVALID_FORMAT", [schema.format, json], null, schema.description);
7522
+ report.addError("INVALID_FORMAT", [schema.format, json], null, schema);
6459
7523
  }
6460
7524
  });
6461
7525
  } else {
6462
7526
  // sync
6463
7527
  if (formatValidatorFn.call(this, json) !== true) {
6464
- report.addError("INVALID_FORMAT", [schema.format, json], null, schema.description);
7528
+ report.addError("INVALID_FORMAT", [schema.format, json], null, schema);
6465
7529
  }
6466
7530
  }
6467
7531
  } else if (this.options.ignoreUnknownFormats !== true) {
6468
- report.addError("UNKNOWN_FORMAT", [schema.format], null, schema.description);
7532
+ report.addError("UNKNOWN_FORMAT", [schema.format], null, schema);
6469
7533
  }
6470
7534
  }
6471
7535
  };
@@ -6482,7 +7546,7 @@ var recurseArray = function (report, schema, json) {
6482
7546
  if (Array.isArray(schema.items)) {
6483
7547
 
6484
7548
  while (idx--) {
6485
- // equal to doesnt make sense here
7549
+ // equal to doesn't make sense here
6486
7550
  if (idx < schema.items.length) {
6487
7551
  report.path.push(idx.toString());
6488
7552
  exports.validate.call(this, report, schema.items[idx], json[idx]);
@@ -6570,6 +7634,12 @@ var recurseObject = function (report, schema, json) {
6570
7634
  }
6571
7635
  };
6572
7636
 
7637
+ /**
7638
+ *
7639
+ * @param {Report} report
7640
+ * @param {*} schema
7641
+ * @param {*} json
7642
+ */
6573
7643
  exports.validate = function (report, schema, json) {
6574
7644
 
6575
7645
  report.commonErrorMessage = "JSON_OBJECT_VALIDATION_FAILED";
@@ -6577,7 +7647,7 @@ exports.validate = function (report, schema, json) {
6577
7647
  // check if schema is an object
6578
7648
  var to = Utils.whatIs(schema);
6579
7649
  if (to !== "object") {
6580
- report.addError("SCHEMA_NOT_AN_OBJECT", [to], null, schema.description);
7650
+ report.addError("SCHEMA_NOT_AN_OBJECT", [to], null, schema);
6581
7651
  return false;
6582
7652
  }
6583
7653
 
@@ -6600,7 +7670,7 @@ exports.validate = function (report, schema, json) {
6600
7670
  var maxRefs = 99;
6601
7671
  while (schema.$ref && maxRefs > 0) {
6602
7672
  if (!schema.__$refResolved) {
6603
- report.addError("REF_UNRESOLVED", [schema.$ref], null, schema.description);
7673
+ report.addError("REF_UNRESOLVED", [schema.$ref], null, schema);
6604
7674
  break;
6605
7675
  } else if (schema.__$refResolved === schema) {
6606
7676
  break;
@@ -6616,23 +7686,12 @@ exports.validate = function (report, schema, json) {
6616
7686
  }
6617
7687
 
6618
7688
  // type checking first
6619
- // http://json-schema.org/latest/json-schema-validation.html#rfc.section.5.5.2.2
6620
7689
  var jsonType = Utils.whatIs(json);
6621
7690
  if (schema.type) {
6622
- if (typeof schema.type === "string") {
6623
- if (jsonType !== schema.type && (jsonType !== "integer" || schema.type !== "number")) {
6624
- report.addError("INVALID_TYPE", [schema.type, jsonType], null, schema.description);
6625
- if (this.options.breakOnFirstError) {
6626
- return false;
6627
- }
6628
- }
6629
- } else {
6630
- if (schema.type.indexOf(jsonType) === -1 && (jsonType !== "integer" || schema.type.indexOf("number") === -1)) {
6631
- report.addError("INVALID_TYPE", [schema.type, jsonType], null, schema.description);
6632
- if (this.options.breakOnFirstError) {
6633
- return false;
6634
- }
6635
- }
7691
+ keys.splice(keys.indexOf("type"), 1);
7692
+ JsonValidators.type.call(this, report, schema, json);
7693
+ if (report.errors.length && this.options.breakOnFirstError) {
7694
+ return false;
6636
7695
  }
6637
7696
  }
6638
7697
 
@@ -6667,7 +7726,7 @@ exports.validate = function (report, schema, json) {
6667
7726
 
6668
7727
  };
6669
7728
 
6670
- },{"./FormatValidators":78,"./Report":81,"./Utils":85}],80:[function(require,module,exports){
7729
+ },{"./FormatValidators":133,"./Report":136,"./Utils":140}],135:[function(require,module,exports){
6671
7730
  // Number.isFinite polyfill
6672
7731
  // http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isfinite
6673
7732
  if (typeof Number.isFinite !== "function") {
@@ -6685,7 +7744,7 @@ if (typeof Number.isFinite !== "function") {
6685
7744
  };
6686
7745
  }
6687
7746
 
6688
- },{}],81:[function(require,module,exports){
7747
+ },{}],136:[function(require,module,exports){
6689
7748
  (function (process){
6690
7749
  "use strict";
6691
7750
 
@@ -6693,6 +7752,12 @@ var get = require("lodash.get");
6693
7752
  var Errors = require("./Errors");
6694
7753
  var Utils = require("./Utils");
6695
7754
 
7755
+ /**
7756
+ * @class
7757
+ *
7758
+ * @param {Report|object} parentOrOptions
7759
+ * @param {object} [reportOptions]
7760
+ */
6696
7761
  function Report(parentOrOptions, reportOptions) {
6697
7762
  this.parentReport = parentOrOptions instanceof Report ?
6698
7763
  parentOrOptions :
@@ -6705,10 +7770,20 @@ function Report(parentOrOptions, reportOptions) {
6705
7770
  this.reportOptions = reportOptions || {};
6706
7771
 
6707
7772
  this.errors = [];
7773
+ /**
7774
+ * @type {string[]}
7775
+ */
6708
7776
  this.path = [];
6709
7777
  this.asyncTasks = [];
7778
+
7779
+ this.rootSchema = undefined;
7780
+ this.commonErrorMessage = undefined;
7781
+ this.json = undefined;
6710
7782
  }
6711
7783
 
7784
+ /**
7785
+ * @returns {boolean}
7786
+ */
6712
7787
  Report.prototype.isValid = function () {
6713
7788
  if (this.asyncTasks.length > 0) {
6714
7789
  throw new Error("Async tasks pending, can't answer isValid");
@@ -6716,10 +7791,23 @@ Report.prototype.isValid = function () {
6716
7791
  return this.errors.length === 0;
6717
7792
  };
6718
7793
 
7794
+ /**
7795
+ *
7796
+ * @param {*} fn
7797
+ * @param {*} args
7798
+ * @param {*} asyncTaskResultProcessFn
7799
+ */
6719
7800
  Report.prototype.addAsyncTask = function (fn, args, asyncTaskResultProcessFn) {
6720
7801
  this.asyncTasks.push([fn, args, asyncTaskResultProcessFn]);
6721
7802
  };
6722
7803
 
7804
+ /**
7805
+ *
7806
+ * @param {*} timeout
7807
+ * @param {function(*, *)} callback
7808
+ *
7809
+ * @returns {void}
7810
+ */
6723
7811
  Report.prototype.processAsyncTasks = function (timeout, callback) {
6724
7812
 
6725
7813
  var validationTimeout = timeout || 2000,
@@ -6731,7 +7819,7 @@ Report.prototype.processAsyncTasks = function (timeout, callback) {
6731
7819
  function finish() {
6732
7820
  process.nextTick(function () {
6733
7821
  var valid = self.errors.length === 0,
6734
- err = valid ? undefined : self.errors;
7822
+ err = valid ? undefined : self.errors;
6735
7823
  callback(err, valid);
6736
7824
  });
6737
7825
  }
@@ -6767,7 +7855,16 @@ Report.prototype.processAsyncTasks = function (timeout, callback) {
6767
7855
 
6768
7856
  };
6769
7857
 
7858
+ /**
7859
+ *
7860
+ * @param {*} returnPathAsString
7861
+ *
7862
+ * @return {string[]|string}
7863
+ */
6770
7864
  Report.prototype.getPath = function (returnPathAsString) {
7865
+ /**
7866
+ * @type {string[]|string}
7867
+ */
6771
7868
  var path = [];
6772
7869
  if (this.parentReport) {
6773
7870
  path = path.concat(this.parentReport.path);
@@ -6812,6 +7909,13 @@ Report.prototype.getSchemaId = function () {
6812
7909
  return this.rootSchema.id;
6813
7910
  };
6814
7911
 
7912
+ /**
7913
+ *
7914
+ * @param {*} errorCode
7915
+ * @param {*} params
7916
+ *
7917
+ * @return {boolean}
7918
+ */
6815
7919
  Report.prototype.hasError = function (errorCode, params) {
6816
7920
  var idx = this.errors.length;
6817
7921
  while (idx--) {
@@ -6834,13 +7938,43 @@ Report.prototype.hasError = function (errorCode, params) {
6834
7938
  return false;
6835
7939
  };
6836
7940
 
6837
- Report.prototype.addError = function (errorCode, params, subReports, schemaDescription) {
7941
+ /**
7942
+ *
7943
+ * @param {*} errorCode
7944
+ * @param {*} params
7945
+ * @param {Report[]|Report} [subReports]
7946
+ * @param {*} [schema]
7947
+ *
7948
+ * @return {void}
7949
+ */
7950
+ Report.prototype.addError = function (errorCode, params, subReports, schema) {
6838
7951
  if (!errorCode) { throw new Error("No errorCode passed into addError()"); }
6839
7952
 
6840
- this.addCustomError(errorCode, Errors[errorCode], params, subReports, schemaDescription);
7953
+ this.addCustomError(errorCode, Errors[errorCode], params, subReports, schema);
7954
+ };
7955
+
7956
+ Report.prototype.getJson = function () {
7957
+ var self = this;
7958
+ while (self.json === undefined) {
7959
+ self = self.parentReport;
7960
+ if (self === undefined) {
7961
+ return undefined;
7962
+ }
7963
+ }
7964
+ return self.json;
6841
7965
  };
6842
7966
 
6843
- Report.prototype.addCustomError = function (errorCode, errorMessage, params, subReports, schemaDescription) {
7967
+ /**
7968
+ *
7969
+ * @param {*} errorCode
7970
+ * @param {*} errorMessage
7971
+ * @param {*[]} params
7972
+ * @param {Report[]|Report} subReports
7973
+ * @param {*} schema
7974
+ *
7975
+ * @returns {void}
7976
+ */
7977
+ Report.prototype.addCustomError = function (errorCode, errorMessage, params, subReports, schema) {
6844
7978
  if (this.errors.length >= this.reportOptions.maxErrors) {
6845
7979
  return;
6846
7980
  }
@@ -6864,8 +7998,18 @@ Report.prototype.addCustomError = function (errorCode, errorMessage, params, sub
6864
7998
  schemaId: this.getSchemaId()
6865
7999
  };
6866
8000
 
6867
- if (schemaDescription) {
6868
- err.description = schemaDescription;
8001
+ err[Utils.schemaSymbol] = schema;
8002
+ err[Utils.jsonSymbol] = this.getJson();
8003
+
8004
+ if (schema && typeof schema === "string") {
8005
+ err.description = schema;
8006
+ } else if (schema && typeof schema === "object") {
8007
+ if (schema.title) {
8008
+ err.title = schema.title;
8009
+ }
8010
+ if (schema.description) {
8011
+ err.description = schema.description;
8012
+ }
6869
8013
  }
6870
8014
 
6871
8015
  if (subReports != null) {
@@ -6892,7 +8036,7 @@ Report.prototype.addCustomError = function (errorCode, errorMessage, params, sub
6892
8036
  module.exports = Report;
6893
8037
 
6894
8038
  }).call(this,require('_process'))
6895
- },{"./Errors":77,"./Utils":85,"_process":3,"lodash.get":1}],82:[function(require,module,exports){
8039
+ },{"./Errors":132,"./Utils":140,"_process":54,"lodash.get":52}],137:[function(require,module,exports){
6896
8040
  "use strict";
6897
8041
 
6898
8042
  var isequal = require("lodash.isequal");
@@ -6959,6 +8103,13 @@ function findId(schema, id) {
6959
8103
  }
6960
8104
  }
6961
8105
 
8106
+ /**
8107
+ *
8108
+ * @param {*} uri
8109
+ * @param {*} schema
8110
+ *
8111
+ * @returns {void}
8112
+ */
6962
8113
  exports.cacheSchemaByUri = function (uri, schema) {
6963
8114
  var remotePath = getRemotePath(uri);
6964
8115
  if (remotePath) {
@@ -6966,6 +8117,12 @@ exports.cacheSchemaByUri = function (uri, schema) {
6966
8117
  }
6967
8118
  };
6968
8119
 
8120
+ /**
8121
+ *
8122
+ * @param {*} uri
8123
+ *
8124
+ * @returns {void}
8125
+ */
6969
8126
  exports.removeFromCacheByUri = function (uri) {
6970
8127
  var remotePath = getRemotePath(uri);
6971
8128
  if (remotePath) {
@@ -6973,6 +8130,12 @@ exports.removeFromCacheByUri = function (uri) {
6973
8130
  }
6974
8131
  };
6975
8132
 
8133
+ /**
8134
+ *
8135
+ * @param {*} uri
8136
+ *
8137
+ * @returns {boolean}
8138
+ */
6976
8139
  exports.checkCacheForUri = function (uri) {
6977
8140
  var remotePath = getRemotePath(uri);
6978
8141
  return remotePath ? this.cache[remotePath] != null : false;
@@ -7056,7 +8219,7 @@ exports.getSchemaByUri = function (report, uri, root) {
7056
8219
 
7057
8220
  exports.getRemotePath = getRemotePath;
7058
8221
 
7059
- },{"./Report":81,"./SchemaCompilation":83,"./SchemaValidation":84,"./Utils":85,"lodash.isequal":2}],83:[function(require,module,exports){
8222
+ },{"./Report":136,"./SchemaCompilation":138,"./SchemaValidation":139,"./Utils":140,"lodash.isequal":53}],138:[function(require,module,exports){
7060
8223
  "use strict";
7061
8224
 
7062
8225
  var Report = require("./Report");
@@ -7357,7 +8520,7 @@ exports.compileSchema = function (report, schema) {
7357
8520
 
7358
8521
  };
7359
8522
 
7360
- },{"./Report":81,"./SchemaCache":82,"./Utils":85}],84:[function(require,module,exports){
8523
+ },{"./Report":136,"./SchemaCache":137,"./Utils":140}],139:[function(require,module,exports){
7361
8524
  "use strict";
7362
8525
 
7363
8526
  var FormatValidators = require("./FormatValidators"),
@@ -7861,6 +9024,13 @@ var SchemaValidators = {
7861
9024
  }
7862
9025
  };
7863
9026
 
9027
+ /**
9028
+ *
9029
+ * @param {Report} report
9030
+ * @param {*[]} arr
9031
+ *
9032
+ * @returns {boolean}
9033
+ */
7864
9034
  var validateArrayOfSchemas = function (report, arr) {
7865
9035
  var idx = arr.length;
7866
9036
  while (idx--) {
@@ -7869,6 +9039,11 @@ var validateArrayOfSchemas = function (report, arr) {
7869
9039
  return report.isValid();
7870
9040
  };
7871
9041
 
9042
+ /**
9043
+ *
9044
+ * @param {Report} report
9045
+ * @param {*} schema
9046
+ */
7872
9047
  exports.validateSchema = function (report, schema) {
7873
9048
 
7874
9049
  report.commonErrorMessage = "SCHEMA_VALIDATION_FAILED";
@@ -7966,13 +9141,40 @@ exports.validateSchema = function (report, schema) {
7966
9141
  return isValid;
7967
9142
  };
7968
9143
 
7969
- },{"./FormatValidators":78,"./JsonValidation":79,"./Report":81,"./Utils":85}],85:[function(require,module,exports){
9144
+ },{"./FormatValidators":133,"./JsonValidation":134,"./Report":136,"./Utils":140}],140:[function(require,module,exports){
7970
9145
  "use strict";
7971
9146
 
9147
+ require("core-js/es6/symbol");
9148
+
9149
+ exports.jsonSymbol = Symbol.for("z-schema/json");
9150
+
9151
+ exports.schemaSymbol = Symbol.for("z-schema/schema");
9152
+
9153
+ /**
9154
+ * @param {object} obj
9155
+ *
9156
+ * @returns {string[]}
9157
+ */
9158
+ var sortedKeys = exports.sortedKeys = function (obj) {
9159
+ return Object.keys(obj).sort();
9160
+ };
9161
+
9162
+ /**
9163
+ *
9164
+ * @param {string} uri
9165
+ *
9166
+ * @returns {boolean}
9167
+ */
7972
9168
  exports.isAbsoluteUri = function (uri) {
7973
9169
  return /^https?:\/\//.test(uri);
7974
9170
  };
7975
9171
 
9172
+ /**
9173
+ *
9174
+ * @param {string} uri
9175
+ *
9176
+ * @returns {boolean}
9177
+ */
7976
9178
  exports.isRelativeUri = function (uri) {
7977
9179
  // relative URIs that end with a hash sign, issue #56
7978
9180
  return /.+#/.test(uri);
@@ -8010,6 +9212,14 @@ exports.whatIs = function (what) {
8010
9212
 
8011
9213
  };
8012
9214
 
9215
+ /**
9216
+ *
9217
+ * @param {*} json1
9218
+ * @param {*} json2
9219
+ * @param {*} [options]
9220
+ *
9221
+ * @returns {boolean}
9222
+ */
8013
9223
  exports.areEqual = function areEqual(json1, json2, options) {
8014
9224
 
8015
9225
  options = options || {};
@@ -8053,8 +9263,8 @@ exports.areEqual = function areEqual(json1, json2, options) {
8053
9263
  // both are objects, and:
8054
9264
  if (exports.whatIs(json1) === "object" && exports.whatIs(json2) === "object") {
8055
9265
  // have the same set of property names; and
8056
- var keys1 = Object.keys(json1);
8057
- var keys2 = Object.keys(json2);
9266
+ var keys1 = sortedKeys(json1);
9267
+ var keys2 = sortedKeys(json2);
8058
9268
  if (!areEqual(keys1, keys2, { caseInsensitiveComparison: caseInsensitiveComparison })) {
8059
9269
  return false;
8060
9270
  }
@@ -8071,6 +9281,13 @@ exports.areEqual = function areEqual(json1, json2, options) {
8071
9281
  return false;
8072
9282
  };
8073
9283
 
9284
+ /**
9285
+ *
9286
+ * @param {*[]} arr
9287
+ * @param {number[]} [indexes]
9288
+ *
9289
+ * @returns {boolean}
9290
+ */
8074
9291
  exports.isUniqueArray = function (arr, indexes) {
8075
9292
  var i, j, l = arr.length;
8076
9293
  for (i = 0; i < l; i++) {
@@ -8084,6 +9301,13 @@ exports.isUniqueArray = function (arr, indexes) {
8084
9301
  return true;
8085
9302
  };
8086
9303
 
9304
+ /**
9305
+ *
9306
+ * @param {*} bigSet
9307
+ * @param {*} subSet
9308
+ *
9309
+ * @returns {*[]}
9310
+ */
8087
9311
  exports.difference = function (bigSet, subSet) {
8088
9312
  var arr = [],
8089
9313
  idx = bigSet.length;
@@ -8195,7 +9419,7 @@ exports.ucs2decode = function (string) {
8195
9419
  };
8196
9420
  /*jshint +W016*/
8197
9421
 
8198
- },{}],86:[function(require,module,exports){
9422
+ },{"core-js/es6/symbol":1}],141:[function(require,module,exports){
8199
9423
  (function (process){
8200
9424
  "use strict";
8201
9425
 
@@ -8211,9 +9435,9 @@ var Utils = require("./Utils");
8211
9435
  var Draft4Schema = require("./schemas/schema.json");
8212
9436
  var Draft4HyperSchema = require("./schemas/hyper-schema.json");
8213
9437
 
8214
- /*
8215
- default options
8216
- */
9438
+ /**
9439
+ * default options
9440
+ */
8217
9441
  var defaultOptions = {
8218
9442
  // default timeout for all async tasks
8219
9443
  asyncTimeout: 2000,
@@ -8307,9 +9531,11 @@ function normalizeOptions(options) {
8307
9531
  return normalized;
8308
9532
  }
8309
9533
 
8310
- /*
8311
- constructor
8312
- */
9534
+ /**
9535
+ * @class
9536
+ *
9537
+ * @param {*} [options]
9538
+ */
8313
9539
  function ZSchema(options) {
8314
9540
  this.cache = {};
8315
9541
  this.referenceCache = [];
@@ -8324,9 +9550,13 @@ function ZSchema(options) {
8324
9550
  this.setRemoteReference("http://json-schema.org/draft-04/hyper-schema", Draft4HyperSchema, metaschemaOptions);
8325
9551
  }
8326
9552
 
8327
- /*
8328
- instance methods
8329
- */
9553
+ /**
9554
+ * instance methods
9555
+ *
9556
+ * @param {*} schema
9557
+ *
9558
+ * @returns {boolean}
9559
+ */
8330
9560
  ZSchema.prototype.compileSchema = function (schema) {
8331
9561
  var report = new Report(this.options);
8332
9562
 
@@ -8337,6 +9567,13 @@ ZSchema.prototype.compileSchema = function (schema) {
8337
9567
  this.lastReport = report;
8338
9568
  return report.isValid();
8339
9569
  };
9570
+
9571
+ /**
9572
+ *
9573
+ * @param {*} schema
9574
+ *
9575
+ * @returns {boolean}
9576
+ */
8340
9577
  ZSchema.prototype.validateSchema = function (schema) {
8341
9578
  if (Array.isArray(schema) && schema.length === 0) {
8342
9579
  throw new Error(".validateSchema was called with an empty array");
@@ -8352,6 +9589,16 @@ ZSchema.prototype.validateSchema = function (schema) {
8352
9589
  this.lastReport = report;
8353
9590
  return report.isValid();
8354
9591
  };
9592
+
9593
+ /**
9594
+ *
9595
+ * @param {*} json
9596
+ * @param {*} schema
9597
+ * @param {*} [options]
9598
+ * @param {function(*, *)} [callback]
9599
+ *
9600
+ * @returns {boolean}
9601
+ */
8355
9602
  ZSchema.prototype.validate = function (json, schema, options, callback) {
8356
9603
 
8357
9604
  if (Utils.whatIs(options) === "function") {
@@ -8376,6 +9623,7 @@ ZSchema.prototype.validate = function (json, schema, options, callback) {
8376
9623
 
8377
9624
  var foundError = false;
8378
9625
  var report = new Report(this.options);
9626
+ report.json = json;
8379
9627
 
8380
9628
  if (typeof schema === "string") {
8381
9629
  var schemaName = schema;
@@ -8542,13 +9790,22 @@ ZSchema.prototype.getResolvedSchema = function (schema) {
8542
9790
  throw this.getLastError();
8543
9791
  }
8544
9792
  };
9793
+
9794
+ /**
9795
+ *
9796
+ * @param {*} schemaReader
9797
+ *
9798
+ * @returns {void}
9799
+ */
8545
9800
  ZSchema.prototype.setSchemaReader = function (schemaReader) {
8546
9801
  return ZSchema.setSchemaReader(schemaReader);
8547
9802
  };
9803
+
8548
9804
  ZSchema.prototype.getSchemaReader = function () {
8549
9805
  return ZSchema.schemaReader;
8550
9806
  };
8551
9807
 
9808
+ ZSchema.schemaReader = undefined;
8552
9809
  /*
8553
9810
  static methods
8554
9811
  */
@@ -8568,10 +9825,14 @@ ZSchema.getDefaultOptions = function () {
8568
9825
  return Utils.cloneDeep(defaultOptions);
8569
9826
  };
8570
9827
 
9828
+ ZSchema.schemaSymbol = Utils.schemaSymbol;
9829
+
9830
+ ZSchema.jsonSymbol = Utils.jsonSymbol;
9831
+
8571
9832
  module.exports = ZSchema;
8572
9833
 
8573
9834
  }).call(this,require('_process'))
8574
- },{"./FormatValidators":78,"./JsonValidation":79,"./Polyfills":80,"./Report":81,"./SchemaCache":82,"./SchemaCompilation":83,"./SchemaValidation":84,"./Utils":85,"./schemas/hyper-schema.json":87,"./schemas/schema.json":88,"_process":3,"lodash.get":1}],87:[function(require,module,exports){
9835
+ },{"./FormatValidators":133,"./JsonValidation":134,"./Polyfills":135,"./Report":136,"./SchemaCache":137,"./SchemaCompilation":138,"./SchemaValidation":139,"./Utils":140,"./schemas/hyper-schema.json":142,"./schemas/schema.json":143,"_process":54,"lodash.get":52}],142:[function(require,module,exports){
8575
9836
  module.exports={
8576
9837
  "$schema": "http://json-schema.org/draft-04/hyper-schema#",
8577
9838
  "id": "http://json-schema.org/draft-04/hyper-schema#",
@@ -8731,7 +9992,7 @@ module.exports={
8731
9992
  }
8732
9993
 
8733
9994
 
8734
- },{}],88:[function(require,module,exports){
9995
+ },{}],143:[function(require,module,exports){
8735
9996
  module.exports={
8736
9997
  "id": "http://json-schema.org/draft-04/schema#",
8737
9998
  "$schema": "http://json-schema.org/draft-04/schema#",
@@ -8884,5 +10145,5 @@ module.exports={
8884
10145
  "default": {}
8885
10146
  }
8886
10147
 
8887
- },{}]},{},[77,78,79,80,81,82,83,84,85,86])(86)
10148
+ },{}]},{},[132,133,134,135,136,137,138,139,140,141])(141)
8888
10149
  });