z-schema 3.19.0 → 3.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/dist/ZSchema-browser-min.js +1 -1
- package/dist/ZSchema-browser-min.js.map +1 -1
- package/dist/ZSchema-browser-test.js +1381 -649
- package/dist/ZSchema-browser.js +356 -127
- package/package.json +4 -6
- package/src/Errors.js +1 -0
- package/src/JsonValidation.js +20 -19
- package/src/Report.js +2 -1
- package/src/Utils.js +14 -4
- package/src/ZSchema.js +5 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function e
|
|
1
|
+
(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
2
|
'use strict'
|
|
3
3
|
|
|
4
4
|
exports.byteLength = byteLength
|
|
@@ -15,68 +15,102 @@ for (var i = 0, len = code.length; i < len; ++i) {
|
|
|
15
15
|
revLookup[code.charCodeAt(i)] = i
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
// Support decoding URL-safe base64 strings, as Node.js does.
|
|
19
|
+
// See: https://en.wikipedia.org/wiki/Base64#URL_applications
|
|
18
20
|
revLookup['-'.charCodeAt(0)] = 62
|
|
19
21
|
revLookup['_'.charCodeAt(0)] = 63
|
|
20
22
|
|
|
21
|
-
function
|
|
23
|
+
function getLens (b64) {
|
|
22
24
|
var len = b64.length
|
|
25
|
+
|
|
23
26
|
if (len % 4 > 0) {
|
|
24
27
|
throw new Error('Invalid string. Length must be a multiple of 4')
|
|
25
28
|
}
|
|
26
29
|
|
|
27
|
-
//
|
|
28
|
-
//
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
// Trim off extra bytes after placeholder bytes are found
|
|
31
|
+
// See: https://github.com/beatgammit/base64-js/issues/42
|
|
32
|
+
var validLen = b64.indexOf('=')
|
|
33
|
+
if (validLen === -1) validLen = len
|
|
34
|
+
|
|
35
|
+
var placeHoldersLen = validLen === len
|
|
36
|
+
? 0
|
|
37
|
+
: 4 - (validLen % 4)
|
|
38
|
+
|
|
39
|
+
return [validLen, placeHoldersLen]
|
|
33
40
|
}
|
|
34
41
|
|
|
42
|
+
// base64 is 4/3 + up to two characters of the original data
|
|
35
43
|
function byteLength (b64) {
|
|
36
|
-
|
|
37
|
-
|
|
44
|
+
var lens = getLens(b64)
|
|
45
|
+
var validLen = lens[0]
|
|
46
|
+
var placeHoldersLen = lens[1]
|
|
47
|
+
return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function _byteLength (b64, validLen, placeHoldersLen) {
|
|
51
|
+
return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
|
|
38
52
|
}
|
|
39
53
|
|
|
40
54
|
function toByteArray (b64) {
|
|
41
|
-
var
|
|
42
|
-
var
|
|
43
|
-
|
|
55
|
+
var tmp
|
|
56
|
+
var lens = getLens(b64)
|
|
57
|
+
var validLen = lens[0]
|
|
58
|
+
var placeHoldersLen = lens[1]
|
|
59
|
+
|
|
60
|
+
var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
|
|
44
61
|
|
|
45
|
-
|
|
62
|
+
var curByte = 0
|
|
46
63
|
|
|
47
64
|
// if there are placeholders, only get up to the last complete 4 chars
|
|
48
|
-
|
|
65
|
+
var len = placeHoldersLen > 0
|
|
66
|
+
? validLen - 4
|
|
67
|
+
: validLen
|
|
49
68
|
|
|
50
|
-
var
|
|
69
|
+
for (var i = 0; i < len; i += 4) {
|
|
70
|
+
tmp =
|
|
71
|
+
(revLookup[b64.charCodeAt(i)] << 18) |
|
|
72
|
+
(revLookup[b64.charCodeAt(i + 1)] << 12) |
|
|
73
|
+
(revLookup[b64.charCodeAt(i + 2)] << 6) |
|
|
74
|
+
revLookup[b64.charCodeAt(i + 3)]
|
|
75
|
+
arr[curByte++] = (tmp >> 16) & 0xFF
|
|
76
|
+
arr[curByte++] = (tmp >> 8) & 0xFF
|
|
77
|
+
arr[curByte++] = tmp & 0xFF
|
|
78
|
+
}
|
|
51
79
|
|
|
52
|
-
|
|
53
|
-
tmp =
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
arr[
|
|
80
|
+
if (placeHoldersLen === 2) {
|
|
81
|
+
tmp =
|
|
82
|
+
(revLookup[b64.charCodeAt(i)] << 2) |
|
|
83
|
+
(revLookup[b64.charCodeAt(i + 1)] >> 4)
|
|
84
|
+
arr[curByte++] = tmp & 0xFF
|
|
57
85
|
}
|
|
58
86
|
|
|
59
|
-
if (
|
|
60
|
-
tmp =
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
arr[
|
|
65
|
-
arr[
|
|
87
|
+
if (placeHoldersLen === 1) {
|
|
88
|
+
tmp =
|
|
89
|
+
(revLookup[b64.charCodeAt(i)] << 10) |
|
|
90
|
+
(revLookup[b64.charCodeAt(i + 1)] << 4) |
|
|
91
|
+
(revLookup[b64.charCodeAt(i + 2)] >> 2)
|
|
92
|
+
arr[curByte++] = (tmp >> 8) & 0xFF
|
|
93
|
+
arr[curByte++] = tmp & 0xFF
|
|
66
94
|
}
|
|
67
95
|
|
|
68
96
|
return arr
|
|
69
97
|
}
|
|
70
98
|
|
|
71
99
|
function tripletToBase64 (num) {
|
|
72
|
-
return lookup[num >> 18 & 0x3F] +
|
|
100
|
+
return lookup[num >> 18 & 0x3F] +
|
|
101
|
+
lookup[num >> 12 & 0x3F] +
|
|
102
|
+
lookup[num >> 6 & 0x3F] +
|
|
103
|
+
lookup[num & 0x3F]
|
|
73
104
|
}
|
|
74
105
|
|
|
75
106
|
function encodeChunk (uint8, start, end) {
|
|
76
107
|
var tmp
|
|
77
108
|
var output = []
|
|
78
109
|
for (var i = start; i < end; i += 3) {
|
|
79
|
-
tmp =
|
|
110
|
+
tmp =
|
|
111
|
+
((uint8[i] << 16) & 0xFF0000) +
|
|
112
|
+
((uint8[i + 1] << 8) & 0xFF00) +
|
|
113
|
+
(uint8[i + 2] & 0xFF)
|
|
80
114
|
output.push(tripletToBase64(tmp))
|
|
81
115
|
}
|
|
82
116
|
return output.join('')
|
|
@@ -86,31 +120,34 @@ function fromByteArray (uint8) {
|
|
|
86
120
|
var tmp
|
|
87
121
|
var len = uint8.length
|
|
88
122
|
var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
|
|
89
|
-
var output = ''
|
|
90
123
|
var parts = []
|
|
91
124
|
var maxChunkLength = 16383 // must be multiple of 3
|
|
92
125
|
|
|
93
126
|
// go through the array every three bytes, we'll deal with trailing stuff later
|
|
94
127
|
for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
|
|
95
|
-
parts.push(encodeChunk(
|
|
128
|
+
parts.push(encodeChunk(
|
|
129
|
+
uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)
|
|
130
|
+
))
|
|
96
131
|
}
|
|
97
132
|
|
|
98
133
|
// pad the end with zeros, but make sure to not forget the extra bytes
|
|
99
134
|
if (extraBytes === 1) {
|
|
100
135
|
tmp = uint8[len - 1]
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
136
|
+
parts.push(
|
|
137
|
+
lookup[tmp >> 2] +
|
|
138
|
+
lookup[(tmp << 4) & 0x3F] +
|
|
139
|
+
'=='
|
|
140
|
+
)
|
|
104
141
|
} else if (extraBytes === 2) {
|
|
105
|
-
tmp = (uint8[len - 2] << 8) +
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
142
|
+
tmp = (uint8[len - 2] << 8) + uint8[len - 1]
|
|
143
|
+
parts.push(
|
|
144
|
+
lookup[tmp >> 10] +
|
|
145
|
+
lookup[(tmp >> 4) & 0x3F] +
|
|
146
|
+
lookup[(tmp << 2) & 0x3F] +
|
|
147
|
+
'='
|
|
148
|
+
)
|
|
110
149
|
}
|
|
111
150
|
|
|
112
|
-
parts.push(output)
|
|
113
|
-
|
|
114
151
|
return parts.join('')
|
|
115
152
|
}
|
|
116
153
|
|
|
@@ -120,7 +157,7 @@ function fromByteArray (uint8) {
|
|
|
120
157
|
/*!
|
|
121
158
|
* The buffer module from node.js, for the browser.
|
|
122
159
|
*
|
|
123
|
-
* @author Feross Aboukhadijeh <
|
|
160
|
+
* @author Feross Aboukhadijeh <https://feross.org>
|
|
124
161
|
* @license MIT
|
|
125
162
|
*/
|
|
126
163
|
/* eslint-disable no-proto */
|
|
@@ -172,6 +209,24 @@ function typedArraySupport () {
|
|
|
172
209
|
}
|
|
173
210
|
}
|
|
174
211
|
|
|
212
|
+
Object.defineProperty(Buffer.prototype, 'parent', {
|
|
213
|
+
get: function () {
|
|
214
|
+
if (!(this instanceof Buffer)) {
|
|
215
|
+
return undefined
|
|
216
|
+
}
|
|
217
|
+
return this.buffer
|
|
218
|
+
}
|
|
219
|
+
})
|
|
220
|
+
|
|
221
|
+
Object.defineProperty(Buffer.prototype, 'offset', {
|
|
222
|
+
get: function () {
|
|
223
|
+
if (!(this instanceof Buffer)) {
|
|
224
|
+
return undefined
|
|
225
|
+
}
|
|
226
|
+
return this.byteOffset
|
|
227
|
+
}
|
|
228
|
+
})
|
|
229
|
+
|
|
175
230
|
function createBuffer (length) {
|
|
176
231
|
if (length > K_MAX_LENGTH) {
|
|
177
232
|
throw new RangeError('Invalid typed array length')
|
|
@@ -223,7 +278,7 @@ function from (value, encodingOrOffset, length) {
|
|
|
223
278
|
throw new TypeError('"value" argument must not be a number')
|
|
224
279
|
}
|
|
225
280
|
|
|
226
|
-
if (isArrayBuffer(value)) {
|
|
281
|
+
if (isArrayBuffer(value) || (value && isArrayBuffer(value.buffer))) {
|
|
227
282
|
return fromArrayBuffer(value, encodingOrOffset, length)
|
|
228
283
|
}
|
|
229
284
|
|
|
@@ -253,7 +308,7 @@ Buffer.__proto__ = Uint8Array
|
|
|
253
308
|
|
|
254
309
|
function assertSize (size) {
|
|
255
310
|
if (typeof size !== 'number') {
|
|
256
|
-
throw new TypeError('"size" argument must be
|
|
311
|
+
throw new TypeError('"size" argument must be of type number')
|
|
257
312
|
} else if (size < 0) {
|
|
258
313
|
throw new RangeError('"size" argument must not be negative')
|
|
259
314
|
}
|
|
@@ -307,7 +362,7 @@ function fromString (string, encoding) {
|
|
|
307
362
|
}
|
|
308
363
|
|
|
309
364
|
if (!Buffer.isEncoding(encoding)) {
|
|
310
|
-
throw new TypeError('
|
|
365
|
+
throw new TypeError('Unknown encoding: ' + encoding)
|
|
311
366
|
}
|
|
312
367
|
|
|
313
368
|
var length = byteLength(string, encoding) | 0
|
|
@@ -336,11 +391,11 @@ function fromArrayLike (array) {
|
|
|
336
391
|
|
|
337
392
|
function fromArrayBuffer (array, byteOffset, length) {
|
|
338
393
|
if (byteOffset < 0 || array.byteLength < byteOffset) {
|
|
339
|
-
throw new RangeError('
|
|
394
|
+
throw new RangeError('"offset" is outside of buffer bounds')
|
|
340
395
|
}
|
|
341
396
|
|
|
342
397
|
if (array.byteLength < byteOffset + (length || 0)) {
|
|
343
|
-
throw new RangeError('
|
|
398
|
+
throw new RangeError('"length" is outside of buffer bounds')
|
|
344
399
|
}
|
|
345
400
|
|
|
346
401
|
var buf
|
|
@@ -371,7 +426,7 @@ function fromObject (obj) {
|
|
|
371
426
|
}
|
|
372
427
|
|
|
373
428
|
if (obj) {
|
|
374
|
-
if (
|
|
429
|
+
if (ArrayBuffer.isView(obj) || 'length' in obj) {
|
|
375
430
|
if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {
|
|
376
431
|
return createBuffer(0)
|
|
377
432
|
}
|
|
@@ -383,7 +438,7 @@ function fromObject (obj) {
|
|
|
383
438
|
}
|
|
384
439
|
}
|
|
385
440
|
|
|
386
|
-
throw new TypeError('
|
|
441
|
+
throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object.')
|
|
387
442
|
}
|
|
388
443
|
|
|
389
444
|
function checked (length) {
|
|
@@ -470,6 +525,9 @@ Buffer.concat = function concat (list, length) {
|
|
|
470
525
|
var pos = 0
|
|
471
526
|
for (i = 0; i < list.length; ++i) {
|
|
472
527
|
var buf = list[i]
|
|
528
|
+
if (ArrayBuffer.isView(buf)) {
|
|
529
|
+
buf = Buffer.from(buf)
|
|
530
|
+
}
|
|
473
531
|
if (!Buffer.isBuffer(buf)) {
|
|
474
532
|
throw new TypeError('"list" argument must be an Array of Buffers')
|
|
475
533
|
}
|
|
@@ -483,7 +541,7 @@ function byteLength (string, encoding) {
|
|
|
483
541
|
if (Buffer.isBuffer(string)) {
|
|
484
542
|
return string.length
|
|
485
543
|
}
|
|
486
|
-
if (
|
|
544
|
+
if (ArrayBuffer.isView(string) || isArrayBuffer(string)) {
|
|
487
545
|
return string.byteLength
|
|
488
546
|
}
|
|
489
547
|
if (typeof string !== 'string') {
|
|
@@ -651,6 +709,8 @@ Buffer.prototype.toString = function toString () {
|
|
|
651
709
|
return slowToString.apply(this, arguments)
|
|
652
710
|
}
|
|
653
711
|
|
|
712
|
+
Buffer.prototype.toLocaleString = Buffer.prototype.toString
|
|
713
|
+
|
|
654
714
|
Buffer.prototype.equals = function equals (b) {
|
|
655
715
|
if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
|
|
656
716
|
if (this === b) return true
|
|
@@ -871,9 +931,7 @@ function hexWrite (buf, string, offset, length) {
|
|
|
871
931
|
}
|
|
872
932
|
}
|
|
873
933
|
|
|
874
|
-
// must be an even number of digits
|
|
875
934
|
var strLen = string.length
|
|
876
|
-
if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
|
|
877
935
|
|
|
878
936
|
if (length > strLen / 2) {
|
|
879
937
|
length = strLen / 2
|
|
@@ -1566,6 +1624,7 @@ Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert
|
|
|
1566
1624
|
|
|
1567
1625
|
// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
|
|
1568
1626
|
Buffer.prototype.copy = function copy (target, targetStart, start, end) {
|
|
1627
|
+
if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer')
|
|
1569
1628
|
if (!start) start = 0
|
|
1570
1629
|
if (!end && end !== 0) end = this.length
|
|
1571
1630
|
if (targetStart >= target.length) targetStart = target.length
|
|
@@ -1580,7 +1639,7 @@ Buffer.prototype.copy = function copy (target, targetStart, start, end) {
|
|
|
1580
1639
|
if (targetStart < 0) {
|
|
1581
1640
|
throw new RangeError('targetStart out of bounds')
|
|
1582
1641
|
}
|
|
1583
|
-
if (start < 0 || start >= this.length) throw new RangeError('
|
|
1642
|
+
if (start < 0 || start >= this.length) throw new RangeError('Index out of range')
|
|
1584
1643
|
if (end < 0) throw new RangeError('sourceEnd out of bounds')
|
|
1585
1644
|
|
|
1586
1645
|
// Are we oob?
|
|
@@ -1590,22 +1649,19 @@ Buffer.prototype.copy = function copy (target, targetStart, start, end) {
|
|
|
1590
1649
|
}
|
|
1591
1650
|
|
|
1592
1651
|
var len = end - start
|
|
1593
|
-
var i
|
|
1594
1652
|
|
|
1595
|
-
if (this === target &&
|
|
1653
|
+
if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {
|
|
1654
|
+
// Use built-in when available, missing from IE11
|
|
1655
|
+
this.copyWithin(targetStart, start, end)
|
|
1656
|
+
} else if (this === target && start < targetStart && targetStart < end) {
|
|
1596
1657
|
// descending copy from end
|
|
1597
|
-
for (i = len - 1; i >= 0; --i) {
|
|
1598
|
-
target[i + targetStart] = this[i + start]
|
|
1599
|
-
}
|
|
1600
|
-
} else if (len < 1000) {
|
|
1601
|
-
// ascending copy from start
|
|
1602
|
-
for (i = 0; i < len; ++i) {
|
|
1658
|
+
for (var i = len - 1; i >= 0; --i) {
|
|
1603
1659
|
target[i + targetStart] = this[i + start]
|
|
1604
1660
|
}
|
|
1605
1661
|
} else {
|
|
1606
1662
|
Uint8Array.prototype.set.call(
|
|
1607
1663
|
target,
|
|
1608
|
-
this.subarray(start,
|
|
1664
|
+
this.subarray(start, end),
|
|
1609
1665
|
targetStart
|
|
1610
1666
|
)
|
|
1611
1667
|
}
|
|
@@ -1628,18 +1684,20 @@ Buffer.prototype.fill = function fill (val, start, end, encoding) {
|
|
|
1628
1684
|
encoding = end
|
|
1629
1685
|
end = this.length
|
|
1630
1686
|
}
|
|
1631
|
-
if (val.length === 1) {
|
|
1632
|
-
var code = val.charCodeAt(0)
|
|
1633
|
-
if (code < 256) {
|
|
1634
|
-
val = code
|
|
1635
|
-
}
|
|
1636
|
-
}
|
|
1637
1687
|
if (encoding !== undefined && typeof encoding !== 'string') {
|
|
1638
1688
|
throw new TypeError('encoding must be a string')
|
|
1639
1689
|
}
|
|
1640
1690
|
if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
|
|
1641
1691
|
throw new TypeError('Unknown encoding: ' + encoding)
|
|
1642
1692
|
}
|
|
1693
|
+
if (val.length === 1) {
|
|
1694
|
+
var code = val.charCodeAt(0)
|
|
1695
|
+
if ((encoding === 'utf8' && code < 128) ||
|
|
1696
|
+
encoding === 'latin1') {
|
|
1697
|
+
// Fast path: If `val` fits into a single byte, use that numeric value.
|
|
1698
|
+
val = code
|
|
1699
|
+
}
|
|
1700
|
+
}
|
|
1643
1701
|
} else if (typeof val === 'number') {
|
|
1644
1702
|
val = val & 255
|
|
1645
1703
|
}
|
|
@@ -1668,6 +1726,10 @@ Buffer.prototype.fill = function fill (val, start, end, encoding) {
|
|
|
1668
1726
|
? val
|
|
1669
1727
|
: new Buffer(val, encoding)
|
|
1670
1728
|
var len = bytes.length
|
|
1729
|
+
if (len === 0) {
|
|
1730
|
+
throw new TypeError('The value "' + val +
|
|
1731
|
+
'" is invalid for argument "value"')
|
|
1732
|
+
}
|
|
1671
1733
|
for (i = 0; i < end - start; ++i) {
|
|
1672
1734
|
this[i + start] = bytes[i % len]
|
|
1673
1735
|
}
|
|
@@ -1682,6 +1744,8 @@ Buffer.prototype.fill = function fill (val, start, end, encoding) {
|
|
|
1682
1744
|
var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g
|
|
1683
1745
|
|
|
1684
1746
|
function base64clean (str) {
|
|
1747
|
+
// Node takes equal signs as end of the Base64 encoding
|
|
1748
|
+
str = str.split('=')[0]
|
|
1685
1749
|
// Node strips out invalid characters like \n and \t from the string, base64-js does not
|
|
1686
1750
|
str = str.trim().replace(INVALID_BASE64_RE, '')
|
|
1687
1751
|
// Node converts strings with length < 2 to ''
|
|
@@ -1823,11 +1887,6 @@ function isArrayBuffer (obj) {
|
|
|
1823
1887
|
typeof obj.byteLength === 'number')
|
|
1824
1888
|
}
|
|
1825
1889
|
|
|
1826
|
-
// Node 0.10 supports `ArrayBuffer` but lacks `ArrayBuffer.isView`
|
|
1827
|
-
function isArrayBufferView (obj) {
|
|
1828
|
-
return (typeof ArrayBuffer.isView === 'function') && ArrayBuffer.isView(obj)
|
|
1829
|
-
}
|
|
1830
|
-
|
|
1831
1890
|
function numberIsNaN (obj) {
|
|
1832
1891
|
return obj !== obj // eslint-disable-line no-self-compare
|
|
1833
1892
|
}
|
|
@@ -2031,8 +2090,16 @@ function objectToString(o) {
|
|
|
2031
2090
|
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
2032
2091
|
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
2033
2092
|
|
|
2093
|
+
var objectCreate = Object.create || objectCreatePolyfill
|
|
2094
|
+
var objectKeys = Object.keys || objectKeysPolyfill
|
|
2095
|
+
var bind = Function.prototype.bind || functionBindPolyfill
|
|
2096
|
+
|
|
2034
2097
|
function EventEmitter() {
|
|
2035
|
-
this._events
|
|
2098
|
+
if (!this._events || !Object.prototype.hasOwnProperty.call(this, '_events')) {
|
|
2099
|
+
this._events = objectCreate(null);
|
|
2100
|
+
this._eventsCount = 0;
|
|
2101
|
+
}
|
|
2102
|
+
|
|
2036
2103
|
this._maxListeners = this._maxListeners || undefined;
|
|
2037
2104
|
}
|
|
2038
2105
|
module.exports = EventEmitter;
|
|
@@ -2045,272 +2112,481 @@ EventEmitter.prototype._maxListeners = undefined;
|
|
|
2045
2112
|
|
|
2046
2113
|
// By default EventEmitters will print a warning if more than 10 listeners are
|
|
2047
2114
|
// added to it. This is a useful default which helps finding memory leaks.
|
|
2048
|
-
|
|
2115
|
+
var defaultMaxListeners = 10;
|
|
2116
|
+
|
|
2117
|
+
var hasDefineProperty;
|
|
2118
|
+
try {
|
|
2119
|
+
var o = {};
|
|
2120
|
+
if (Object.defineProperty) Object.defineProperty(o, 'x', { value: 0 });
|
|
2121
|
+
hasDefineProperty = o.x === 0;
|
|
2122
|
+
} catch (err) { hasDefineProperty = false }
|
|
2123
|
+
if (hasDefineProperty) {
|
|
2124
|
+
Object.defineProperty(EventEmitter, 'defaultMaxListeners', {
|
|
2125
|
+
enumerable: true,
|
|
2126
|
+
get: function() {
|
|
2127
|
+
return defaultMaxListeners;
|
|
2128
|
+
},
|
|
2129
|
+
set: function(arg) {
|
|
2130
|
+
// check whether the input is a positive number (whose value is zero or
|
|
2131
|
+
// greater and not a NaN).
|
|
2132
|
+
if (typeof arg !== 'number' || arg < 0 || arg !== arg)
|
|
2133
|
+
throw new TypeError('"defaultMaxListeners" must be a positive number');
|
|
2134
|
+
defaultMaxListeners = arg;
|
|
2135
|
+
}
|
|
2136
|
+
});
|
|
2137
|
+
} else {
|
|
2138
|
+
EventEmitter.defaultMaxListeners = defaultMaxListeners;
|
|
2139
|
+
}
|
|
2049
2140
|
|
|
2050
2141
|
// Obviously not all Emitters should be limited to 10. This function allows
|
|
2051
2142
|
// that to be increased. Set to zero for unlimited.
|
|
2052
|
-
EventEmitter.prototype.setMaxListeners = function(n) {
|
|
2053
|
-
if (
|
|
2054
|
-
throw TypeError('n must be a positive number');
|
|
2143
|
+
EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
|
|
2144
|
+
if (typeof n !== 'number' || n < 0 || isNaN(n))
|
|
2145
|
+
throw new TypeError('"n" argument must be a positive number');
|
|
2055
2146
|
this._maxListeners = n;
|
|
2056
2147
|
return this;
|
|
2057
2148
|
};
|
|
2058
2149
|
|
|
2059
|
-
|
|
2060
|
-
|
|
2150
|
+
function $getMaxListeners(that) {
|
|
2151
|
+
if (that._maxListeners === undefined)
|
|
2152
|
+
return EventEmitter.defaultMaxListeners;
|
|
2153
|
+
return that._maxListeners;
|
|
2154
|
+
}
|
|
2155
|
+
|
|
2156
|
+
EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
|
|
2157
|
+
return $getMaxListeners(this);
|
|
2158
|
+
};
|
|
2061
2159
|
|
|
2062
|
-
|
|
2063
|
-
|
|
2160
|
+
// These standalone emit* functions are used to optimize calling of event
|
|
2161
|
+
// handlers for fast cases because emit() itself often has a variable number of
|
|
2162
|
+
// arguments and can be deoptimized because of that. These functions always have
|
|
2163
|
+
// the same number of arguments and thus do not get deoptimized, so the code
|
|
2164
|
+
// inside them can execute faster.
|
|
2165
|
+
function emitNone(handler, isFn, self) {
|
|
2166
|
+
if (isFn)
|
|
2167
|
+
handler.call(self);
|
|
2168
|
+
else {
|
|
2169
|
+
var len = handler.length;
|
|
2170
|
+
var listeners = arrayClone(handler, len);
|
|
2171
|
+
for (var i = 0; i < len; ++i)
|
|
2172
|
+
listeners[i].call(self);
|
|
2173
|
+
}
|
|
2174
|
+
}
|
|
2175
|
+
function emitOne(handler, isFn, self, arg1) {
|
|
2176
|
+
if (isFn)
|
|
2177
|
+
handler.call(self, arg1);
|
|
2178
|
+
else {
|
|
2179
|
+
var len = handler.length;
|
|
2180
|
+
var listeners = arrayClone(handler, len);
|
|
2181
|
+
for (var i = 0; i < len; ++i)
|
|
2182
|
+
listeners[i].call(self, arg1);
|
|
2183
|
+
}
|
|
2184
|
+
}
|
|
2185
|
+
function emitTwo(handler, isFn, self, arg1, arg2) {
|
|
2186
|
+
if (isFn)
|
|
2187
|
+
handler.call(self, arg1, arg2);
|
|
2188
|
+
else {
|
|
2189
|
+
var len = handler.length;
|
|
2190
|
+
var listeners = arrayClone(handler, len);
|
|
2191
|
+
for (var i = 0; i < len; ++i)
|
|
2192
|
+
listeners[i].call(self, arg1, arg2);
|
|
2193
|
+
}
|
|
2194
|
+
}
|
|
2195
|
+
function emitThree(handler, isFn, self, arg1, arg2, arg3) {
|
|
2196
|
+
if (isFn)
|
|
2197
|
+
handler.call(self, arg1, arg2, arg3);
|
|
2198
|
+
else {
|
|
2199
|
+
var len = handler.length;
|
|
2200
|
+
var listeners = arrayClone(handler, len);
|
|
2201
|
+
for (var i = 0; i < len; ++i)
|
|
2202
|
+
listeners[i].call(self, arg1, arg2, arg3);
|
|
2203
|
+
}
|
|
2204
|
+
}
|
|
2205
|
+
|
|
2206
|
+
function emitMany(handler, isFn, self, args) {
|
|
2207
|
+
if (isFn)
|
|
2208
|
+
handler.apply(self, args);
|
|
2209
|
+
else {
|
|
2210
|
+
var len = handler.length;
|
|
2211
|
+
var listeners = arrayClone(handler, len);
|
|
2212
|
+
for (var i = 0; i < len; ++i)
|
|
2213
|
+
listeners[i].apply(self, args);
|
|
2214
|
+
}
|
|
2215
|
+
}
|
|
2216
|
+
|
|
2217
|
+
EventEmitter.prototype.emit = function emit(type) {
|
|
2218
|
+
var er, handler, len, args, i, events;
|
|
2219
|
+
var doError = (type === 'error');
|
|
2220
|
+
|
|
2221
|
+
events = this._events;
|
|
2222
|
+
if (events)
|
|
2223
|
+
doError = (doError && events.error == null);
|
|
2224
|
+
else if (!doError)
|
|
2225
|
+
return false;
|
|
2064
2226
|
|
|
2065
2227
|
// If there is no 'error' event listener then throw.
|
|
2066
|
-
if (
|
|
2067
|
-
if (
|
|
2068
|
-
(isObject(this._events.error) && !this._events.error.length)) {
|
|
2228
|
+
if (doError) {
|
|
2229
|
+
if (arguments.length > 1)
|
|
2069
2230
|
er = arguments[1];
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
}
|
|
2231
|
+
if (er instanceof Error) {
|
|
2232
|
+
throw er; // Unhandled 'error' event
|
|
2233
|
+
} else {
|
|
2234
|
+
// At least give some kind of context to the user
|
|
2235
|
+
var err = new Error('Unhandled "error" event. (' + er + ')');
|
|
2236
|
+
err.context = er;
|
|
2237
|
+
throw err;
|
|
2078
2238
|
}
|
|
2239
|
+
return false;
|
|
2079
2240
|
}
|
|
2080
2241
|
|
|
2081
|
-
handler =
|
|
2242
|
+
handler = events[type];
|
|
2082
2243
|
|
|
2083
|
-
if (
|
|
2244
|
+
if (!handler)
|
|
2084
2245
|
return false;
|
|
2085
2246
|
|
|
2086
|
-
|
|
2087
|
-
|
|
2247
|
+
var isFn = typeof handler === 'function';
|
|
2248
|
+
len = arguments.length;
|
|
2249
|
+
switch (len) {
|
|
2088
2250
|
// fast cases
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2251
|
+
case 1:
|
|
2252
|
+
emitNone(handler, isFn, this);
|
|
2253
|
+
break;
|
|
2254
|
+
case 2:
|
|
2255
|
+
emitOne(handler, isFn, this, arguments[1]);
|
|
2256
|
+
break;
|
|
2257
|
+
case 3:
|
|
2258
|
+
emitTwo(handler, isFn, this, arguments[1], arguments[2]);
|
|
2259
|
+
break;
|
|
2260
|
+
case 4:
|
|
2261
|
+
emitThree(handler, isFn, this, arguments[1], arguments[2], arguments[3]);
|
|
2262
|
+
break;
|
|
2098
2263
|
// slower
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
args = Array.prototype.slice.call(arguments, 1);
|
|
2105
|
-
listeners = handler.slice();
|
|
2106
|
-
len = listeners.length;
|
|
2107
|
-
for (i = 0; i < len; i++)
|
|
2108
|
-
listeners[i].apply(this, args);
|
|
2264
|
+
default:
|
|
2265
|
+
args = new Array(len - 1);
|
|
2266
|
+
for (i = 1; i < len; i++)
|
|
2267
|
+
args[i - 1] = arguments[i];
|
|
2268
|
+
emitMany(handler, isFn, this, args);
|
|
2109
2269
|
}
|
|
2110
2270
|
|
|
2111
2271
|
return true;
|
|
2112
2272
|
};
|
|
2113
2273
|
|
|
2114
|
-
|
|
2274
|
+
function _addListener(target, type, listener, prepend) {
|
|
2115
2275
|
var m;
|
|
2276
|
+
var events;
|
|
2277
|
+
var existing;
|
|
2116
2278
|
|
|
2117
|
-
if (
|
|
2118
|
-
throw TypeError('listener must be a function');
|
|
2279
|
+
if (typeof listener !== 'function')
|
|
2280
|
+
throw new TypeError('"listener" argument must be a function');
|
|
2119
2281
|
|
|
2120
|
-
|
|
2121
|
-
|
|
2282
|
+
events = target._events;
|
|
2283
|
+
if (!events) {
|
|
2284
|
+
events = target._events = objectCreate(null);
|
|
2285
|
+
target._eventsCount = 0;
|
|
2286
|
+
} else {
|
|
2287
|
+
// To avoid recursion in the case that type === "newListener"! Before
|
|
2288
|
+
// adding it to the listeners, first emit "newListener".
|
|
2289
|
+
if (events.newListener) {
|
|
2290
|
+
target.emit('newListener', type,
|
|
2291
|
+
listener.listener ? listener.listener : listener);
|
|
2122
2292
|
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2293
|
+
// Re-assign `events` because a newListener handler could have caused the
|
|
2294
|
+
// this._events to be assigned to a new object
|
|
2295
|
+
events = target._events;
|
|
2296
|
+
}
|
|
2297
|
+
existing = events[type];
|
|
2298
|
+
}
|
|
2129
2299
|
|
|
2130
|
-
if (!
|
|
2300
|
+
if (!existing) {
|
|
2131
2301
|
// Optimize the case of one listener. Don't need the extra array object.
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
// Check for listener leak
|
|
2141
|
-
if (isObject(this._events[type]) && !this._events[type].warned) {
|
|
2142
|
-
if (!isUndefined(this._maxListeners)) {
|
|
2143
|
-
m = this._maxListeners;
|
|
2302
|
+
existing = events[type] = listener;
|
|
2303
|
+
++target._eventsCount;
|
|
2304
|
+
} else {
|
|
2305
|
+
if (typeof existing === 'function') {
|
|
2306
|
+
// Adding the second element, need to change to array.
|
|
2307
|
+
existing = events[type] =
|
|
2308
|
+
prepend ? [listener, existing] : [existing, listener];
|
|
2144
2309
|
} else {
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2310
|
+
// If we've already got an array, just append.
|
|
2311
|
+
if (prepend) {
|
|
2312
|
+
existing.unshift(listener);
|
|
2313
|
+
} else {
|
|
2314
|
+
existing.push(listener);
|
|
2315
|
+
}
|
|
2316
|
+
}
|
|
2317
|
+
|
|
2318
|
+
// Check for listener leak
|
|
2319
|
+
if (!existing.warned) {
|
|
2320
|
+
m = $getMaxListeners(target);
|
|
2321
|
+
if (m && m > 0 && existing.length > m) {
|
|
2322
|
+
existing.warned = true;
|
|
2323
|
+
var w = new Error('Possible EventEmitter memory leak detected. ' +
|
|
2324
|
+
existing.length + ' "' + String(type) + '" listeners ' +
|
|
2325
|
+
'added. Use emitter.setMaxListeners() to ' +
|
|
2326
|
+
'increase limit.');
|
|
2327
|
+
w.name = 'MaxListenersExceededWarning';
|
|
2328
|
+
w.emitter = target;
|
|
2329
|
+
w.type = type;
|
|
2330
|
+
w.count = existing.length;
|
|
2331
|
+
if (typeof console === 'object' && console.warn) {
|
|
2332
|
+
console.warn('%s: %s', w.name, w.message);
|
|
2333
|
+
}
|
|
2157
2334
|
}
|
|
2158
2335
|
}
|
|
2159
2336
|
}
|
|
2160
2337
|
|
|
2161
|
-
return
|
|
2338
|
+
return target;
|
|
2339
|
+
}
|
|
2340
|
+
|
|
2341
|
+
EventEmitter.prototype.addListener = function addListener(type, listener) {
|
|
2342
|
+
return _addListener(this, type, listener, false);
|
|
2162
2343
|
};
|
|
2163
2344
|
|
|
2164
2345
|
EventEmitter.prototype.on = EventEmitter.prototype.addListener;
|
|
2165
2346
|
|
|
2166
|
-
EventEmitter.prototype.
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
var fired = false;
|
|
2171
|
-
|
|
2172
|
-
function g() {
|
|
2173
|
-
this.removeListener(type, g);
|
|
2347
|
+
EventEmitter.prototype.prependListener =
|
|
2348
|
+
function prependListener(type, listener) {
|
|
2349
|
+
return _addListener(this, type, listener, true);
|
|
2350
|
+
};
|
|
2174
2351
|
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2352
|
+
function onceWrapper() {
|
|
2353
|
+
if (!this.fired) {
|
|
2354
|
+
this.target.removeListener(this.type, this.wrapFn);
|
|
2355
|
+
this.fired = true;
|
|
2356
|
+
switch (arguments.length) {
|
|
2357
|
+
case 0:
|
|
2358
|
+
return this.listener.call(this.target);
|
|
2359
|
+
case 1:
|
|
2360
|
+
return this.listener.call(this.target, arguments[0]);
|
|
2361
|
+
case 2:
|
|
2362
|
+
return this.listener.call(this.target, arguments[0], arguments[1]);
|
|
2363
|
+
case 3:
|
|
2364
|
+
return this.listener.call(this.target, arguments[0], arguments[1],
|
|
2365
|
+
arguments[2]);
|
|
2366
|
+
default:
|
|
2367
|
+
var args = new Array(arguments.length);
|
|
2368
|
+
for (var i = 0; i < args.length; ++i)
|
|
2369
|
+
args[i] = arguments[i];
|
|
2370
|
+
this.listener.apply(this.target, args);
|
|
2178
2371
|
}
|
|
2179
2372
|
}
|
|
2373
|
+
}
|
|
2180
2374
|
|
|
2181
|
-
|
|
2182
|
-
|
|
2375
|
+
function _onceWrap(target, type, listener) {
|
|
2376
|
+
var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };
|
|
2377
|
+
var wrapped = bind.call(onceWrapper, state);
|
|
2378
|
+
wrapped.listener = listener;
|
|
2379
|
+
state.wrapFn = wrapped;
|
|
2380
|
+
return wrapped;
|
|
2381
|
+
}
|
|
2183
2382
|
|
|
2383
|
+
EventEmitter.prototype.once = function once(type, listener) {
|
|
2384
|
+
if (typeof listener !== 'function')
|
|
2385
|
+
throw new TypeError('"listener" argument must be a function');
|
|
2386
|
+
this.on(type, _onceWrap(this, type, listener));
|
|
2184
2387
|
return this;
|
|
2185
2388
|
};
|
|
2186
2389
|
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2390
|
+
EventEmitter.prototype.prependOnceListener =
|
|
2391
|
+
function prependOnceListener(type, listener) {
|
|
2392
|
+
if (typeof listener !== 'function')
|
|
2393
|
+
throw new TypeError('"listener" argument must be a function');
|
|
2394
|
+
this.prependListener(type, _onceWrap(this, type, listener));
|
|
2395
|
+
return this;
|
|
2396
|
+
};
|
|
2397
|
+
|
|
2398
|
+
// Emits a 'removeListener' event if and only if the listener was removed.
|
|
2399
|
+
EventEmitter.prototype.removeListener =
|
|
2400
|
+
function removeListener(type, listener) {
|
|
2401
|
+
var list, events, position, i, originalListener;
|
|
2402
|
+
|
|
2403
|
+
if (typeof listener !== 'function')
|
|
2404
|
+
throw new TypeError('"listener" argument must be a function');
|
|
2405
|
+
|
|
2406
|
+
events = this._events;
|
|
2407
|
+
if (!events)
|
|
2408
|
+
return this;
|
|
2409
|
+
|
|
2410
|
+
list = events[type];
|
|
2411
|
+
if (!list)
|
|
2412
|
+
return this;
|
|
2413
|
+
|
|
2414
|
+
if (list === listener || list.listener === listener) {
|
|
2415
|
+
if (--this._eventsCount === 0)
|
|
2416
|
+
this._events = objectCreate(null);
|
|
2417
|
+
else {
|
|
2418
|
+
delete events[type];
|
|
2419
|
+
if (events.removeListener)
|
|
2420
|
+
this.emit('removeListener', type, list.listener || listener);
|
|
2421
|
+
}
|
|
2422
|
+
} else if (typeof list !== 'function') {
|
|
2423
|
+
position = -1;
|
|
2424
|
+
|
|
2425
|
+
for (i = list.length - 1; i >= 0; i--) {
|
|
2426
|
+
if (list[i] === listener || list[i].listener === listener) {
|
|
2427
|
+
originalListener = list[i].listener;
|
|
2428
|
+
position = i;
|
|
2429
|
+
break;
|
|
2430
|
+
}
|
|
2431
|
+
}
|
|
2190
2432
|
|
|
2191
|
-
|
|
2192
|
-
|
|
2433
|
+
if (position < 0)
|
|
2434
|
+
return this;
|
|
2193
2435
|
|
|
2194
|
-
|
|
2195
|
-
|
|
2436
|
+
if (position === 0)
|
|
2437
|
+
list.shift();
|
|
2438
|
+
else
|
|
2439
|
+
spliceOne(list, position);
|
|
2196
2440
|
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
(isFunction(list.listener) && list.listener === listener)) {
|
|
2203
|
-
delete this._events[type];
|
|
2204
|
-
if (this._events.removeListener)
|
|
2205
|
-
this.emit('removeListener', type, listener);
|
|
2206
|
-
|
|
2207
|
-
} else if (isObject(list)) {
|
|
2208
|
-
for (i = length; i-- > 0;) {
|
|
2209
|
-
if (list[i] === listener ||
|
|
2210
|
-
(list[i].listener && list[i].listener === listener)) {
|
|
2211
|
-
position = i;
|
|
2212
|
-
break;
|
|
2441
|
+
if (list.length === 1)
|
|
2442
|
+
events[type] = list[0];
|
|
2443
|
+
|
|
2444
|
+
if (events.removeListener)
|
|
2445
|
+
this.emit('removeListener', type, originalListener || listener);
|
|
2213
2446
|
}
|
|
2214
|
-
}
|
|
2215
2447
|
|
|
2216
|
-
if (position < 0)
|
|
2217
2448
|
return this;
|
|
2449
|
+
};
|
|
2218
2450
|
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2451
|
+
EventEmitter.prototype.removeAllListeners =
|
|
2452
|
+
function removeAllListeners(type) {
|
|
2453
|
+
var listeners, events, i;
|
|
2454
|
+
|
|
2455
|
+
events = this._events;
|
|
2456
|
+
if (!events)
|
|
2457
|
+
return this;
|
|
2458
|
+
|
|
2459
|
+
// not listening for removeListener, no need to emit
|
|
2460
|
+
if (!events.removeListener) {
|
|
2461
|
+
if (arguments.length === 0) {
|
|
2462
|
+
this._events = objectCreate(null);
|
|
2463
|
+
this._eventsCount = 0;
|
|
2464
|
+
} else if (events[type]) {
|
|
2465
|
+
if (--this._eventsCount === 0)
|
|
2466
|
+
this._events = objectCreate(null);
|
|
2467
|
+
else
|
|
2468
|
+
delete events[type];
|
|
2469
|
+
}
|
|
2470
|
+
return this;
|
|
2471
|
+
}
|
|
2225
2472
|
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2473
|
+
// emit removeListener for all listeners on all events
|
|
2474
|
+
if (arguments.length === 0) {
|
|
2475
|
+
var keys = objectKeys(events);
|
|
2476
|
+
var key;
|
|
2477
|
+
for (i = 0; i < keys.length; ++i) {
|
|
2478
|
+
key = keys[i];
|
|
2479
|
+
if (key === 'removeListener') continue;
|
|
2480
|
+
this.removeAllListeners(key);
|
|
2481
|
+
}
|
|
2482
|
+
this.removeAllListeners('removeListener');
|
|
2483
|
+
this._events = objectCreate(null);
|
|
2484
|
+
this._eventsCount = 0;
|
|
2485
|
+
return this;
|
|
2486
|
+
}
|
|
2229
2487
|
|
|
2230
|
-
|
|
2231
|
-
};
|
|
2488
|
+
listeners = events[type];
|
|
2232
2489
|
|
|
2233
|
-
|
|
2234
|
-
|
|
2490
|
+
if (typeof listeners === 'function') {
|
|
2491
|
+
this.removeListener(type, listeners);
|
|
2492
|
+
} else if (listeners) {
|
|
2493
|
+
// LIFO order
|
|
2494
|
+
for (i = listeners.length - 1; i >= 0; i--) {
|
|
2495
|
+
this.removeListener(type, listeners[i]);
|
|
2496
|
+
}
|
|
2497
|
+
}
|
|
2235
2498
|
|
|
2236
|
-
|
|
2237
|
-
|
|
2499
|
+
return this;
|
|
2500
|
+
};
|
|
2238
2501
|
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
else if (this._events[type])
|
|
2244
|
-
delete this._events[type];
|
|
2245
|
-
return this;
|
|
2246
|
-
}
|
|
2502
|
+
EventEmitter.prototype.listeners = function listeners(type) {
|
|
2503
|
+
var evlistener;
|
|
2504
|
+
var ret;
|
|
2505
|
+
var events = this._events;
|
|
2247
2506
|
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2507
|
+
if (!events)
|
|
2508
|
+
ret = [];
|
|
2509
|
+
else {
|
|
2510
|
+
evlistener = events[type];
|
|
2511
|
+
if (!evlistener)
|
|
2512
|
+
ret = [];
|
|
2513
|
+
else if (typeof evlistener === 'function')
|
|
2514
|
+
ret = [evlistener.listener || evlistener];
|
|
2515
|
+
else
|
|
2516
|
+
ret = unwrapListeners(evlistener);
|
|
2257
2517
|
}
|
|
2258
2518
|
|
|
2259
|
-
|
|
2519
|
+
return ret;
|
|
2520
|
+
};
|
|
2260
2521
|
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
this.removeListener(type, listeners[listeners.length - 1]);
|
|
2522
|
+
EventEmitter.listenerCount = function(emitter, type) {
|
|
2523
|
+
if (typeof emitter.listenerCount === 'function') {
|
|
2524
|
+
return emitter.listenerCount(type);
|
|
2525
|
+
} else {
|
|
2526
|
+
return listenerCount.call(emitter, type);
|
|
2267
2527
|
}
|
|
2268
|
-
delete this._events[type];
|
|
2269
|
-
|
|
2270
|
-
return this;
|
|
2271
2528
|
};
|
|
2272
2529
|
|
|
2273
|
-
EventEmitter.prototype.
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
ret = [];
|
|
2277
|
-
else if (isFunction(this._events[type]))
|
|
2278
|
-
ret = [this._events[type]];
|
|
2279
|
-
else
|
|
2280
|
-
ret = this._events[type].slice();
|
|
2281
|
-
return ret;
|
|
2282
|
-
};
|
|
2530
|
+
EventEmitter.prototype.listenerCount = listenerCount;
|
|
2531
|
+
function listenerCount(type) {
|
|
2532
|
+
var events = this._events;
|
|
2283
2533
|
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
var evlistener = this._events[type];
|
|
2534
|
+
if (events) {
|
|
2535
|
+
var evlistener = events[type];
|
|
2287
2536
|
|
|
2288
|
-
if (
|
|
2537
|
+
if (typeof evlistener === 'function') {
|
|
2289
2538
|
return 1;
|
|
2290
|
-
else if (evlistener)
|
|
2539
|
+
} else if (evlistener) {
|
|
2291
2540
|
return evlistener.length;
|
|
2541
|
+
}
|
|
2292
2542
|
}
|
|
2543
|
+
|
|
2293
2544
|
return 0;
|
|
2294
|
-
}
|
|
2545
|
+
}
|
|
2295
2546
|
|
|
2296
|
-
EventEmitter.
|
|
2297
|
-
return
|
|
2547
|
+
EventEmitter.prototype.eventNames = function eventNames() {
|
|
2548
|
+
return this._eventsCount > 0 ? Reflect.ownKeys(this._events) : [];
|
|
2298
2549
|
};
|
|
2299
2550
|
|
|
2300
|
-
|
|
2301
|
-
|
|
2551
|
+
// About 1.5x faster than the two-arg version of Array#splice().
|
|
2552
|
+
function spliceOne(list, index) {
|
|
2553
|
+
for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1)
|
|
2554
|
+
list[i] = list[k];
|
|
2555
|
+
list.pop();
|
|
2302
2556
|
}
|
|
2303
2557
|
|
|
2304
|
-
function
|
|
2305
|
-
|
|
2558
|
+
function arrayClone(arr, n) {
|
|
2559
|
+
var copy = new Array(n);
|
|
2560
|
+
for (var i = 0; i < n; ++i)
|
|
2561
|
+
copy[i] = arr[i];
|
|
2562
|
+
return copy;
|
|
2306
2563
|
}
|
|
2307
2564
|
|
|
2308
|
-
function
|
|
2309
|
-
|
|
2565
|
+
function unwrapListeners(arr) {
|
|
2566
|
+
var ret = new Array(arr.length);
|
|
2567
|
+
for (var i = 0; i < ret.length; ++i) {
|
|
2568
|
+
ret[i] = arr[i].listener || arr[i];
|
|
2569
|
+
}
|
|
2570
|
+
return ret;
|
|
2310
2571
|
}
|
|
2311
2572
|
|
|
2312
|
-
function
|
|
2313
|
-
|
|
2573
|
+
function objectCreatePolyfill(proto) {
|
|
2574
|
+
var F = function() {};
|
|
2575
|
+
F.prototype = proto;
|
|
2576
|
+
return new F;
|
|
2577
|
+
}
|
|
2578
|
+
function objectKeysPolyfill(obj) {
|
|
2579
|
+
var keys = [];
|
|
2580
|
+
for (var k in obj) if (Object.prototype.hasOwnProperty.call(obj, k)) {
|
|
2581
|
+
keys.push(k);
|
|
2582
|
+
}
|
|
2583
|
+
return k;
|
|
2584
|
+
}
|
|
2585
|
+
function functionBindPolyfill(context) {
|
|
2586
|
+
var fn = this;
|
|
2587
|
+
return function () {
|
|
2588
|
+
return fn.apply(context, arguments);
|
|
2589
|
+
};
|
|
2314
2590
|
}
|
|
2315
2591
|
|
|
2316
2592
|
},{}],7:[function(require,module,exports){
|
|
@@ -2346,10 +2622,10 @@ function validateParams (params) {
|
|
|
2346
2622
|
return params
|
|
2347
2623
|
}
|
|
2348
2624
|
|
|
2349
|
-
},{"http":30,"url":
|
|
2625
|
+
},{"http":30,"url":37}],8:[function(require,module,exports){
|
|
2350
2626
|
exports.read = function (buffer, offset, isLE, mLen, nBytes) {
|
|
2351
2627
|
var e, m
|
|
2352
|
-
var eLen = nBytes * 8 - mLen - 1
|
|
2628
|
+
var eLen = (nBytes * 8) - mLen - 1
|
|
2353
2629
|
var eMax = (1 << eLen) - 1
|
|
2354
2630
|
var eBias = eMax >> 1
|
|
2355
2631
|
var nBits = -7
|
|
@@ -2362,12 +2638,12 @@ exports.read = function (buffer, offset, isLE, mLen, nBytes) {
|
|
|
2362
2638
|
e = s & ((1 << (-nBits)) - 1)
|
|
2363
2639
|
s >>= (-nBits)
|
|
2364
2640
|
nBits += eLen
|
|
2365
|
-
for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}
|
|
2641
|
+
for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}
|
|
2366
2642
|
|
|
2367
2643
|
m = e & ((1 << (-nBits)) - 1)
|
|
2368
2644
|
e >>= (-nBits)
|
|
2369
2645
|
nBits += mLen
|
|
2370
|
-
for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}
|
|
2646
|
+
for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}
|
|
2371
2647
|
|
|
2372
2648
|
if (e === 0) {
|
|
2373
2649
|
e = 1 - eBias
|
|
@@ -2382,7 +2658,7 @@ exports.read = function (buffer, offset, isLE, mLen, nBytes) {
|
|
|
2382
2658
|
|
|
2383
2659
|
exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
|
|
2384
2660
|
var e, m, c
|
|
2385
|
-
var eLen = nBytes * 8 - mLen - 1
|
|
2661
|
+
var eLen = (nBytes * 8) - mLen - 1
|
|
2386
2662
|
var eMax = (1 << eLen) - 1
|
|
2387
2663
|
var eBias = eMax >> 1
|
|
2388
2664
|
var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
|
|
@@ -2415,7 +2691,7 @@ exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
|
|
|
2415
2691
|
m = 0
|
|
2416
2692
|
e = eMax
|
|
2417
2693
|
} else if (e + eBias >= 1) {
|
|
2418
|
-
m = (value * c - 1) * Math.pow(2, mLen)
|
|
2694
|
+
m = ((value * c) - 1) * Math.pow(2, mLen)
|
|
2419
2695
|
e = e + eBias
|
|
2420
2696
|
} else {
|
|
2421
2697
|
m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
|
|
@@ -2461,7 +2737,7 @@ if (typeof Object.create === 'function') {
|
|
|
2461
2737
|
/*!
|
|
2462
2738
|
* Determine if an object is a Buffer
|
|
2463
2739
|
*
|
|
2464
|
-
* @author Feross Aboukhadijeh <
|
|
2740
|
+
* @author Feross Aboukhadijeh <https://feross.org>
|
|
2465
2741
|
* @license MIT
|
|
2466
2742
|
*/
|
|
2467
2743
|
|
|
@@ -5281,9 +5557,9 @@ module.exports = isEqual;
|
|
|
5281
5557
|
if (!process.version ||
|
|
5282
5558
|
process.version.indexOf('v0.') === 0 ||
|
|
5283
5559
|
process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {
|
|
5284
|
-
module.exports = nextTick;
|
|
5560
|
+
module.exports = { nextTick: nextTick };
|
|
5285
5561
|
} else {
|
|
5286
|
-
module.exports = process
|
|
5562
|
+
module.exports = process
|
|
5287
5563
|
}
|
|
5288
5564
|
|
|
5289
5565
|
function nextTick(fn, arg1, arg2, arg3) {
|
|
@@ -5320,6 +5596,7 @@ function nextTick(fn, arg1, arg2, arg3) {
|
|
|
5320
5596
|
}
|
|
5321
5597
|
}
|
|
5322
5598
|
|
|
5599
|
+
|
|
5323
5600
|
}).call(this,require('_process'))
|
|
5324
5601
|
},{"_process":15}],15:[function(require,module,exports){
|
|
5325
5602
|
// shim for using process in browser
|
|
@@ -6254,7 +6531,7 @@ exports.encode = exports.stringify = require('./encode');
|
|
|
6254
6531
|
|
|
6255
6532
|
/*<replacement>*/
|
|
6256
6533
|
|
|
6257
|
-
var
|
|
6534
|
+
var pna = require('process-nextick-args');
|
|
6258
6535
|
/*</replacement>*/
|
|
6259
6536
|
|
|
6260
6537
|
/*<replacement>*/
|
|
@@ -6278,10 +6555,13 @@ var Writable = require('./_stream_writable');
|
|
|
6278
6555
|
|
|
6279
6556
|
util.inherits(Duplex, Readable);
|
|
6280
6557
|
|
|
6281
|
-
|
|
6282
|
-
|
|
6283
|
-
var
|
|
6284
|
-
|
|
6558
|
+
{
|
|
6559
|
+
// avoid scope creep, the keys array can then be collected
|
|
6560
|
+
var keys = objectKeys(Writable.prototype);
|
|
6561
|
+
for (var v = 0; v < keys.length; v++) {
|
|
6562
|
+
var method = keys[v];
|
|
6563
|
+
if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
|
|
6564
|
+
}
|
|
6285
6565
|
}
|
|
6286
6566
|
|
|
6287
6567
|
function Duplex(options) {
|
|
@@ -6300,6 +6580,16 @@ function Duplex(options) {
|
|
|
6300
6580
|
this.once('end', onend);
|
|
6301
6581
|
}
|
|
6302
6582
|
|
|
6583
|
+
Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', {
|
|
6584
|
+
// making it explicit this property is not enumerable
|
|
6585
|
+
// because otherwise some prototype manipulation in
|
|
6586
|
+
// userland will fail
|
|
6587
|
+
enumerable: false,
|
|
6588
|
+
get: function () {
|
|
6589
|
+
return this._writableState.highWaterMark;
|
|
6590
|
+
}
|
|
6591
|
+
});
|
|
6592
|
+
|
|
6303
6593
|
// the no-half-open enforcer
|
|
6304
6594
|
function onend() {
|
|
6305
6595
|
// if we allow half-open state, or if the writable side ended,
|
|
@@ -6308,7 +6598,7 @@ function onend() {
|
|
|
6308
6598
|
|
|
6309
6599
|
// no more data can be written.
|
|
6310
6600
|
// But allow more writes to happen in this tick.
|
|
6311
|
-
|
|
6601
|
+
pna.nextTick(onEndNT, this);
|
|
6312
6602
|
}
|
|
6313
6603
|
|
|
6314
6604
|
function onEndNT(self) {
|
|
@@ -6340,14 +6630,8 @@ Duplex.prototype._destroy = function (err, cb) {
|
|
|
6340
6630
|
this.push(null);
|
|
6341
6631
|
this.end();
|
|
6342
6632
|
|
|
6343
|
-
|
|
6633
|
+
pna.nextTick(cb, err);
|
|
6344
6634
|
};
|
|
6345
|
-
|
|
6346
|
-
function forEach(xs, f) {
|
|
6347
|
-
for (var i = 0, l = xs.length; i < l; i++) {
|
|
6348
|
-
f(xs[i], i);
|
|
6349
|
-
}
|
|
6350
|
-
}
|
|
6351
6635
|
},{"./_stream_readable":22,"./_stream_writable":24,"core-util-is":5,"inherits":9,"process-nextick-args":14}],21:[function(require,module,exports){
|
|
6352
6636
|
// Copyright Joyent, Inc. and other Node contributors.
|
|
6353
6637
|
//
|
|
@@ -6423,7 +6707,7 @@ PassThrough.prototype._transform = function (chunk, encoding, cb) {
|
|
|
6423
6707
|
|
|
6424
6708
|
/*<replacement>*/
|
|
6425
6709
|
|
|
6426
|
-
var
|
|
6710
|
+
var pna = require('process-nextick-args');
|
|
6427
6711
|
/*</replacement>*/
|
|
6428
6712
|
|
|
6429
6713
|
module.exports = Readable;
|
|
@@ -6450,9 +6734,8 @@ var EElistenerCount = function (emitter, type) {
|
|
|
6450
6734
|
var Stream = require('./internal/streams/stream');
|
|
6451
6735
|
/*</replacement>*/
|
|
6452
6736
|
|
|
6453
|
-
// TODO(bmeurer): Change this back to const once hole checks are
|
|
6454
|
-
// properly optimized away early in Ignition+TurboFan.
|
|
6455
6737
|
/*<replacement>*/
|
|
6738
|
+
|
|
6456
6739
|
var Buffer = require('safe-buffer').Buffer;
|
|
6457
6740
|
var OurUint8Array = global.Uint8Array || function () {};
|
|
6458
6741
|
function _uint8ArrayToBuffer(chunk) {
|
|
@@ -6461,6 +6744,7 @@ function _uint8ArrayToBuffer(chunk) {
|
|
|
6461
6744
|
function _isUint8Array(obj) {
|
|
6462
6745
|
return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
|
|
6463
6746
|
}
|
|
6747
|
+
|
|
6464
6748
|
/*</replacement>*/
|
|
6465
6749
|
|
|
6466
6750
|
/*<replacement>*/
|
|
@@ -6489,15 +6773,13 @@ var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];
|
|
|
6489
6773
|
function prependListener(emitter, event, fn) {
|
|
6490
6774
|
// Sadly this is not cacheable as some libraries bundle their own
|
|
6491
6775
|
// event emitter implementation with them.
|
|
6492
|
-
if (typeof emitter.prependListener === 'function')
|
|
6493
|
-
|
|
6494
|
-
|
|
6495
|
-
|
|
6496
|
-
|
|
6497
|
-
|
|
6498
|
-
|
|
6499
|
-
if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];
|
|
6500
|
-
}
|
|
6776
|
+
if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);
|
|
6777
|
+
|
|
6778
|
+
// This is a hack to make sure that our error handler is attached before any
|
|
6779
|
+
// userland ones. NEVER DO THIS. This is here only because this code needs
|
|
6780
|
+
// to continue to work with older versions of Node.js that do not include
|
|
6781
|
+
// the prependListener() method. The goal is to eventually remove this hack.
|
|
6782
|
+
if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];
|
|
6501
6783
|
}
|
|
6502
6784
|
|
|
6503
6785
|
function ReadableState(options, stream) {
|
|
@@ -6505,17 +6787,26 @@ function ReadableState(options, stream) {
|
|
|
6505
6787
|
|
|
6506
6788
|
options = options || {};
|
|
6507
6789
|
|
|
6790
|
+
// Duplex streams are both readable and writable, but share
|
|
6791
|
+
// the same options object.
|
|
6792
|
+
// However, some cases require setting options to different
|
|
6793
|
+
// values for the readable and the writable sides of the duplex stream.
|
|
6794
|
+
// These options can be provided separately as readableXXX and writableXXX.
|
|
6795
|
+
var isDuplex = stream instanceof Duplex;
|
|
6796
|
+
|
|
6508
6797
|
// object stream flag. Used to make read(n) ignore n and to
|
|
6509
6798
|
// make all the buffer merging and length checks go away
|
|
6510
6799
|
this.objectMode = !!options.objectMode;
|
|
6511
6800
|
|
|
6512
|
-
if (
|
|
6801
|
+
if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
|
|
6513
6802
|
|
|
6514
6803
|
// the point at which it stops calling _read() to fill the buffer
|
|
6515
6804
|
// Note: 0 is a valid value, means "don't call _read preemptively ever"
|
|
6516
6805
|
var hwm = options.highWaterMark;
|
|
6806
|
+
var readableHwm = options.readableHighWaterMark;
|
|
6517
6807
|
var defaultHwm = this.objectMode ? 16 : 16 * 1024;
|
|
6518
|
-
|
|
6808
|
+
|
|
6809
|
+
if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm;
|
|
6519
6810
|
|
|
6520
6811
|
// cast to ints.
|
|
6521
6812
|
this.highWaterMark = Math.floor(this.highWaterMark);
|
|
@@ -6888,7 +7179,7 @@ function emitReadable(stream) {
|
|
|
6888
7179
|
if (!state.emittedReadable) {
|
|
6889
7180
|
debug('emitReadable', state.flowing);
|
|
6890
7181
|
state.emittedReadable = true;
|
|
6891
|
-
if (state.sync)
|
|
7182
|
+
if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream);
|
|
6892
7183
|
}
|
|
6893
7184
|
}
|
|
6894
7185
|
|
|
@@ -6907,7 +7198,7 @@ function emitReadable_(stream) {
|
|
|
6907
7198
|
function maybeReadMore(stream, state) {
|
|
6908
7199
|
if (!state.readingMore) {
|
|
6909
7200
|
state.readingMore = true;
|
|
6910
|
-
|
|
7201
|
+
pna.nextTick(maybeReadMore_, stream, state);
|
|
6911
7202
|
}
|
|
6912
7203
|
}
|
|
6913
7204
|
|
|
@@ -6952,7 +7243,7 @@ Readable.prototype.pipe = function (dest, pipeOpts) {
|
|
|
6952
7243
|
var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
|
|
6953
7244
|
|
|
6954
7245
|
var endFn = doEnd ? onend : unpipe;
|
|
6955
|
-
if (state.endEmitted)
|
|
7246
|
+
if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn);
|
|
6956
7247
|
|
|
6957
7248
|
dest.on('unpipe', onunpipe);
|
|
6958
7249
|
function onunpipe(readable, unpipeInfo) {
|
|
@@ -7142,7 +7433,7 @@ Readable.prototype.on = function (ev, fn) {
|
|
|
7142
7433
|
state.readableListening = state.needReadable = true;
|
|
7143
7434
|
state.emittedReadable = false;
|
|
7144
7435
|
if (!state.reading) {
|
|
7145
|
-
|
|
7436
|
+
pna.nextTick(nReadingNextTick, this);
|
|
7146
7437
|
} else if (state.length) {
|
|
7147
7438
|
emitReadable(this);
|
|
7148
7439
|
}
|
|
@@ -7173,7 +7464,7 @@ Readable.prototype.resume = function () {
|
|
|
7173
7464
|
function resume(stream, state) {
|
|
7174
7465
|
if (!state.resumeScheduled) {
|
|
7175
7466
|
state.resumeScheduled = true;
|
|
7176
|
-
|
|
7467
|
+
pna.nextTick(resume_, stream, state);
|
|
7177
7468
|
}
|
|
7178
7469
|
}
|
|
7179
7470
|
|
|
@@ -7210,18 +7501,19 @@ function flow(stream) {
|
|
|
7210
7501
|
// This is *not* part of the readable stream interface.
|
|
7211
7502
|
// It is an ugly unfortunate mess of history.
|
|
7212
7503
|
Readable.prototype.wrap = function (stream) {
|
|
7504
|
+
var _this = this;
|
|
7505
|
+
|
|
7213
7506
|
var state = this._readableState;
|
|
7214
7507
|
var paused = false;
|
|
7215
7508
|
|
|
7216
|
-
var self = this;
|
|
7217
7509
|
stream.on('end', function () {
|
|
7218
7510
|
debug('wrapped end');
|
|
7219
7511
|
if (state.decoder && !state.ended) {
|
|
7220
7512
|
var chunk = state.decoder.end();
|
|
7221
|
-
if (chunk && chunk.length)
|
|
7513
|
+
if (chunk && chunk.length) _this.push(chunk);
|
|
7222
7514
|
}
|
|
7223
7515
|
|
|
7224
|
-
|
|
7516
|
+
_this.push(null);
|
|
7225
7517
|
});
|
|
7226
7518
|
|
|
7227
7519
|
stream.on('data', function (chunk) {
|
|
@@ -7231,7 +7523,7 @@ Readable.prototype.wrap = function (stream) {
|
|
|
7231
7523
|
// don't skip over falsy values in objectMode
|
|
7232
7524
|
if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;
|
|
7233
7525
|
|
|
7234
|
-
var ret =
|
|
7526
|
+
var ret = _this.push(chunk);
|
|
7235
7527
|
if (!ret) {
|
|
7236
7528
|
paused = true;
|
|
7237
7529
|
stream.pause();
|
|
@@ -7252,12 +7544,12 @@ Readable.prototype.wrap = function (stream) {
|
|
|
7252
7544
|
|
|
7253
7545
|
// proxy certain important events.
|
|
7254
7546
|
for (var n = 0; n < kProxyEvents.length; n++) {
|
|
7255
|
-
stream.on(kProxyEvents[n],
|
|
7547
|
+
stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
|
|
7256
7548
|
}
|
|
7257
7549
|
|
|
7258
7550
|
// when we try to consume some more bytes, simply unpause the
|
|
7259
7551
|
// underlying stream.
|
|
7260
|
-
|
|
7552
|
+
this._read = function (n) {
|
|
7261
7553
|
debug('wrapped _read', n);
|
|
7262
7554
|
if (paused) {
|
|
7263
7555
|
paused = false;
|
|
@@ -7265,9 +7557,19 @@ Readable.prototype.wrap = function (stream) {
|
|
|
7265
7557
|
}
|
|
7266
7558
|
};
|
|
7267
7559
|
|
|
7268
|
-
return
|
|
7560
|
+
return this;
|
|
7269
7561
|
};
|
|
7270
7562
|
|
|
7563
|
+
Object.defineProperty(Readable.prototype, 'readableHighWaterMark', {
|
|
7564
|
+
// making it explicit this property is not enumerable
|
|
7565
|
+
// because otherwise some prototype manipulation in
|
|
7566
|
+
// userland will fail
|
|
7567
|
+
enumerable: false,
|
|
7568
|
+
get: function () {
|
|
7569
|
+
return this._readableState.highWaterMark;
|
|
7570
|
+
}
|
|
7571
|
+
});
|
|
7572
|
+
|
|
7271
7573
|
// exposed for testing purposes only.
|
|
7272
7574
|
Readable._fromList = fromList;
|
|
7273
7575
|
|
|
@@ -7380,7 +7682,7 @@ function endReadable(stream) {
|
|
|
7380
7682
|
|
|
7381
7683
|
if (!state.endEmitted) {
|
|
7382
7684
|
state.ended = true;
|
|
7383
|
-
|
|
7685
|
+
pna.nextTick(endReadableNT, state, stream);
|
|
7384
7686
|
}
|
|
7385
7687
|
}
|
|
7386
7688
|
|
|
@@ -7393,12 +7695,6 @@ function endReadableNT(state, stream) {
|
|
|
7393
7695
|
}
|
|
7394
7696
|
}
|
|
7395
7697
|
|
|
7396
|
-
function forEach(xs, f) {
|
|
7397
|
-
for (var i = 0, l = xs.length; i < l; i++) {
|
|
7398
|
-
f(xs[i], i);
|
|
7399
|
-
}
|
|
7400
|
-
}
|
|
7401
|
-
|
|
7402
7698
|
function indexOf(xs, x) {
|
|
7403
7699
|
for (var i = 0, l = xs.length; i < l; i++) {
|
|
7404
7700
|
if (xs[i] === x) return i;
|
|
@@ -7483,39 +7779,28 @@ util.inherits = require('inherits');
|
|
|
7483
7779
|
|
|
7484
7780
|
util.inherits(Transform, Duplex);
|
|
7485
7781
|
|
|
7486
|
-
function
|
|
7487
|
-
|
|
7488
|
-
return afterTransform(stream, er, data);
|
|
7489
|
-
};
|
|
7490
|
-
|
|
7491
|
-
this.needTransform = false;
|
|
7492
|
-
this.transforming = false;
|
|
7493
|
-
this.writecb = null;
|
|
7494
|
-
this.writechunk = null;
|
|
7495
|
-
this.writeencoding = null;
|
|
7496
|
-
}
|
|
7497
|
-
|
|
7498
|
-
function afterTransform(stream, er, data) {
|
|
7499
|
-
var ts = stream._transformState;
|
|
7782
|
+
function afterTransform(er, data) {
|
|
7783
|
+
var ts = this._transformState;
|
|
7500
7784
|
ts.transforming = false;
|
|
7501
7785
|
|
|
7502
7786
|
var cb = ts.writecb;
|
|
7503
7787
|
|
|
7504
7788
|
if (!cb) {
|
|
7505
|
-
return
|
|
7789
|
+
return this.emit('error', new Error('write callback called multiple times'));
|
|
7506
7790
|
}
|
|
7507
7791
|
|
|
7508
7792
|
ts.writechunk = null;
|
|
7509
7793
|
ts.writecb = null;
|
|
7510
7794
|
|
|
7511
|
-
if (data
|
|
7795
|
+
if (data != null) // single equals check for both `null` and `undefined`
|
|
7796
|
+
this.push(data);
|
|
7512
7797
|
|
|
7513
7798
|
cb(er);
|
|
7514
7799
|
|
|
7515
|
-
var rs =
|
|
7800
|
+
var rs = this._readableState;
|
|
7516
7801
|
rs.reading = false;
|
|
7517
7802
|
if (rs.needReadable || rs.length < rs.highWaterMark) {
|
|
7518
|
-
|
|
7803
|
+
this._read(rs.highWaterMark);
|
|
7519
7804
|
}
|
|
7520
7805
|
}
|
|
7521
7806
|
|
|
@@ -7524,9 +7809,14 @@ function Transform(options) {
|
|
|
7524
7809
|
|
|
7525
7810
|
Duplex.call(this, options);
|
|
7526
7811
|
|
|
7527
|
-
this._transformState =
|
|
7528
|
-
|
|
7529
|
-
|
|
7812
|
+
this._transformState = {
|
|
7813
|
+
afterTransform: afterTransform.bind(this),
|
|
7814
|
+
needTransform: false,
|
|
7815
|
+
transforming: false,
|
|
7816
|
+
writecb: null,
|
|
7817
|
+
writechunk: null,
|
|
7818
|
+
writeencoding: null
|
|
7819
|
+
};
|
|
7530
7820
|
|
|
7531
7821
|
// start out asking for a readable event once data is transformed.
|
|
7532
7822
|
this._readableState.needReadable = true;
|
|
@@ -7543,11 +7833,19 @@ function Transform(options) {
|
|
|
7543
7833
|
}
|
|
7544
7834
|
|
|
7545
7835
|
// When the writable side finishes, then flush out anything remaining.
|
|
7546
|
-
this.
|
|
7547
|
-
|
|
7548
|
-
|
|
7549
|
-
|
|
7550
|
-
|
|
7836
|
+
this.on('prefinish', prefinish);
|
|
7837
|
+
}
|
|
7838
|
+
|
|
7839
|
+
function prefinish() {
|
|
7840
|
+
var _this = this;
|
|
7841
|
+
|
|
7842
|
+
if (typeof this._flush === 'function') {
|
|
7843
|
+
this._flush(function (er, data) {
|
|
7844
|
+
done(_this, er, data);
|
|
7845
|
+
});
|
|
7846
|
+
} else {
|
|
7847
|
+
done(this, null, null);
|
|
7848
|
+
}
|
|
7551
7849
|
}
|
|
7552
7850
|
|
|
7553
7851
|
Transform.prototype.push = function (chunk, encoding) {
|
|
@@ -7597,32 +7895,30 @@ Transform.prototype._read = function (n) {
|
|
|
7597
7895
|
};
|
|
7598
7896
|
|
|
7599
7897
|
Transform.prototype._destroy = function (err, cb) {
|
|
7600
|
-
var
|
|
7898
|
+
var _this2 = this;
|
|
7601
7899
|
|
|
7602
7900
|
Duplex.prototype._destroy.call(this, err, function (err2) {
|
|
7603
7901
|
cb(err2);
|
|
7604
|
-
|
|
7902
|
+
_this2.emit('close');
|
|
7605
7903
|
});
|
|
7606
7904
|
};
|
|
7607
7905
|
|
|
7608
7906
|
function done(stream, er, data) {
|
|
7609
7907
|
if (er) return stream.emit('error', er);
|
|
7610
7908
|
|
|
7611
|
-
if (data
|
|
7909
|
+
if (data != null) // single equals check for both `null` and `undefined`
|
|
7910
|
+
stream.push(data);
|
|
7612
7911
|
|
|
7613
7912
|
// if there's nothing in the write buffer, then that means
|
|
7614
7913
|
// that nothing more will ever be provided
|
|
7615
|
-
|
|
7616
|
-
var ts = stream._transformState;
|
|
7617
|
-
|
|
7618
|
-
if (ws.length) throw new Error('Calling transform done when ws.length != 0');
|
|
7914
|
+
if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0');
|
|
7619
7915
|
|
|
7620
|
-
if (
|
|
7916
|
+
if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming');
|
|
7621
7917
|
|
|
7622
7918
|
return stream.push(null);
|
|
7623
7919
|
}
|
|
7624
7920
|
},{"./_stream_duplex":20,"core-util-is":5,"inherits":9}],24:[function(require,module,exports){
|
|
7625
|
-
(function (process,global){
|
|
7921
|
+
(function (process,global,setImmediate){
|
|
7626
7922
|
// Copyright Joyent, Inc. and other Node contributors.
|
|
7627
7923
|
//
|
|
7628
7924
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
@@ -7652,7 +7948,7 @@ function done(stream, er, data) {
|
|
|
7652
7948
|
|
|
7653
7949
|
/*<replacement>*/
|
|
7654
7950
|
|
|
7655
|
-
var
|
|
7951
|
+
var pna = require('process-nextick-args');
|
|
7656
7952
|
/*</replacement>*/
|
|
7657
7953
|
|
|
7658
7954
|
module.exports = Writable;
|
|
@@ -7679,7 +7975,7 @@ function CorkedRequest(state) {
|
|
|
7679
7975
|
/* </replacement> */
|
|
7680
7976
|
|
|
7681
7977
|
/*<replacement>*/
|
|
7682
|
-
var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate :
|
|
7978
|
+
var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;
|
|
7683
7979
|
/*</replacement>*/
|
|
7684
7980
|
|
|
7685
7981
|
/*<replacement>*/
|
|
@@ -7704,6 +8000,7 @@ var Stream = require('./internal/streams/stream');
|
|
|
7704
8000
|
/*</replacement>*/
|
|
7705
8001
|
|
|
7706
8002
|
/*<replacement>*/
|
|
8003
|
+
|
|
7707
8004
|
var Buffer = require('safe-buffer').Buffer;
|
|
7708
8005
|
var OurUint8Array = global.Uint8Array || function () {};
|
|
7709
8006
|
function _uint8ArrayToBuffer(chunk) {
|
|
@@ -7712,6 +8009,7 @@ function _uint8ArrayToBuffer(chunk) {
|
|
|
7712
8009
|
function _isUint8Array(obj) {
|
|
7713
8010
|
return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
|
|
7714
8011
|
}
|
|
8012
|
+
|
|
7715
8013
|
/*</replacement>*/
|
|
7716
8014
|
|
|
7717
8015
|
var destroyImpl = require('./internal/streams/destroy');
|
|
@@ -7725,18 +8023,27 @@ function WritableState(options, stream) {
|
|
|
7725
8023
|
|
|
7726
8024
|
options = options || {};
|
|
7727
8025
|
|
|
8026
|
+
// Duplex streams are both readable and writable, but share
|
|
8027
|
+
// the same options object.
|
|
8028
|
+
// However, some cases require setting options to different
|
|
8029
|
+
// values for the readable and the writable sides of the duplex stream.
|
|
8030
|
+
// These options can be provided separately as readableXXX and writableXXX.
|
|
8031
|
+
var isDuplex = stream instanceof Duplex;
|
|
8032
|
+
|
|
7728
8033
|
// object stream flag to indicate whether or not this stream
|
|
7729
8034
|
// contains buffers or objects.
|
|
7730
8035
|
this.objectMode = !!options.objectMode;
|
|
7731
8036
|
|
|
7732
|
-
if (
|
|
8037
|
+
if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
|
|
7733
8038
|
|
|
7734
8039
|
// the point at which write() starts returning false
|
|
7735
8040
|
// Note: 0 is a valid value, means that we always return false if
|
|
7736
8041
|
// the entire buffer is not flushed immediately on write()
|
|
7737
8042
|
var hwm = options.highWaterMark;
|
|
8043
|
+
var writableHwm = options.writableHighWaterMark;
|
|
7738
8044
|
var defaultHwm = this.objectMode ? 16 : 16 * 1024;
|
|
7739
|
-
|
|
8045
|
+
|
|
8046
|
+
if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm;
|
|
7740
8047
|
|
|
7741
8048
|
// cast to ints.
|
|
7742
8049
|
this.highWaterMark = Math.floor(this.highWaterMark);
|
|
@@ -7850,6 +8157,7 @@ if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.protot
|
|
|
7850
8157
|
Object.defineProperty(Writable, Symbol.hasInstance, {
|
|
7851
8158
|
value: function (object) {
|
|
7852
8159
|
if (realHasInstance.call(this, object)) return true;
|
|
8160
|
+
if (this !== Writable) return false;
|
|
7853
8161
|
|
|
7854
8162
|
return object && object._writableState instanceof WritableState;
|
|
7855
8163
|
}
|
|
@@ -7901,7 +8209,7 @@ function writeAfterEnd(stream, cb) {
|
|
|
7901
8209
|
var er = new Error('write after end');
|
|
7902
8210
|
// TODO: defer error events consistently everywhere, not just the cb
|
|
7903
8211
|
stream.emit('error', er);
|
|
7904
|
-
|
|
8212
|
+
pna.nextTick(cb, er);
|
|
7905
8213
|
}
|
|
7906
8214
|
|
|
7907
8215
|
// Checks that a user-supplied chunk is valid, especially for the particular
|
|
@@ -7918,7 +8226,7 @@ function validChunk(stream, state, chunk, cb) {
|
|
|
7918
8226
|
}
|
|
7919
8227
|
if (er) {
|
|
7920
8228
|
stream.emit('error', er);
|
|
7921
|
-
|
|
8229
|
+
pna.nextTick(cb, er);
|
|
7922
8230
|
valid = false;
|
|
7923
8231
|
}
|
|
7924
8232
|
return valid;
|
|
@@ -7927,7 +8235,7 @@ function validChunk(stream, state, chunk, cb) {
|
|
|
7927
8235
|
Writable.prototype.write = function (chunk, encoding, cb) {
|
|
7928
8236
|
var state = this._writableState;
|
|
7929
8237
|
var ret = false;
|
|
7930
|
-
var isBuf = _isUint8Array(chunk)
|
|
8238
|
+
var isBuf = !state.objectMode && _isUint8Array(chunk);
|
|
7931
8239
|
|
|
7932
8240
|
if (isBuf && !Buffer.isBuffer(chunk)) {
|
|
7933
8241
|
chunk = _uint8ArrayToBuffer(chunk);
|
|
@@ -7981,6 +8289,16 @@ function decodeChunk(state, chunk, encoding) {
|
|
|
7981
8289
|
return chunk;
|
|
7982
8290
|
}
|
|
7983
8291
|
|
|
8292
|
+
Object.defineProperty(Writable.prototype, 'writableHighWaterMark', {
|
|
8293
|
+
// making it explicit this property is not enumerable
|
|
8294
|
+
// because otherwise some prototype manipulation in
|
|
8295
|
+
// userland will fail
|
|
8296
|
+
enumerable: false,
|
|
8297
|
+
get: function () {
|
|
8298
|
+
return this._writableState.highWaterMark;
|
|
8299
|
+
}
|
|
8300
|
+
});
|
|
8301
|
+
|
|
7984
8302
|
// if we're already writing something, then just put this
|
|
7985
8303
|
// in the queue, and wait our turn. Otherwise, call _write
|
|
7986
8304
|
// If we return false, then we need a drain event, so set that flag.
|
|
@@ -8038,10 +8356,10 @@ function onwriteError(stream, state, sync, er, cb) {
|
|
|
8038
8356
|
if (sync) {
|
|
8039
8357
|
// defer the callback if we are being called synchronously
|
|
8040
8358
|
// to avoid piling up things on the stack
|
|
8041
|
-
|
|
8359
|
+
pna.nextTick(cb, er);
|
|
8042
8360
|
// this can emit finish, and it will always happen
|
|
8043
8361
|
// after error
|
|
8044
|
-
|
|
8362
|
+
pna.nextTick(finishMaybe, stream, state);
|
|
8045
8363
|
stream._writableState.errorEmitted = true;
|
|
8046
8364
|
stream.emit('error', er);
|
|
8047
8365
|
} else {
|
|
@@ -8139,6 +8457,7 @@ function clearBuffer(stream, state) {
|
|
|
8139
8457
|
} else {
|
|
8140
8458
|
state.corkedRequestsFree = new CorkedRequest(state);
|
|
8141
8459
|
}
|
|
8460
|
+
state.bufferedRequestCount = 0;
|
|
8142
8461
|
} else {
|
|
8143
8462
|
// Slow case, write chunks one-by-one
|
|
8144
8463
|
while (entry) {
|
|
@@ -8149,6 +8468,7 @@ function clearBuffer(stream, state) {
|
|
|
8149
8468
|
|
|
8150
8469
|
doWrite(stream, state, false, len, chunk, encoding, cb);
|
|
8151
8470
|
entry = entry.next;
|
|
8471
|
+
state.bufferedRequestCount--;
|
|
8152
8472
|
// if we didn't call the onwrite immediately, then
|
|
8153
8473
|
// it means that we need to wait until it does.
|
|
8154
8474
|
// also, that means that the chunk and cb are currently
|
|
@@ -8161,7 +8481,6 @@ function clearBuffer(stream, state) {
|
|
|
8161
8481
|
if (entry === null) state.lastBufferedRequest = null;
|
|
8162
8482
|
}
|
|
8163
8483
|
|
|
8164
|
-
state.bufferedRequestCount = 0;
|
|
8165
8484
|
state.bufferedRequest = entry;
|
|
8166
8485
|
state.bufferProcessing = false;
|
|
8167
8486
|
}
|
|
@@ -8215,7 +8534,7 @@ function prefinish(stream, state) {
|
|
|
8215
8534
|
if (typeof stream._final === 'function') {
|
|
8216
8535
|
state.pendingcb++;
|
|
8217
8536
|
state.finalCalled = true;
|
|
8218
|
-
|
|
8537
|
+
pna.nextTick(callFinal, stream, state);
|
|
8219
8538
|
} else {
|
|
8220
8539
|
state.prefinished = true;
|
|
8221
8540
|
stream.emit('prefinish');
|
|
@@ -8239,7 +8558,7 @@ function endWritable(stream, state, cb) {
|
|
|
8239
8558
|
state.ending = true;
|
|
8240
8559
|
finishMaybe(stream, state);
|
|
8241
8560
|
if (cb) {
|
|
8242
|
-
if (state.finished)
|
|
8561
|
+
if (state.finished) pna.nextTick(cb);else stream.once('finish', cb);
|
|
8243
8562
|
}
|
|
8244
8563
|
state.ended = true;
|
|
8245
8564
|
stream.writable = false;
|
|
@@ -8287,16 +8606,14 @@ Writable.prototype._destroy = function (err, cb) {
|
|
|
8287
8606
|
this.end();
|
|
8288
8607
|
cb(err);
|
|
8289
8608
|
};
|
|
8290
|
-
}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
8291
|
-
},{"./_stream_duplex":20,"./internal/streams/destroy":26,"./internal/streams/stream":27,"_process":15,"core-util-is":5,"inherits":9,"process-nextick-args":14,"safe-buffer":29,"util-deprecate":
|
|
8609
|
+
}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("timers").setImmediate)
|
|
8610
|
+
},{"./_stream_duplex":20,"./internal/streams/destroy":26,"./internal/streams/stream":27,"_process":15,"core-util-is":5,"inherits":9,"process-nextick-args":14,"safe-buffer":29,"timers":35,"util-deprecate":39}],25:[function(require,module,exports){
|
|
8292
8611
|
'use strict';
|
|
8293
8612
|
|
|
8294
|
-
/*<replacement>*/
|
|
8295
|
-
|
|
8296
8613
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8297
8614
|
|
|
8298
8615
|
var Buffer = require('safe-buffer').Buffer;
|
|
8299
|
-
|
|
8616
|
+
var util = require('util');
|
|
8300
8617
|
|
|
8301
8618
|
function copyBuffer(src, target, offset) {
|
|
8302
8619
|
src.copy(target, offset);
|
|
@@ -8363,12 +8680,19 @@ module.exports = function () {
|
|
|
8363
8680
|
|
|
8364
8681
|
return BufferList;
|
|
8365
8682
|
}();
|
|
8366
|
-
|
|
8683
|
+
|
|
8684
|
+
if (util && util.inspect && util.inspect.custom) {
|
|
8685
|
+
module.exports.prototype[util.inspect.custom] = function () {
|
|
8686
|
+
var obj = util.inspect({ length: this.length });
|
|
8687
|
+
return this.constructor.name + ' ' + obj;
|
|
8688
|
+
};
|
|
8689
|
+
}
|
|
8690
|
+
},{"safe-buffer":29,"util":2}],26:[function(require,module,exports){
|
|
8367
8691
|
'use strict';
|
|
8368
8692
|
|
|
8369
8693
|
/*<replacement>*/
|
|
8370
8694
|
|
|
8371
|
-
var
|
|
8695
|
+
var pna = require('process-nextick-args');
|
|
8372
8696
|
/*</replacement>*/
|
|
8373
8697
|
|
|
8374
8698
|
// undocumented cb() API, needed for core, not for public API
|
|
@@ -8382,9 +8706,9 @@ function destroy(err, cb) {
|
|
|
8382
8706
|
if (cb) {
|
|
8383
8707
|
cb(err);
|
|
8384
8708
|
} else if (err && (!this._writableState || !this._writableState.errorEmitted)) {
|
|
8385
|
-
|
|
8709
|
+
pna.nextTick(emitErrorNT, this, err);
|
|
8386
8710
|
}
|
|
8387
|
-
return;
|
|
8711
|
+
return this;
|
|
8388
8712
|
}
|
|
8389
8713
|
|
|
8390
8714
|
// we set destroyed to true before firing error callbacks in order
|
|
@@ -8401,7 +8725,7 @@ function destroy(err, cb) {
|
|
|
8401
8725
|
|
|
8402
8726
|
this._destroy(err || null, function (err) {
|
|
8403
8727
|
if (!cb && err) {
|
|
8404
|
-
|
|
8728
|
+
pna.nextTick(emitErrorNT, _this, err);
|
|
8405
8729
|
if (_this._writableState) {
|
|
8406
8730
|
_this._writableState.errorEmitted = true;
|
|
8407
8731
|
}
|
|
@@ -8409,6 +8733,8 @@ function destroy(err, cb) {
|
|
|
8409
8733
|
cb(err);
|
|
8410
8734
|
}
|
|
8411
8735
|
});
|
|
8736
|
+
|
|
8737
|
+
return this;
|
|
8412
8738
|
}
|
|
8413
8739
|
|
|
8414
8740
|
function undestroy() {
|
|
@@ -8515,6 +8841,7 @@ SafeBuffer.allocUnsafeSlow = function (size) {
|
|
|
8515
8841
|
},{"buffer":3}],30:[function(require,module,exports){
|
|
8516
8842
|
(function (global){
|
|
8517
8843
|
var ClientRequest = require('./lib/request')
|
|
8844
|
+
var response = require('./lib/response')
|
|
8518
8845
|
var extend = require('xtend')
|
|
8519
8846
|
var statusCodes = require('builtin-status-codes')
|
|
8520
8847
|
var url = require('url')
|
|
@@ -8560,9 +8887,14 @@ http.get = function get (opts, cb) {
|
|
|
8560
8887
|
return req
|
|
8561
8888
|
}
|
|
8562
8889
|
|
|
8890
|
+
http.ClientRequest = ClientRequest
|
|
8891
|
+
http.IncomingMessage = response.IncomingMessage
|
|
8892
|
+
|
|
8563
8893
|
http.Agent = function () {}
|
|
8564
8894
|
http.Agent.defaultMaxSockets = 4
|
|
8565
8895
|
|
|
8896
|
+
http.globalAgent = new http.Agent()
|
|
8897
|
+
|
|
8566
8898
|
http.STATUS_CODES = statusCodes
|
|
8567
8899
|
|
|
8568
8900
|
http.METHODS = [
|
|
@@ -8594,10 +8926,14 @@ http.METHODS = [
|
|
|
8594
8926
|
'UNSUBSCRIBE'
|
|
8595
8927
|
]
|
|
8596
8928
|
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
8597
|
-
},{"./lib/request":32,"builtin-status-codes":4,"url":
|
|
8929
|
+
},{"./lib/request":32,"./lib/response":33,"builtin-status-codes":4,"url":37,"xtend":113}],31:[function(require,module,exports){
|
|
8598
8930
|
(function (global){
|
|
8599
8931
|
exports.fetch = isFunction(global.fetch) && isFunction(global.ReadableStream)
|
|
8600
8932
|
|
|
8933
|
+
exports.writableStream = isFunction(global.WritableStream)
|
|
8934
|
+
|
|
8935
|
+
exports.abortController = isFunction(global.AbortController)
|
|
8936
|
+
|
|
8601
8937
|
exports.blobConstructor = false
|
|
8602
8938
|
try {
|
|
8603
8939
|
new Blob([new ArrayBuffer(1)])
|
|
@@ -8709,9 +9045,8 @@ var ClientRequest = module.exports = function (opts) {
|
|
|
8709
9045
|
|
|
8710
9046
|
var preferBinary
|
|
8711
9047
|
var useFetch = true
|
|
8712
|
-
if (opts.mode === 'disable-fetch' || '
|
|
8713
|
-
// If the use of XHR should be preferred
|
|
8714
|
-
// Force XHR to be used since the Fetch API does not yet support timeouts.
|
|
9048
|
+
if (opts.mode === 'disable-fetch' || ('requestTimeout' in opts && !capability.abortController)) {
|
|
9049
|
+
// If the use of XHR should be preferred. Not typically needed.
|
|
8715
9050
|
useFetch = false
|
|
8716
9051
|
preferBinary = true
|
|
8717
9052
|
} else if (opts.mode === 'prefer-streaming') {
|
|
@@ -8728,6 +9063,7 @@ var ClientRequest = module.exports = function (opts) {
|
|
|
8728
9063
|
throw new Error('Invalid value for opts.mode')
|
|
8729
9064
|
}
|
|
8730
9065
|
self._mode = decideMode(preferBinary, useFetch)
|
|
9066
|
+
self._fetchTimer = null
|
|
8731
9067
|
|
|
8732
9068
|
self.on('finish', function () {
|
|
8733
9069
|
self._onFinish()
|
|
@@ -8773,7 +9109,9 @@ ClientRequest.prototype._onFinish = function () {
|
|
|
8773
9109
|
var headersObj = self._headers
|
|
8774
9110
|
var body = null
|
|
8775
9111
|
if (opts.method !== 'GET' && opts.method !== 'HEAD') {
|
|
8776
|
-
if (capability.
|
|
9112
|
+
if (capability.arraybuffer) {
|
|
9113
|
+
body = toArrayBuffer(Buffer.concat(self._body))
|
|
9114
|
+
} else if (capability.blobConstructor) {
|
|
8777
9115
|
body = new global.Blob(self._body.map(function (buffer) {
|
|
8778
9116
|
return toArrayBuffer(buffer)
|
|
8779
9117
|
}), {
|
|
@@ -8800,17 +9138,36 @@ ClientRequest.prototype._onFinish = function () {
|
|
|
8800
9138
|
})
|
|
8801
9139
|
|
|
8802
9140
|
if (self._mode === 'fetch') {
|
|
9141
|
+
var signal = null
|
|
9142
|
+
var fetchTimer = null
|
|
9143
|
+
if (capability.abortController) {
|
|
9144
|
+
var controller = new AbortController()
|
|
9145
|
+
signal = controller.signal
|
|
9146
|
+
self._fetchAbortController = controller
|
|
9147
|
+
|
|
9148
|
+
if ('requestTimeout' in opts && opts.requestTimeout !== 0) {
|
|
9149
|
+
self._fetchTimer = global.setTimeout(function () {
|
|
9150
|
+
self.emit('requestTimeout')
|
|
9151
|
+
if (self._fetchAbortController)
|
|
9152
|
+
self._fetchAbortController.abort()
|
|
9153
|
+
}, opts.requestTimeout)
|
|
9154
|
+
}
|
|
9155
|
+
}
|
|
9156
|
+
|
|
8803
9157
|
global.fetch(self._opts.url, {
|
|
8804
9158
|
method: self._opts.method,
|
|
8805
9159
|
headers: headersList,
|
|
8806
9160
|
body: body || undefined,
|
|
8807
9161
|
mode: 'cors',
|
|
8808
|
-
credentials: opts.withCredentials ? 'include' : 'same-origin'
|
|
9162
|
+
credentials: opts.withCredentials ? 'include' : 'same-origin',
|
|
9163
|
+
signal: signal
|
|
8809
9164
|
}).then(function (response) {
|
|
8810
9165
|
self._fetchResponse = response
|
|
8811
9166
|
self._connect()
|
|
8812
9167
|
}, function (reason) {
|
|
8813
|
-
self.
|
|
9168
|
+
global.clearTimeout(self._fetchTimer)
|
|
9169
|
+
if (!self._destroyed)
|
|
9170
|
+
self.emit('error', reason)
|
|
8814
9171
|
})
|
|
8815
9172
|
} else {
|
|
8816
9173
|
var xhr = self._xhr = new global.XMLHttpRequest()
|
|
@@ -8833,10 +9190,10 @@ ClientRequest.prototype._onFinish = function () {
|
|
|
8833
9190
|
if (self._mode === 'text' && 'overrideMimeType' in xhr)
|
|
8834
9191
|
xhr.overrideMimeType('text/plain; charset=x-user-defined')
|
|
8835
9192
|
|
|
8836
|
-
if ('
|
|
8837
|
-
xhr.timeout = opts.
|
|
9193
|
+
if ('requestTimeout' in opts) {
|
|
9194
|
+
xhr.timeout = opts.requestTimeout
|
|
8838
9195
|
xhr.ontimeout = function () {
|
|
8839
|
-
self.emit('
|
|
9196
|
+
self.emit('requestTimeout')
|
|
8840
9197
|
}
|
|
8841
9198
|
}
|
|
8842
9199
|
|
|
@@ -8910,7 +9267,7 @@ ClientRequest.prototype._connect = function () {
|
|
|
8910
9267
|
if (self._destroyed)
|
|
8911
9268
|
return
|
|
8912
9269
|
|
|
8913
|
-
self._response = new IncomingMessage(self._xhr, self._fetchResponse, self._mode)
|
|
9270
|
+
self._response = new IncomingMessage(self._xhr, self._fetchResponse, self._mode, self._fetchTimer)
|
|
8914
9271
|
self._response.on('error', function(err) {
|
|
8915
9272
|
self.emit('error', err)
|
|
8916
9273
|
})
|
|
@@ -8928,12 +9285,13 @@ ClientRequest.prototype._write = function (chunk, encoding, cb) {
|
|
|
8928
9285
|
ClientRequest.prototype.abort = ClientRequest.prototype.destroy = function () {
|
|
8929
9286
|
var self = this
|
|
8930
9287
|
self._destroyed = true
|
|
9288
|
+
global.clearTimeout(self._fetchTimer)
|
|
8931
9289
|
if (self._response)
|
|
8932
9290
|
self._response._destroyed = true
|
|
8933
9291
|
if (self._xhr)
|
|
8934
9292
|
self._xhr.abort()
|
|
8935
|
-
|
|
8936
|
-
|
|
9293
|
+
else if (self._fetchAbortController)
|
|
9294
|
+
self._fetchAbortController.abort()
|
|
8937
9295
|
}
|
|
8938
9296
|
|
|
8939
9297
|
ClientRequest.prototype.end = function (data, encoding, cb) {
|
|
@@ -8977,7 +9335,7 @@ var unsafeHeaders = [
|
|
|
8977
9335
|
]
|
|
8978
9336
|
|
|
8979
9337
|
}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer)
|
|
8980
|
-
},{"./capability":31,"./response":33,"_process":15,"buffer":3,"inherits":9,"readable-stream":28,"to-arraybuffer":
|
|
9338
|
+
},{"./capability":31,"./response":33,"_process":15,"buffer":3,"inherits":9,"readable-stream":28,"to-arraybuffer":36}],33:[function(require,module,exports){
|
|
8981
9339
|
(function (process,global,Buffer){
|
|
8982
9340
|
var capability = require('./capability')
|
|
8983
9341
|
var inherits = require('inherits')
|
|
@@ -8991,7 +9349,7 @@ var rStates = exports.readyStates = {
|
|
|
8991
9349
|
DONE: 4
|
|
8992
9350
|
}
|
|
8993
9351
|
|
|
8994
|
-
var IncomingMessage = exports.IncomingMessage = function (xhr, response, mode) {
|
|
9352
|
+
var IncomingMessage = exports.IncomingMessage = function (xhr, response, mode, fetchTimer) {
|
|
8995
9353
|
var self = this
|
|
8996
9354
|
stream.Readable.call(self)
|
|
8997
9355
|
|
|
@@ -9016,30 +9374,64 @@ var IncomingMessage = exports.IncomingMessage = function (xhr, response, mode) {
|
|
|
9016
9374
|
self.statusCode = response.status
|
|
9017
9375
|
self.statusMessage = response.statusText
|
|
9018
9376
|
|
|
9019
|
-
response.headers.forEach(function(header, key){
|
|
9377
|
+
response.headers.forEach(function (header, key){
|
|
9020
9378
|
self.headers[key.toLowerCase()] = header
|
|
9021
9379
|
self.rawHeaders.push(key, header)
|
|
9022
9380
|
})
|
|
9023
9381
|
|
|
9382
|
+
if (capability.writableStream) {
|
|
9383
|
+
var writable = new WritableStream({
|
|
9384
|
+
write: function (chunk) {
|
|
9385
|
+
return new Promise(function (resolve, reject) {
|
|
9386
|
+
if (self._destroyed) {
|
|
9387
|
+
reject()
|
|
9388
|
+
} else if(self.push(new Buffer(chunk))) {
|
|
9389
|
+
resolve()
|
|
9390
|
+
} else {
|
|
9391
|
+
self._resumeFetch = resolve
|
|
9392
|
+
}
|
|
9393
|
+
})
|
|
9394
|
+
},
|
|
9395
|
+
close: function () {
|
|
9396
|
+
global.clearTimeout(fetchTimer)
|
|
9397
|
+
if (!self._destroyed)
|
|
9398
|
+
self.push(null)
|
|
9399
|
+
},
|
|
9400
|
+
abort: function (err) {
|
|
9401
|
+
if (!self._destroyed)
|
|
9402
|
+
self.emit('error', err)
|
|
9403
|
+
}
|
|
9404
|
+
})
|
|
9024
9405
|
|
|
9025
|
-
|
|
9406
|
+
try {
|
|
9407
|
+
response.body.pipeTo(writable).catch(function (err) {
|
|
9408
|
+
global.clearTimeout(fetchTimer)
|
|
9409
|
+
if (!self._destroyed)
|
|
9410
|
+
self.emit('error', err)
|
|
9411
|
+
})
|
|
9412
|
+
return
|
|
9413
|
+
} catch (e) {} // pipeTo method isn't defined. Can't find a better way to feature test this
|
|
9414
|
+
}
|
|
9415
|
+
// fallback for when writableStream or pipeTo aren't available
|
|
9026
9416
|
var reader = response.body.getReader()
|
|
9027
9417
|
function read () {
|
|
9028
9418
|
reader.read().then(function (result) {
|
|
9029
9419
|
if (self._destroyed)
|
|
9030
9420
|
return
|
|
9031
9421
|
if (result.done) {
|
|
9422
|
+
global.clearTimeout(fetchTimer)
|
|
9032
9423
|
self.push(null)
|
|
9033
9424
|
return
|
|
9034
9425
|
}
|
|
9035
9426
|
self.push(new Buffer(result.value))
|
|
9036
9427
|
read()
|
|
9037
|
-
}).catch(function(err) {
|
|
9038
|
-
|
|
9428
|
+
}).catch(function (err) {
|
|
9429
|
+
global.clearTimeout(fetchTimer)
|
|
9430
|
+
if (!self._destroyed)
|
|
9431
|
+
self.emit('error', err)
|
|
9039
9432
|
})
|
|
9040
9433
|
}
|
|
9041
9434
|
read()
|
|
9042
|
-
|
|
9043
9435
|
} else {
|
|
9044
9436
|
self._xhr = xhr
|
|
9045
9437
|
self._pos = 0
|
|
@@ -9083,7 +9475,15 @@ var IncomingMessage = exports.IncomingMessage = function (xhr, response, mode) {
|
|
|
9083
9475
|
|
|
9084
9476
|
inherits(IncomingMessage, stream.Readable)
|
|
9085
9477
|
|
|
9086
|
-
IncomingMessage.prototype._read = function () {
|
|
9478
|
+
IncomingMessage.prototype._read = function () {
|
|
9479
|
+
var self = this
|
|
9480
|
+
|
|
9481
|
+
var resolve = self._resumeFetch
|
|
9482
|
+
if (resolve) {
|
|
9483
|
+
self._resumeFetch = null
|
|
9484
|
+
resolve()
|
|
9485
|
+
}
|
|
9486
|
+
}
|
|
9087
9487
|
|
|
9088
9488
|
IncomingMessage.prototype._onXHRProgress = function () {
|
|
9089
9489
|
var self = this
|
|
@@ -9164,9 +9564,33 @@ IncomingMessage.prototype._onXHRProgress = function () {
|
|
|
9164
9564
|
|
|
9165
9565
|
}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer)
|
|
9166
9566
|
},{"./capability":31,"_process":15,"buffer":3,"inherits":9,"readable-stream":28}],34:[function(require,module,exports){
|
|
9567
|
+
// Copyright Joyent, Inc. and other Node contributors.
|
|
9568
|
+
//
|
|
9569
|
+
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
9570
|
+
// copy of this software and associated documentation files (the
|
|
9571
|
+
// "Software"), to deal in the Software without restriction, including
|
|
9572
|
+
// without limitation the rights to use, copy, modify, merge, publish,
|
|
9573
|
+
// distribute, sublicense, and/or sell copies of the Software, and to permit
|
|
9574
|
+
// persons to whom the Software is furnished to do so, subject to the
|
|
9575
|
+
// following conditions:
|
|
9576
|
+
//
|
|
9577
|
+
// The above copyright notice and this permission notice shall be included
|
|
9578
|
+
// in all copies or substantial portions of the Software.
|
|
9579
|
+
//
|
|
9580
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
9581
|
+
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
9582
|
+
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
|
9583
|
+
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
9584
|
+
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
9585
|
+
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
9586
|
+
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
9587
|
+
|
|
9167
9588
|
'use strict';
|
|
9168
9589
|
|
|
9590
|
+
/*<replacement>*/
|
|
9591
|
+
|
|
9169
9592
|
var Buffer = require('safe-buffer').Buffer;
|
|
9593
|
+
/*</replacement>*/
|
|
9170
9594
|
|
|
9171
9595
|
var isEncoding = Buffer.isEncoding || function (encoding) {
|
|
9172
9596
|
encoding = '' + encoding;
|
|
@@ -9278,10 +9702,10 @@ StringDecoder.prototype.fillLast = function (buf) {
|
|
|
9278
9702
|
};
|
|
9279
9703
|
|
|
9280
9704
|
// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a
|
|
9281
|
-
// continuation byte.
|
|
9705
|
+
// continuation byte. If an invalid byte is detected, -2 is returned.
|
|
9282
9706
|
function utf8CheckByte(byte) {
|
|
9283
9707
|
if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;
|
|
9284
|
-
return -1;
|
|
9708
|
+
return byte >> 6 === 0x02 ? -1 : -2;
|
|
9285
9709
|
}
|
|
9286
9710
|
|
|
9287
9711
|
// Checks at most 3 bytes at the end of a Buffer in order to detect an
|
|
@@ -9295,13 +9719,13 @@ function utf8CheckIncomplete(self, buf, i) {
|
|
|
9295
9719
|
if (nb > 0) self.lastNeed = nb - 1;
|
|
9296
9720
|
return nb;
|
|
9297
9721
|
}
|
|
9298
|
-
if (--j < i) return 0;
|
|
9722
|
+
if (--j < i || nb === -2) return 0;
|
|
9299
9723
|
nb = utf8CheckByte(buf[j]);
|
|
9300
9724
|
if (nb >= 0) {
|
|
9301
9725
|
if (nb > 0) self.lastNeed = nb - 2;
|
|
9302
9726
|
return nb;
|
|
9303
9727
|
}
|
|
9304
|
-
if (--j < i) return 0;
|
|
9728
|
+
if (--j < i || nb === -2) return 0;
|
|
9305
9729
|
nb = utf8CheckByte(buf[j]);
|
|
9306
9730
|
if (nb >= 0) {
|
|
9307
9731
|
if (nb > 0) {
|
|
@@ -9315,7 +9739,7 @@ function utf8CheckIncomplete(self, buf, i) {
|
|
|
9315
9739
|
// Validates as many continuation bytes for a multi-byte UTF-8 character as
|
|
9316
9740
|
// needed or are available. If we see a non-continuation byte where we expect
|
|
9317
9741
|
// one, we "replace" the validated continuation bytes we've seen so far with
|
|
9318
|
-
// UTF-8 replacement
|
|
9742
|
+
// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding
|
|
9319
9743
|
// behavior. The continuation byte check is included three times in the case
|
|
9320
9744
|
// where all of the continuation bytes for a character exist in the same buffer.
|
|
9321
9745
|
// It is also done this way as a slight performance increase instead of using a
|
|
@@ -9323,17 +9747,17 @@ function utf8CheckIncomplete(self, buf, i) {
|
|
|
9323
9747
|
function utf8CheckExtraBytes(self, buf, p) {
|
|
9324
9748
|
if ((buf[0] & 0xC0) !== 0x80) {
|
|
9325
9749
|
self.lastNeed = 0;
|
|
9326
|
-
return '\ufffd'
|
|
9750
|
+
return '\ufffd';
|
|
9327
9751
|
}
|
|
9328
9752
|
if (self.lastNeed > 1 && buf.length > 1) {
|
|
9329
9753
|
if ((buf[1] & 0xC0) !== 0x80) {
|
|
9330
9754
|
self.lastNeed = 1;
|
|
9331
|
-
return '\ufffd'
|
|
9755
|
+
return '\ufffd';
|
|
9332
9756
|
}
|
|
9333
9757
|
if (self.lastNeed > 2 && buf.length > 2) {
|
|
9334
9758
|
if ((buf[2] & 0xC0) !== 0x80) {
|
|
9335
9759
|
self.lastNeed = 2;
|
|
9336
|
-
return '\ufffd'
|
|
9760
|
+
return '\ufffd';
|
|
9337
9761
|
}
|
|
9338
9762
|
}
|
|
9339
9763
|
}
|
|
@@ -9364,11 +9788,11 @@ function utf8Text(buf, i) {
|
|
|
9364
9788
|
return buf.toString('utf8', i, end);
|
|
9365
9789
|
}
|
|
9366
9790
|
|
|
9367
|
-
// For UTF-8, a replacement character
|
|
9368
|
-
// character
|
|
9791
|
+
// For UTF-8, a replacement character is added when ending on a partial
|
|
9792
|
+
// character.
|
|
9369
9793
|
function utf8End(buf) {
|
|
9370
9794
|
var r = buf && buf.length ? this.write(buf) : '';
|
|
9371
|
-
if (this.lastNeed) return r + '\ufffd'
|
|
9795
|
+
if (this.lastNeed) return r + '\ufffd';
|
|
9372
9796
|
return r;
|
|
9373
9797
|
}
|
|
9374
9798
|
|
|
@@ -9437,6 +9861,85 @@ function simpleEnd(buf) {
|
|
|
9437
9861
|
return buf && buf.length ? this.write(buf) : '';
|
|
9438
9862
|
}
|
|
9439
9863
|
},{"safe-buffer":29}],35:[function(require,module,exports){
|
|
9864
|
+
(function (setImmediate,clearImmediate){
|
|
9865
|
+
var nextTick = require('process/browser.js').nextTick;
|
|
9866
|
+
var apply = Function.prototype.apply;
|
|
9867
|
+
var slice = Array.prototype.slice;
|
|
9868
|
+
var immediateIds = {};
|
|
9869
|
+
var nextImmediateId = 0;
|
|
9870
|
+
|
|
9871
|
+
// DOM APIs, for completeness
|
|
9872
|
+
|
|
9873
|
+
exports.setTimeout = function() {
|
|
9874
|
+
return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout);
|
|
9875
|
+
};
|
|
9876
|
+
exports.setInterval = function() {
|
|
9877
|
+
return new Timeout(apply.call(setInterval, window, arguments), clearInterval);
|
|
9878
|
+
};
|
|
9879
|
+
exports.clearTimeout =
|
|
9880
|
+
exports.clearInterval = function(timeout) { timeout.close(); };
|
|
9881
|
+
|
|
9882
|
+
function Timeout(id, clearFn) {
|
|
9883
|
+
this._id = id;
|
|
9884
|
+
this._clearFn = clearFn;
|
|
9885
|
+
}
|
|
9886
|
+
Timeout.prototype.unref = Timeout.prototype.ref = function() {};
|
|
9887
|
+
Timeout.prototype.close = function() {
|
|
9888
|
+
this._clearFn.call(window, this._id);
|
|
9889
|
+
};
|
|
9890
|
+
|
|
9891
|
+
// Does not start the time, just sets up the members needed.
|
|
9892
|
+
exports.enroll = function(item, msecs) {
|
|
9893
|
+
clearTimeout(item._idleTimeoutId);
|
|
9894
|
+
item._idleTimeout = msecs;
|
|
9895
|
+
};
|
|
9896
|
+
|
|
9897
|
+
exports.unenroll = function(item) {
|
|
9898
|
+
clearTimeout(item._idleTimeoutId);
|
|
9899
|
+
item._idleTimeout = -1;
|
|
9900
|
+
};
|
|
9901
|
+
|
|
9902
|
+
exports._unrefActive = exports.active = function(item) {
|
|
9903
|
+
clearTimeout(item._idleTimeoutId);
|
|
9904
|
+
|
|
9905
|
+
var msecs = item._idleTimeout;
|
|
9906
|
+
if (msecs >= 0) {
|
|
9907
|
+
item._idleTimeoutId = setTimeout(function onTimeout() {
|
|
9908
|
+
if (item._onTimeout)
|
|
9909
|
+
item._onTimeout();
|
|
9910
|
+
}, msecs);
|
|
9911
|
+
}
|
|
9912
|
+
};
|
|
9913
|
+
|
|
9914
|
+
// That's not how node.js implements it but the exposed api is the same.
|
|
9915
|
+
exports.setImmediate = typeof setImmediate === "function" ? setImmediate : function(fn) {
|
|
9916
|
+
var id = nextImmediateId++;
|
|
9917
|
+
var args = arguments.length < 2 ? false : slice.call(arguments, 1);
|
|
9918
|
+
|
|
9919
|
+
immediateIds[id] = true;
|
|
9920
|
+
|
|
9921
|
+
nextTick(function onNextTick() {
|
|
9922
|
+
if (immediateIds[id]) {
|
|
9923
|
+
// fn.call() is faster so we optimize for the common use-case
|
|
9924
|
+
// @see http://jsperf.com/call-apply-segu
|
|
9925
|
+
if (args) {
|
|
9926
|
+
fn.apply(null, args);
|
|
9927
|
+
} else {
|
|
9928
|
+
fn.call(null);
|
|
9929
|
+
}
|
|
9930
|
+
// Prevent ids from leaking
|
|
9931
|
+
exports.clearImmediate(id);
|
|
9932
|
+
}
|
|
9933
|
+
});
|
|
9934
|
+
|
|
9935
|
+
return id;
|
|
9936
|
+
};
|
|
9937
|
+
|
|
9938
|
+
exports.clearImmediate = typeof clearImmediate === "function" ? clearImmediate : function(id) {
|
|
9939
|
+
delete immediateIds[id];
|
|
9940
|
+
};
|
|
9941
|
+
}).call(this,require("timers").setImmediate,require("timers").clearImmediate)
|
|
9942
|
+
},{"process/browser.js":15,"timers":35}],36:[function(require,module,exports){
|
|
9440
9943
|
var Buffer = require('buffer').Buffer
|
|
9441
9944
|
|
|
9442
9945
|
module.exports = function (buf) {
|
|
@@ -9465,7 +9968,7 @@ module.exports = function (buf) {
|
|
|
9465
9968
|
}
|
|
9466
9969
|
}
|
|
9467
9970
|
|
|
9468
|
-
},{"buffer":3}],
|
|
9971
|
+
},{"buffer":3}],37:[function(require,module,exports){
|
|
9469
9972
|
// Copyright Joyent, Inc. and other Node contributors.
|
|
9470
9973
|
//
|
|
9471
9974
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
@@ -10199,7 +10702,7 @@ Url.prototype.parseHost = function() {
|
|
|
10199
10702
|
if (host) this.hostname = host;
|
|
10200
10703
|
};
|
|
10201
10704
|
|
|
10202
|
-
},{"./util":
|
|
10705
|
+
},{"./util":38,"punycode":16,"querystring":19}],38:[function(require,module,exports){
|
|
10203
10706
|
'use strict';
|
|
10204
10707
|
|
|
10205
10708
|
module.exports = {
|
|
@@ -10217,7 +10720,7 @@ module.exports = {
|
|
|
10217
10720
|
}
|
|
10218
10721
|
};
|
|
10219
10722
|
|
|
10220
|
-
},{}],
|
|
10723
|
+
},{}],39:[function(require,module,exports){
|
|
10221
10724
|
(function (global){
|
|
10222
10725
|
|
|
10223
10726
|
/**
|
|
@@ -10288,7 +10791,7 @@ function config (name) {
|
|
|
10288
10791
|
}
|
|
10289
10792
|
|
|
10290
10793
|
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
10291
|
-
},{}],
|
|
10794
|
+
},{}],40:[function(require,module,exports){
|
|
10292
10795
|
'use strict';
|
|
10293
10796
|
|
|
10294
10797
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -10495,10 +10998,18 @@ var _isISO = require('./lib/isISO8601');
|
|
|
10495
10998
|
|
|
10496
10999
|
var _isISO2 = _interopRequireDefault(_isISO);
|
|
10497
11000
|
|
|
11001
|
+
var _isRFC = require('./lib/isRFC3339');
|
|
11002
|
+
|
|
11003
|
+
var _isRFC2 = _interopRequireDefault(_isRFC);
|
|
11004
|
+
|
|
10498
11005
|
var _isISO31661Alpha = require('./lib/isISO31661Alpha2');
|
|
10499
11006
|
|
|
10500
11007
|
var _isISO31661Alpha2 = _interopRequireDefault(_isISO31661Alpha);
|
|
10501
11008
|
|
|
11009
|
+
var _isISO31661Alpha3 = require('./lib/isISO31661Alpha3');
|
|
11010
|
+
|
|
11011
|
+
var _isISO31661Alpha4 = _interopRequireDefault(_isISO31661Alpha3);
|
|
11012
|
+
|
|
10502
11013
|
var _isBase = require('./lib/isBase64');
|
|
10503
11014
|
|
|
10504
11015
|
var _isBase2 = _interopRequireDefault(_isBase);
|
|
@@ -10507,6 +11018,10 @@ var _isDataURI = require('./lib/isDataURI');
|
|
|
10507
11018
|
|
|
10508
11019
|
var _isDataURI2 = _interopRequireDefault(_isDataURI);
|
|
10509
11020
|
|
|
11021
|
+
var _isMimeType = require('./lib/isMimeType');
|
|
11022
|
+
|
|
11023
|
+
var _isMimeType2 = _interopRequireDefault(_isMimeType);
|
|
11024
|
+
|
|
10510
11025
|
var _isLatLong = require('./lib/isLatLong');
|
|
10511
11026
|
|
|
10512
11027
|
var _isLatLong2 = _interopRequireDefault(_isLatLong);
|
|
@@ -10561,7 +11076,7 @@ var _toString2 = _interopRequireDefault(_toString);
|
|
|
10561
11076
|
|
|
10562
11077
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10563
11078
|
|
|
10564
|
-
var version = '
|
|
11079
|
+
var version = '10.2.0';
|
|
10565
11080
|
|
|
10566
11081
|
var validator = {
|
|
10567
11082
|
version: version,
|
|
@@ -10614,11 +11129,15 @@ var validator = {
|
|
|
10614
11129
|
isISSN: _isISSN2.default,
|
|
10615
11130
|
isMobilePhone: _isMobilePhone2.default,
|
|
10616
11131
|
isPostalCode: _isPostalCode2.default,
|
|
11132
|
+
isPostalCodeLocales: _isPostalCode.locales,
|
|
10617
11133
|
isCurrency: _isCurrency2.default,
|
|
10618
11134
|
isISO8601: _isISO2.default,
|
|
11135
|
+
isRFC3339: _isRFC2.default,
|
|
10619
11136
|
isISO31661Alpha2: _isISO31661Alpha2.default,
|
|
11137
|
+
isISO31661Alpha3: _isISO31661Alpha4.default,
|
|
10620
11138
|
isBase64: _isBase2.default,
|
|
10621
11139
|
isDataURI: _isDataURI2.default,
|
|
11140
|
+
isMimeType: _isMimeType2.default,
|
|
10622
11141
|
isLatLong: _isLatLong2.default,
|
|
10623
11142
|
ltrim: _ltrim2.default,
|
|
10624
11143
|
rtrim: _rtrim2.default,
|
|
@@ -10635,7 +11154,7 @@ var validator = {
|
|
|
10635
11154
|
|
|
10636
11155
|
exports.default = validator;
|
|
10637
11156
|
module.exports = exports['default'];
|
|
10638
|
-
},{"./lib/blacklist":
|
|
11157
|
+
},{"./lib/blacklist":42,"./lib/contains":43,"./lib/equals":44,"./lib/escape":45,"./lib/isAfter":46,"./lib/isAlpha":47,"./lib/isAlphanumeric":48,"./lib/isAscii":49,"./lib/isBase64":50,"./lib/isBefore":51,"./lib/isBoolean":52,"./lib/isByteLength":53,"./lib/isCreditCard":54,"./lib/isCurrency":55,"./lib/isDataURI":56,"./lib/isDecimal":57,"./lib/isDivisibleBy":58,"./lib/isEmail":59,"./lib/isEmpty":60,"./lib/isFQDN":61,"./lib/isFloat":62,"./lib/isFullWidth":63,"./lib/isHalfWidth":64,"./lib/isHash":65,"./lib/isHexColor":66,"./lib/isHexadecimal":67,"./lib/isIP":68,"./lib/isISBN":69,"./lib/isISIN":70,"./lib/isISO31661Alpha2":71,"./lib/isISO31661Alpha3":72,"./lib/isISO8601":73,"./lib/isISRC":74,"./lib/isISSN":75,"./lib/isIn":76,"./lib/isInt":77,"./lib/isJSON":78,"./lib/isLatLong":79,"./lib/isLength":80,"./lib/isLowercase":81,"./lib/isMACAddress":82,"./lib/isMD5":83,"./lib/isMimeType":84,"./lib/isMobilePhone":85,"./lib/isMongoId":86,"./lib/isMultibyte":87,"./lib/isNumeric":88,"./lib/isPort":89,"./lib/isPostalCode":90,"./lib/isRFC3339":91,"./lib/isSurrogatePair":92,"./lib/isURL":93,"./lib/isUUID":94,"./lib/isUppercase":95,"./lib/isVariableWidth":96,"./lib/isWhitelisted":97,"./lib/ltrim":98,"./lib/matches":99,"./lib/normalizeEmail":100,"./lib/rtrim":101,"./lib/stripLow":102,"./lib/toBoolean":103,"./lib/toDate":104,"./lib/toFloat":105,"./lib/toInt":106,"./lib/trim":107,"./lib/unescape":108,"./lib/util/toString":111,"./lib/whitelist":112}],41:[function(require,module,exports){
|
|
10639
11158
|
'use strict';
|
|
10640
11159
|
|
|
10641
11160
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -10643,9 +11162,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
10643
11162
|
});
|
|
10644
11163
|
var alpha = exports.alpha = {
|
|
10645
11164
|
'en-US': /^[A-Z]+$/i,
|
|
11165
|
+
'bg-BG': /^[А-Я]+$/i,
|
|
10646
11166
|
'cs-CZ': /^[A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i,
|
|
10647
11167
|
'da-DK': /^[A-ZÆØÅ]+$/i,
|
|
10648
11168
|
'de-DE': /^[A-ZÄÖÜß]+$/i,
|
|
11169
|
+
'el-GR': /^[Α-ω]+$/i,
|
|
10649
11170
|
'es-ES': /^[A-ZÁÉÍÑÓÚÜ]+$/i,
|
|
10650
11171
|
'fr-FR': /^[A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,
|
|
10651
11172
|
'it-IT': /^[A-ZÀÉÈÌÎÓÒÙ]+$/i,
|
|
@@ -10656,6 +11177,7 @@ var alpha = exports.alpha = {
|
|
|
10656
11177
|
'pl-PL': /^[A-ZĄĆĘŚŁŃÓŻŹ]+$/i,
|
|
10657
11178
|
'pt-PT': /^[A-ZÃÁÀÂÇÉÊÍÕÓÔÚÜ]+$/i,
|
|
10658
11179
|
'ru-RU': /^[А-ЯЁ]+$/i,
|
|
11180
|
+
'sk-SK': /^[A-ZÁČĎÉÍŇÓŠŤÚÝŽĹŔĽÄÔ]+$/i,
|
|
10659
11181
|
'sr-RS@latin': /^[A-ZČĆŽŠĐ]+$/i,
|
|
10660
11182
|
'sr-RS': /^[А-ЯЂЈЉЊЋЏ]+$/i,
|
|
10661
11183
|
'sv-SE': /^[A-ZÅÄÖ]+$/i,
|
|
@@ -10666,9 +11188,11 @@ var alpha = exports.alpha = {
|
|
|
10666
11188
|
|
|
10667
11189
|
var alphanumeric = exports.alphanumeric = {
|
|
10668
11190
|
'en-US': /^[0-9A-Z]+$/i,
|
|
11191
|
+
'bg-BG': /^[0-9А-Я]+$/i,
|
|
10669
11192
|
'cs-CZ': /^[0-9A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i,
|
|
10670
11193
|
'da-DK': /^[0-9A-ZÆØÅ]+$/i,
|
|
10671
11194
|
'de-DE': /^[0-9A-ZÄÖÜß]+$/i,
|
|
11195
|
+
'el-GR': /^[0-9Α-ω]+$/i,
|
|
10672
11196
|
'es-ES': /^[0-9A-ZÁÉÍÑÓÚÜ]+$/i,
|
|
10673
11197
|
'fr-FR': /^[0-9A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,
|
|
10674
11198
|
'it-IT': /^[0-9A-ZÀÉÈÌÎÓÒÙ]+$/i,
|
|
@@ -10679,6 +11203,7 @@ var alphanumeric = exports.alphanumeric = {
|
|
|
10679
11203
|
'pl-PL': /^[0-9A-ZĄĆĘŚŁŃÓŻŹ]+$/i,
|
|
10680
11204
|
'pt-PT': /^[0-9A-ZÃÁÀÂÇÉÊÍÕÓÔÚÜ]+$/i,
|
|
10681
11205
|
'ru-RU': /^[0-9А-ЯЁ]+$/i,
|
|
11206
|
+
'sk-SK': /^[0-9A-ZÁČĎÉÍŇÓŠŤÚÝŽĹŔĽÄÔ]+$/i,
|
|
10682
11207
|
'sr-RS@latin': /^[0-9A-ZČĆŽŠĐ]+$/i,
|
|
10683
11208
|
'sr-RS': /^[0-9А-ЯЂЈЉЊЋЏ]+$/i,
|
|
10684
11209
|
'sv-SE': /^[0-9A-ZÅÄÖ]+$/i,
|
|
@@ -10713,7 +11238,7 @@ for (var _locale, _i = 0; _i < arabicLocales.length; _i++) {
|
|
|
10713
11238
|
|
|
10714
11239
|
// Source: https://en.wikipedia.org/wiki/Decimal_mark
|
|
10715
11240
|
var dotDecimal = exports.dotDecimal = [];
|
|
10716
|
-
var commaDecimal = exports.commaDecimal = ['cs-CZ', 'da-DK', 'de-DE', 'es-ES', 'fr-FR', 'it-IT', 'hu-HU', 'nb-NO', 'nn-NO', 'nl-NL', 'pl-Pl', 'pt-PT', 'ru-RU', 'sr-RS@latin', 'sr-RS', 'sv-SE', 'tr-TR', 'uk-UA'];
|
|
11241
|
+
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'];
|
|
10717
11242
|
|
|
10718
11243
|
for (var _i2 = 0; _i2 < dotDecimal.length; _i2++) {
|
|
10719
11244
|
decimal[dotDecimal[_i2]] = decimal['en-US'];
|
|
@@ -10726,7 +11251,7 @@ for (var _i3 = 0; _i3 < commaDecimal.length; _i3++) {
|
|
|
10726
11251
|
alpha['pt-BR'] = alpha['pt-PT'];
|
|
10727
11252
|
alphanumeric['pt-BR'] = alphanumeric['pt-PT'];
|
|
10728
11253
|
decimal['pt-BR'] = decimal['pt-PT'];
|
|
10729
|
-
},{}],
|
|
11254
|
+
},{}],42:[function(require,module,exports){
|
|
10730
11255
|
'use strict';
|
|
10731
11256
|
|
|
10732
11257
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -10745,7 +11270,7 @@ function blacklist(str, chars) {
|
|
|
10745
11270
|
return str.replace(new RegExp('[' + chars + ']+', 'g'), '');
|
|
10746
11271
|
}
|
|
10747
11272
|
module.exports = exports['default'];
|
|
10748
|
-
},{"./util/assertString":
|
|
11273
|
+
},{"./util/assertString":109}],43:[function(require,module,exports){
|
|
10749
11274
|
'use strict';
|
|
10750
11275
|
|
|
10751
11276
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -10768,7 +11293,7 @@ function contains(str, elem) {
|
|
|
10768
11293
|
return str.indexOf((0, _toString2.default)(elem)) >= 0;
|
|
10769
11294
|
}
|
|
10770
11295
|
module.exports = exports['default'];
|
|
10771
|
-
},{"./util/assertString":
|
|
11296
|
+
},{"./util/assertString":109,"./util/toString":111}],44:[function(require,module,exports){
|
|
10772
11297
|
'use strict';
|
|
10773
11298
|
|
|
10774
11299
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -10787,7 +11312,7 @@ function equals(str, comparison) {
|
|
|
10787
11312
|
return str === comparison;
|
|
10788
11313
|
}
|
|
10789
11314
|
module.exports = exports['default'];
|
|
10790
|
-
},{"./util/assertString":
|
|
11315
|
+
},{"./util/assertString":109}],45:[function(require,module,exports){
|
|
10791
11316
|
'use strict';
|
|
10792
11317
|
|
|
10793
11318
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -10806,7 +11331,7 @@ function escape(str) {
|
|
|
10806
11331
|
return str.replace(/&/g, '&').replace(/"/g, '"').replace(/'/g, ''').replace(/</g, '<').replace(/>/g, '>').replace(/\//g, '/').replace(/\\/g, '\').replace(/`/g, '`');
|
|
10807
11332
|
}
|
|
10808
11333
|
module.exports = exports['default'];
|
|
10809
|
-
},{"./util/assertString":
|
|
11334
|
+
},{"./util/assertString":109}],46:[function(require,module,exports){
|
|
10810
11335
|
'use strict';
|
|
10811
11336
|
|
|
10812
11337
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -10833,7 +11358,7 @@ function isAfter(str) {
|
|
|
10833
11358
|
return !!(original && comparison && original > comparison);
|
|
10834
11359
|
}
|
|
10835
11360
|
module.exports = exports['default'];
|
|
10836
|
-
},{"./toDate":
|
|
11361
|
+
},{"./toDate":104,"./util/assertString":109}],47:[function(require,module,exports){
|
|
10837
11362
|
'use strict';
|
|
10838
11363
|
|
|
10839
11364
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -10859,7 +11384,7 @@ function isAlpha(str) {
|
|
|
10859
11384
|
throw new Error('Invalid locale \'' + locale + '\'');
|
|
10860
11385
|
}
|
|
10861
11386
|
module.exports = exports['default'];
|
|
10862
|
-
},{"./alpha":
|
|
11387
|
+
},{"./alpha":41,"./util/assertString":109}],48:[function(require,module,exports){
|
|
10863
11388
|
'use strict';
|
|
10864
11389
|
|
|
10865
11390
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -10885,7 +11410,7 @@ function isAlphanumeric(str) {
|
|
|
10885
11410
|
throw new Error('Invalid locale \'' + locale + '\'');
|
|
10886
11411
|
}
|
|
10887
11412
|
module.exports = exports['default'];
|
|
10888
|
-
},{"./alpha":
|
|
11413
|
+
},{"./alpha":41,"./util/assertString":109}],49:[function(require,module,exports){
|
|
10889
11414
|
'use strict';
|
|
10890
11415
|
|
|
10891
11416
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -10908,7 +11433,7 @@ function isAscii(str) {
|
|
|
10908
11433
|
return ascii.test(str);
|
|
10909
11434
|
}
|
|
10910
11435
|
module.exports = exports['default'];
|
|
10911
|
-
},{"./util/assertString":
|
|
11436
|
+
},{"./util/assertString":109}],50:[function(require,module,exports){
|
|
10912
11437
|
'use strict';
|
|
10913
11438
|
|
|
10914
11439
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -10934,7 +11459,7 @@ function isBase64(str) {
|
|
|
10934
11459
|
return firstPaddingChar === -1 || firstPaddingChar === len - 1 || firstPaddingChar === len - 2 && str[len - 1] === '=';
|
|
10935
11460
|
}
|
|
10936
11461
|
module.exports = exports['default'];
|
|
10937
|
-
},{"./util/assertString":
|
|
11462
|
+
},{"./util/assertString":109}],51:[function(require,module,exports){
|
|
10938
11463
|
'use strict';
|
|
10939
11464
|
|
|
10940
11465
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -10961,7 +11486,7 @@ function isBefore(str) {
|
|
|
10961
11486
|
return !!(original && comparison && original < comparison);
|
|
10962
11487
|
}
|
|
10963
11488
|
module.exports = exports['default'];
|
|
10964
|
-
},{"./toDate":
|
|
11489
|
+
},{"./toDate":104,"./util/assertString":109}],52:[function(require,module,exports){
|
|
10965
11490
|
'use strict';
|
|
10966
11491
|
|
|
10967
11492
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -10980,7 +11505,7 @@ function isBoolean(str) {
|
|
|
10980
11505
|
return ['true', 'false', '1', '0'].indexOf(str) >= 0;
|
|
10981
11506
|
}
|
|
10982
11507
|
module.exports = exports['default'];
|
|
10983
|
-
},{"./util/assertString":
|
|
11508
|
+
},{"./util/assertString":109}],53:[function(require,module,exports){
|
|
10984
11509
|
'use strict';
|
|
10985
11510
|
|
|
10986
11511
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11014,7 +11539,7 @@ function isByteLength(str, options) {
|
|
|
11014
11539
|
return len >= min && (typeof max === 'undefined' || len <= max);
|
|
11015
11540
|
}
|
|
11016
11541
|
module.exports = exports['default'];
|
|
11017
|
-
},{"./util/assertString":
|
|
11542
|
+
},{"./util/assertString":109}],54:[function(require,module,exports){
|
|
11018
11543
|
'use strict';
|
|
11019
11544
|
|
|
11020
11545
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11029,7 +11554,7 @@ var _assertString2 = _interopRequireDefault(_assertString);
|
|
|
11029
11554
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11030
11555
|
|
|
11031
11556
|
/* eslint-disable max-len */
|
|
11032
|
-
var creditCard = /^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11}|
|
|
11557
|
+
var creditCard = /^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11}|6[27][0-9]{14})$/;
|
|
11033
11558
|
/* eslint-enable max-len */
|
|
11034
11559
|
|
|
11035
11560
|
function isCreditCard(str) {
|
|
@@ -11060,7 +11585,7 @@ function isCreditCard(str) {
|
|
|
11060
11585
|
return !!(sum % 10 === 0 ? sanitized : false);
|
|
11061
11586
|
}
|
|
11062
11587
|
module.exports = exports['default'];
|
|
11063
|
-
},{"./util/assertString":
|
|
11588
|
+
},{"./util/assertString":109}],55:[function(require,module,exports){
|
|
11064
11589
|
'use strict';
|
|
11065
11590
|
|
|
11066
11591
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11153,7 +11678,7 @@ function isCurrency(str, options) {
|
|
|
11153
11678
|
return currencyRegex(options).test(str);
|
|
11154
11679
|
}
|
|
11155
11680
|
module.exports = exports['default'];
|
|
11156
|
-
},{"./util/assertString":
|
|
11681
|
+
},{"./util/assertString":109,"./util/merge":110}],56:[function(require,module,exports){
|
|
11157
11682
|
'use strict';
|
|
11158
11683
|
|
|
11159
11684
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11167,14 +11692,43 @@ var _assertString2 = _interopRequireDefault(_assertString);
|
|
|
11167
11692
|
|
|
11168
11693
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11169
11694
|
|
|
11170
|
-
var
|
|
11695
|
+
var validMediaType = /^[a-z]+\/[a-z0-9\-\+]+$/i;
|
|
11696
|
+
|
|
11697
|
+
var validAttribute = /^[a-z\-]+=[a-z0-9\-]+$/i;
|
|
11698
|
+
|
|
11699
|
+
var validData = /^[a-z0-9!\$&'\(\)\*\+,;=\-\._~:@\/\?%\s]*$/i;
|
|
11171
11700
|
|
|
11172
11701
|
function isDataURI(str) {
|
|
11173
11702
|
(0, _assertString2.default)(str);
|
|
11174
|
-
|
|
11703
|
+
var data = str.split(',');
|
|
11704
|
+
if (data.length < 2) {
|
|
11705
|
+
return false;
|
|
11706
|
+
}
|
|
11707
|
+
var attributes = data.shift().trim().split(';');
|
|
11708
|
+
var schemeAndMediaType = attributes.shift();
|
|
11709
|
+
if (schemeAndMediaType.substr(0, 5) !== 'data:') {
|
|
11710
|
+
return false;
|
|
11711
|
+
}
|
|
11712
|
+
var mediaType = schemeAndMediaType.substr(5);
|
|
11713
|
+
if (mediaType !== '' && !validMediaType.test(mediaType)) {
|
|
11714
|
+
return false;
|
|
11715
|
+
}
|
|
11716
|
+
for (var i = 0; i < attributes.length; i++) {
|
|
11717
|
+
if (i === attributes.length - 1 && attributes[i].toLowerCase() === 'base64') {
|
|
11718
|
+
// ok
|
|
11719
|
+
} else if (!validAttribute.test(attributes[i])) {
|
|
11720
|
+
return false;
|
|
11721
|
+
}
|
|
11722
|
+
}
|
|
11723
|
+
for (var _i = 0; _i < data.length; _i++) {
|
|
11724
|
+
if (!validData.test(data[_i])) {
|
|
11725
|
+
return false;
|
|
11726
|
+
}
|
|
11727
|
+
}
|
|
11728
|
+
return true;
|
|
11175
11729
|
}
|
|
11176
11730
|
module.exports = exports['default'];
|
|
11177
|
-
},{"./util/assertString":
|
|
11731
|
+
},{"./util/assertString":109}],57:[function(require,module,exports){
|
|
11178
11732
|
'use strict';
|
|
11179
11733
|
|
|
11180
11734
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11216,7 +11770,7 @@ function isDecimal(str, options) {
|
|
|
11216
11770
|
throw new Error('Invalid locale \'' + options.locale + '\'');
|
|
11217
11771
|
}
|
|
11218
11772
|
module.exports = exports['default'];
|
|
11219
|
-
},{"./alpha":
|
|
11773
|
+
},{"./alpha":41,"./util/assertString":109,"./util/merge":110}],58:[function(require,module,exports){
|
|
11220
11774
|
'use strict';
|
|
11221
11775
|
|
|
11222
11776
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11239,7 +11793,7 @@ function isDivisibleBy(str, num) {
|
|
|
11239
11793
|
return (0, _toFloat2.default)(str) % parseInt(num, 10) === 0;
|
|
11240
11794
|
}
|
|
11241
11795
|
module.exports = exports['default'];
|
|
11242
|
-
},{"./toFloat":
|
|
11796
|
+
},{"./toFloat":105,"./util/assertString":109}],59:[function(require,module,exports){
|
|
11243
11797
|
'use strict';
|
|
11244
11798
|
|
|
11245
11799
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11300,8 +11854,16 @@ function isEmail(str, options) {
|
|
|
11300
11854
|
var user = parts.join('@');
|
|
11301
11855
|
|
|
11302
11856
|
var lower_domain = domain.toLowerCase();
|
|
11857
|
+
|
|
11303
11858
|
if (lower_domain === 'gmail.com' || lower_domain === 'googlemail.com') {
|
|
11304
|
-
|
|
11859
|
+
/*
|
|
11860
|
+
Previously we removed dots for gmail addresses before validating.
|
|
11861
|
+
This was removed because it allows `multiple..dots@gmail.com`
|
|
11862
|
+
to be reported as valid, but it is not.
|
|
11863
|
+
Gmail only normalizes single dots, removing them from here is pointless,
|
|
11864
|
+
should be done in normalizeEmail
|
|
11865
|
+
*/
|
|
11866
|
+
user = user.toLowerCase();
|
|
11305
11867
|
}
|
|
11306
11868
|
|
|
11307
11869
|
if (!(0, _isByteLength2.default)(user, { max: 64 }) || !(0, _isByteLength2.default)(domain, { max: 254 })) {
|
|
@@ -11329,7 +11891,7 @@ function isEmail(str, options) {
|
|
|
11329
11891
|
return true;
|
|
11330
11892
|
}
|
|
11331
11893
|
module.exports = exports['default'];
|
|
11332
|
-
},{"./isByteLength":
|
|
11894
|
+
},{"./isByteLength":53,"./isFQDN":61,"./util/assertString":109,"./util/merge":110}],60:[function(require,module,exports){
|
|
11333
11895
|
'use strict';
|
|
11334
11896
|
|
|
11335
11897
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11348,13 +11910,13 @@ function isEmpty(str) {
|
|
|
11348
11910
|
return str.length === 0;
|
|
11349
11911
|
}
|
|
11350
11912
|
module.exports = exports['default'];
|
|
11351
|
-
},{"./util/assertString":
|
|
11913
|
+
},{"./util/assertString":109}],61:[function(require,module,exports){
|
|
11352
11914
|
'use strict';
|
|
11353
11915
|
|
|
11354
11916
|
Object.defineProperty(exports, "__esModule", {
|
|
11355
11917
|
value: true
|
|
11356
11918
|
});
|
|
11357
|
-
exports.default =
|
|
11919
|
+
exports.default = isFQDN;
|
|
11358
11920
|
|
|
11359
11921
|
var _assertString = require('./util/assertString');
|
|
11360
11922
|
|
|
@@ -11372,7 +11934,7 @@ var default_fqdn_options = {
|
|
|
11372
11934
|
allow_trailing_dot: false
|
|
11373
11935
|
};
|
|
11374
11936
|
|
|
11375
|
-
function
|
|
11937
|
+
function isFQDN(str, options) {
|
|
11376
11938
|
(0, _assertString2.default)(str);
|
|
11377
11939
|
options = (0, _merge2.default)(options, default_fqdn_options);
|
|
11378
11940
|
|
|
@@ -11381,6 +11943,11 @@ function isFDQN(str, options) {
|
|
|
11381
11943
|
str = str.substring(0, str.length - 1);
|
|
11382
11944
|
}
|
|
11383
11945
|
var parts = str.split('.');
|
|
11946
|
+
for (var i = 0; i < parts.length; i++) {
|
|
11947
|
+
if (parts[i].length > 63) {
|
|
11948
|
+
return false;
|
|
11949
|
+
}
|
|
11950
|
+
}
|
|
11384
11951
|
if (options.require_tld) {
|
|
11385
11952
|
var tld = parts.pop();
|
|
11386
11953
|
if (!parts.length || !/^([a-z\u00a1-\uffff]{2,}|xn[a-z0-9-]{2,})$/i.test(tld)) {
|
|
@@ -11391,8 +11958,8 @@ function isFDQN(str, options) {
|
|
|
11391
11958
|
return false;
|
|
11392
11959
|
}
|
|
11393
11960
|
}
|
|
11394
|
-
for (var part,
|
|
11395
|
-
part = parts[
|
|
11961
|
+
for (var part, _i = 0; _i < parts.length; _i++) {
|
|
11962
|
+
part = parts[_i];
|
|
11396
11963
|
if (options.allow_underscores) {
|
|
11397
11964
|
part = part.replace(/_/g, '');
|
|
11398
11965
|
}
|
|
@@ -11410,7 +11977,7 @@ function isFDQN(str, options) {
|
|
|
11410
11977
|
return true;
|
|
11411
11978
|
}
|
|
11412
11979
|
module.exports = exports['default'];
|
|
11413
|
-
},{"./util/assertString":
|
|
11980
|
+
},{"./util/assertString":109,"./util/merge":110}],62:[function(require,module,exports){
|
|
11414
11981
|
'use strict';
|
|
11415
11982
|
|
|
11416
11983
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11430,13 +11997,14 @@ function isFloat(str, options) {
|
|
|
11430
11997
|
(0, _assertString2.default)(str);
|
|
11431
11998
|
options = options || {};
|
|
11432
11999
|
var float = new RegExp('^(?:[-+])?(?:[0-9]+)?(?:\\' + (options.locale ? _alpha.decimal[options.locale] : '.') + '[0-9]*)?(?:[eE][\\+\\-]?(?:[0-9]+))?$');
|
|
11433
|
-
if (str === '' || str === '.') {
|
|
12000
|
+
if (str === '' || str === '.' || str === '-' || str === '+') {
|
|
11434
12001
|
return false;
|
|
11435
12002
|
}
|
|
11436
|
-
|
|
12003
|
+
var value = parseFloat(str.replace(',', '.'));
|
|
12004
|
+
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);
|
|
11437
12005
|
}
|
|
11438
12006
|
module.exports = exports['default'];
|
|
11439
|
-
},{"./alpha":
|
|
12007
|
+
},{"./alpha":41,"./util/assertString":109}],63:[function(require,module,exports){
|
|
11440
12008
|
'use strict';
|
|
11441
12009
|
|
|
11442
12010
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11457,7 +12025,7 @@ function isFullWidth(str) {
|
|
|
11457
12025
|
(0, _assertString2.default)(str);
|
|
11458
12026
|
return fullWidth.test(str);
|
|
11459
12027
|
}
|
|
11460
|
-
},{"./util/assertString":
|
|
12028
|
+
},{"./util/assertString":109}],64:[function(require,module,exports){
|
|
11461
12029
|
'use strict';
|
|
11462
12030
|
|
|
11463
12031
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11478,7 +12046,7 @@ function isHalfWidth(str) {
|
|
|
11478
12046
|
(0, _assertString2.default)(str);
|
|
11479
12047
|
return halfWidth.test(str);
|
|
11480
12048
|
}
|
|
11481
|
-
},{"./util/assertString":
|
|
12049
|
+
},{"./util/assertString":109}],65:[function(require,module,exports){
|
|
11482
12050
|
'use strict';
|
|
11483
12051
|
|
|
11484
12052
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11514,7 +12082,7 @@ function isHash(str, algorithm) {
|
|
|
11514
12082
|
return hash.test(str);
|
|
11515
12083
|
}
|
|
11516
12084
|
module.exports = exports['default'];
|
|
11517
|
-
},{"./util/assertString":
|
|
12085
|
+
},{"./util/assertString":109}],66:[function(require,module,exports){
|
|
11518
12086
|
'use strict';
|
|
11519
12087
|
|
|
11520
12088
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11535,7 +12103,7 @@ function isHexColor(str) {
|
|
|
11535
12103
|
return hexcolor.test(str);
|
|
11536
12104
|
}
|
|
11537
12105
|
module.exports = exports['default'];
|
|
11538
|
-
},{"./util/assertString":
|
|
12106
|
+
},{"./util/assertString":109}],67:[function(require,module,exports){
|
|
11539
12107
|
'use strict';
|
|
11540
12108
|
|
|
11541
12109
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11556,7 +12124,7 @@ function isHexadecimal(str) {
|
|
|
11556
12124
|
return hexadecimal.test(str);
|
|
11557
12125
|
}
|
|
11558
12126
|
module.exports = exports['default'];
|
|
11559
|
-
},{"./util/assertString":
|
|
12127
|
+
},{"./util/assertString":109}],68:[function(require,module,exports){
|
|
11560
12128
|
'use strict';
|
|
11561
12129
|
|
|
11562
12130
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11638,7 +12206,7 @@ function isIP(str) {
|
|
|
11638
12206
|
return false;
|
|
11639
12207
|
}
|
|
11640
12208
|
module.exports = exports['default'];
|
|
11641
|
-
},{"./util/assertString":
|
|
12209
|
+
},{"./util/assertString":109}],69:[function(require,module,exports){
|
|
11642
12210
|
'use strict';
|
|
11643
12211
|
|
|
11644
12212
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11696,7 +12264,7 @@ function isISBN(str) {
|
|
|
11696
12264
|
return false;
|
|
11697
12265
|
}
|
|
11698
12266
|
module.exports = exports['default'];
|
|
11699
|
-
},{"./util/assertString":
|
|
12267
|
+
},{"./util/assertString":109}],70:[function(require,module,exports){
|
|
11700
12268
|
'use strict';
|
|
11701
12269
|
|
|
11702
12270
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11745,7 +12313,7 @@ function isISIN(str) {
|
|
|
11745
12313
|
return parseInt(str.substr(str.length - 1), 10) === (10000 - sum) % 10;
|
|
11746
12314
|
}
|
|
11747
12315
|
module.exports = exports['default'];
|
|
11748
|
-
},{"./util/assertString":
|
|
12316
|
+
},{"./util/assertString":109}],71:[function(require,module,exports){
|
|
11749
12317
|
'use strict';
|
|
11750
12318
|
|
|
11751
12319
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11767,7 +12335,29 @@ function isISO31661Alpha2(str) {
|
|
|
11767
12335
|
return validISO31661Alpha2CountriesCodes.includes(str.toUpperCase());
|
|
11768
12336
|
}
|
|
11769
12337
|
module.exports = exports['default'];
|
|
11770
|
-
},{"./util/assertString":
|
|
12338
|
+
},{"./util/assertString":109}],72:[function(require,module,exports){
|
|
12339
|
+
'use strict';
|
|
12340
|
+
|
|
12341
|
+
Object.defineProperty(exports, "__esModule", {
|
|
12342
|
+
value: true
|
|
12343
|
+
});
|
|
12344
|
+
exports.default = isISO31661Alpha3;
|
|
12345
|
+
|
|
12346
|
+
var _assertString = require('./util/assertString');
|
|
12347
|
+
|
|
12348
|
+
var _assertString2 = _interopRequireDefault(_assertString);
|
|
12349
|
+
|
|
12350
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12351
|
+
|
|
12352
|
+
// from https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3
|
|
12353
|
+
var validISO31661Alpha3CountriesCodes = ['AFG', 'ALA', 'ALB', 'DZA', 'ASM', 'AND', 'AGO', 'AIA', 'ATA', 'ATG', 'ARG', 'ARM', 'ABW', 'AUS', 'AUT', 'AZE', 'BHS', 'BHR', 'BGD', 'BRB', 'BLR', 'BEL', 'BLZ', 'BEN', 'BMU', 'BTN', 'BOL', 'BES', 'BIH', 'BWA', 'BVT', 'BRA', 'IOT', 'BRN', 'BGR', 'BFA', 'BDI', 'KHM', 'CMR', 'CAN', 'CPV', 'CYM', 'CAF', 'TCD', 'CHL', 'CHN', 'CXR', 'CCK', 'COL', 'COM', 'COG', 'COD', 'COK', 'CRI', 'CIV', 'HRV', 'CUB', 'CUW', 'CYP', 'CZE', 'DNK', 'DJI', 'DMA', 'DOM', 'ECU', 'EGY', 'SLV', 'GNQ', 'ERI', 'EST', 'ETH', 'FLK', 'FRO', 'FJI', 'FIN', 'FRA', 'GUF', 'PYF', 'ATF', 'GAB', 'GMB', 'GEO', 'DEU', 'GHA', 'GIB', 'GRC', 'GRL', 'GRD', 'GLP', 'GUM', 'GTM', 'GGY', 'GIN', 'GNB', 'GUY', 'HTI', 'HMD', 'VAT', 'HND', 'HKG', 'HUN', 'ISL', 'IND', 'IDN', 'IRN', 'IRQ', 'IRL', 'IMN', 'ISR', 'ITA', 'JAM', 'JPN', 'JEY', 'JOR', 'KAZ', 'KEN', 'KIR', 'PRK', 'KOR', 'KWT', 'KGZ', 'LAO', 'LVA', 'LBN', 'LSO', 'LBR', 'LBY', 'LIE', 'LTU', 'LUX', 'MAC', 'MKD', 'MDG', 'MWI', 'MYS', 'MDV', 'MLI', 'MLT', 'MHL', 'MTQ', 'MRT', 'MUS', 'MYT', 'MEX', 'FSM', 'MDA', 'MCO', 'MNG', 'MNE', 'MSR', 'MAR', 'MOZ', 'MMR', 'NAM', 'NRU', 'NPL', 'NLD', 'NCL', 'NZL', 'NIC', 'NER', 'NGA', 'NIU', 'NFK', 'MNP', 'NOR', 'OMN', 'PAK', 'PLW', 'PSE', 'PAN', 'PNG', 'PRY', 'PER', 'PHL', 'PCN', 'POL', 'PRT', 'PRI', 'QAT', 'REU', 'ROU', 'RUS', 'RWA', 'BLM', 'SHN', 'KNA', 'LCA', 'MAF', 'SPM', 'VCT', 'WSM', 'SMR', 'STP', 'SAU', 'SEN', 'SRB', 'SYC', 'SLE', 'SGP', 'SXM', 'SVK', 'SVN', 'SLB', 'SOM', 'ZAF', 'SGS', 'SSD', 'ESP', 'LKA', 'SDN', 'SUR', 'SJM', 'SWZ', 'SWE', 'CHE', 'SYR', 'TWN', 'TJK', 'TZA', 'THA', 'TLS', 'TGO', 'TKL', 'TON', 'TTO', 'TUN', 'TUR', 'TKM', 'TCA', 'TUV', 'UGA', 'UKR', 'ARE', 'GBR', 'USA', 'UMI', 'URY', 'UZB', 'VUT', 'VEN', 'VNM', 'VGB', 'VIR', 'WLF', 'ESH', 'YEM', 'ZMB', 'ZWE'];
|
|
12354
|
+
|
|
12355
|
+
function isISO31661Alpha3(str) {
|
|
12356
|
+
(0, _assertString2.default)(str);
|
|
12357
|
+
return validISO31661Alpha3CountriesCodes.includes(str.toUpperCase());
|
|
12358
|
+
}
|
|
12359
|
+
module.exports = exports['default'];
|
|
12360
|
+
},{"./util/assertString":109}],73:[function(require,module,exports){
|
|
11771
12361
|
'use strict';
|
|
11772
12362
|
|
|
11773
12363
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11791,7 +12381,7 @@ function isISO8601(str) {
|
|
|
11791
12381
|
return iso8601.test(str);
|
|
11792
12382
|
}
|
|
11793
12383
|
module.exports = exports['default'];
|
|
11794
|
-
},{"./util/assertString":
|
|
12384
|
+
},{"./util/assertString":109}],74:[function(require,module,exports){
|
|
11795
12385
|
'use strict';
|
|
11796
12386
|
|
|
11797
12387
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11813,7 +12403,7 @@ function isISRC(str) {
|
|
|
11813
12403
|
return isrc.test(str);
|
|
11814
12404
|
}
|
|
11815
12405
|
module.exports = exports['default'];
|
|
11816
|
-
},{"./util/assertString":
|
|
12406
|
+
},{"./util/assertString":109}],75:[function(require,module,exports){
|
|
11817
12407
|
'use strict';
|
|
11818
12408
|
|
|
11819
12409
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11872,7 +12462,7 @@ function isISSN(str) {
|
|
|
11872
12462
|
return checksum % 11 === 0;
|
|
11873
12463
|
}
|
|
11874
12464
|
module.exports = exports['default'];
|
|
11875
|
-
},{"./util/assertString":
|
|
12465
|
+
},{"./util/assertString":109}],76:[function(require,module,exports){
|
|
11876
12466
|
'use strict';
|
|
11877
12467
|
|
|
11878
12468
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11912,7 +12502,7 @@ function isIn(str, options) {
|
|
|
11912
12502
|
return false;
|
|
11913
12503
|
}
|
|
11914
12504
|
module.exports = exports['default'];
|
|
11915
|
-
},{"./util/assertString":
|
|
12505
|
+
},{"./util/assertString":109,"./util/toString":111}],77:[function(require,module,exports){
|
|
11916
12506
|
'use strict';
|
|
11917
12507
|
|
|
11918
12508
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11946,7 +12536,7 @@ function isInt(str, options) {
|
|
|
11946
12536
|
return regex.test(str) && minCheckPassed && maxCheckPassed && ltCheckPassed && gtCheckPassed;
|
|
11947
12537
|
}
|
|
11948
12538
|
module.exports = exports['default'];
|
|
11949
|
-
},{"./util/assertString":
|
|
12539
|
+
},{"./util/assertString":109}],78:[function(require,module,exports){
|
|
11950
12540
|
'use strict';
|
|
11951
12541
|
|
|
11952
12542
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11972,7 +12562,7 @@ function isJSON(str) {
|
|
|
11972
12562
|
return false;
|
|
11973
12563
|
}
|
|
11974
12564
|
module.exports = exports['default'];
|
|
11975
|
-
},{"./util/assertString":
|
|
12565
|
+
},{"./util/assertString":109}],79:[function(require,module,exports){
|
|
11976
12566
|
'use strict';
|
|
11977
12567
|
|
|
11978
12568
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11996,7 +12586,7 @@ var lat = /^\(?[+-]?(90(\.0+)?|[1-8]?\d(\.\d+)?)$/;
|
|
|
11996
12586
|
var long = /^\s?[+-]?(180(\.0+)?|1[0-7]\d(\.\d+)?|\d{1,2}(\.\d+)?)\)?$/;
|
|
11997
12587
|
|
|
11998
12588
|
module.exports = exports['default'];
|
|
11999
|
-
},{"./util/assertString":
|
|
12589
|
+
},{"./util/assertString":109}],80:[function(require,module,exports){
|
|
12000
12590
|
'use strict';
|
|
12001
12591
|
|
|
12002
12592
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12031,7 +12621,7 @@ function isLength(str, options) {
|
|
|
12031
12621
|
return len >= min && (typeof max === 'undefined' || len <= max);
|
|
12032
12622
|
}
|
|
12033
12623
|
module.exports = exports['default'];
|
|
12034
|
-
},{"./util/assertString":
|
|
12624
|
+
},{"./util/assertString":109}],81:[function(require,module,exports){
|
|
12035
12625
|
'use strict';
|
|
12036
12626
|
|
|
12037
12627
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12050,7 +12640,7 @@ function isLowercase(str) {
|
|
|
12050
12640
|
return str === str.toLowerCase();
|
|
12051
12641
|
}
|
|
12052
12642
|
module.exports = exports['default'];
|
|
12053
|
-
},{"./util/assertString":
|
|
12643
|
+
},{"./util/assertString":109}],82:[function(require,module,exports){
|
|
12054
12644
|
'use strict';
|
|
12055
12645
|
|
|
12056
12646
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12071,7 +12661,7 @@ function isMACAddress(str) {
|
|
|
12071
12661
|
return macAddress.test(str);
|
|
12072
12662
|
}
|
|
12073
12663
|
module.exports = exports['default'];
|
|
12074
|
-
},{"./util/assertString":
|
|
12664
|
+
},{"./util/assertString":109}],83:[function(require,module,exports){
|
|
12075
12665
|
'use strict';
|
|
12076
12666
|
|
|
12077
12667
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12092,7 +12682,60 @@ function isMD5(str) {
|
|
|
12092
12682
|
return md5.test(str);
|
|
12093
12683
|
}
|
|
12094
12684
|
module.exports = exports['default'];
|
|
12095
|
-
},{"./util/assertString":
|
|
12685
|
+
},{"./util/assertString":109}],84:[function(require,module,exports){
|
|
12686
|
+
'use strict';
|
|
12687
|
+
|
|
12688
|
+
Object.defineProperty(exports, "__esModule", {
|
|
12689
|
+
value: true
|
|
12690
|
+
});
|
|
12691
|
+
exports.default = isMimeType;
|
|
12692
|
+
|
|
12693
|
+
var _assertString = require('./util/assertString');
|
|
12694
|
+
|
|
12695
|
+
var _assertString2 = _interopRequireDefault(_assertString);
|
|
12696
|
+
|
|
12697
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12698
|
+
|
|
12699
|
+
/*
|
|
12700
|
+
Checks if the provided string matches to a correct Media type format (MIME type)
|
|
12701
|
+
|
|
12702
|
+
This function only checks is the string format follows the
|
|
12703
|
+
etablished rules by the according RFC specifications.
|
|
12704
|
+
This function supports 'charset' in textual media types
|
|
12705
|
+
(https://tools.ietf.org/html/rfc6657).
|
|
12706
|
+
|
|
12707
|
+
This function does not check against all the media types listed
|
|
12708
|
+
by the IANA (https://www.iana.org/assignments/media-types/media-types.xhtml)
|
|
12709
|
+
because of lightness purposes : it would require to include
|
|
12710
|
+
all these MIME types in this librairy, which would weigh it
|
|
12711
|
+
significantly. This kind of effort maybe is not worth for the use that
|
|
12712
|
+
this function has in this entire librairy.
|
|
12713
|
+
|
|
12714
|
+
More informations in the RFC specifications :
|
|
12715
|
+
- https://tools.ietf.org/html/rfc2045
|
|
12716
|
+
- https://tools.ietf.org/html/rfc2046
|
|
12717
|
+
- https://tools.ietf.org/html/rfc7231#section-3.1.1.1
|
|
12718
|
+
- https://tools.ietf.org/html/rfc7231#section-3.1.1.5
|
|
12719
|
+
*/
|
|
12720
|
+
|
|
12721
|
+
// Match simple MIME types
|
|
12722
|
+
// NB :
|
|
12723
|
+
// Subtype length must not exceed 100 characters.
|
|
12724
|
+
// This rule does not comply to the RFC specs (what is the max length ?).
|
|
12725
|
+
var mimeTypeSimple = /^(application|audio|font|image|message|model|multipart|text|video)\/[a-zA-Z0-9\.\-\+]{1,100}$/i; // eslint-disable-line max-len
|
|
12726
|
+
|
|
12727
|
+
// Handle "charset" in "text/*"
|
|
12728
|
+
var mimeTypeText = /^text\/[a-zA-Z0-9\.\-\+]{1,100};\s?charset=("[a-zA-Z0-9\.\-\+\s]{0,70}"|[a-zA-Z0-9\.\-\+]{0,70})(\s?\([a-zA-Z0-9\.\-\+\s]{1,20}\))?$/i; // eslint-disable-line max-len
|
|
12729
|
+
|
|
12730
|
+
// Handle "boundary" in "multipart/*"
|
|
12731
|
+
var mimeTypeMultipart = /^multipart\/[a-zA-Z0-9\.\-\+]{1,100}(;\s?(boundary|charset)=("[a-zA-Z0-9\.\-\+\s]{0,70}"|[a-zA-Z0-9\.\-\+]{0,70})(\s?\([a-zA-Z0-9\.\-\+\s]{1,20}\))?){0,2}$/i; // eslint-disable-line max-len
|
|
12732
|
+
|
|
12733
|
+
function isMimeType(str) {
|
|
12734
|
+
(0, _assertString2.default)(str);
|
|
12735
|
+
return mimeTypeSimple.test(str) || mimeTypeText.test(str) || mimeTypeMultipart.test(str);
|
|
12736
|
+
}
|
|
12737
|
+
module.exports = exports['default'];
|
|
12738
|
+
},{"./util/assertString":109}],85:[function(require,module,exports){
|
|
12096
12739
|
'use strict';
|
|
12097
12740
|
|
|
12098
12741
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12114,19 +12757,22 @@ var phones = {
|
|
|
12114
12757
|
'ar-JO': /^(\+?962|0)?7[789]\d{7}$/,
|
|
12115
12758
|
'ar-SA': /^(!?(\+?966)|0)?5\d{8}$/,
|
|
12116
12759
|
'ar-SY': /^(!?(\+?963)|0)?9\d{8}$/,
|
|
12760
|
+
'be-BY': /^(\+?375)?(24|25|29|33|44)\d{7}$/,
|
|
12761
|
+
'bg-BG': /^(\+?359|0)?8[789]\d{7}$/,
|
|
12117
12762
|
'cs-CZ': /^(\+?420)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,
|
|
12118
12763
|
'da-DK': /^(\+?45)?\s?\d{2}\s?\d{2}\s?\d{2}\s?\d{2}$/,
|
|
12119
12764
|
'de-DE': /^(\+?49[ \.\-])?([\(]{1}[0-9]{1,6}[\)])?([0-9 \.\-\/]{3,20})((x|ext|extension)[ ]?[0-9]{1,4})?$/,
|
|
12120
|
-
'el-GR': /^(\+?30)?(69\d{8})$/,
|
|
12765
|
+
'el-GR': /^(\+?30|0)?(69\d{8})$/,
|
|
12121
12766
|
'en-AU': /^(\+?61|0)4\d{8}$/,
|
|
12122
12767
|
'en-GB': /^(\+?44|0)7\d{9}$/,
|
|
12123
12768
|
'en-HK': /^(\+?852\-?)?[456789]\d{3}\-?\d{4}$/,
|
|
12124
|
-
'en-IN': /^(\+?91|0)?[
|
|
12769
|
+
'en-IN': /^(\+?91|0)?[6789]\d{9}$/,
|
|
12125
12770
|
'en-KE': /^(\+?254|0)?[7]\d{8}$/,
|
|
12126
12771
|
'en-NG': /^(\+?234|0)?[789]\d{9}$/,
|
|
12127
12772
|
'en-NZ': /^(\+?64|0)2\d{7,9}$/,
|
|
12128
12773
|
'en-PK': /^((\+92)|(0092))-{0,1}\d{3}-{0,1}\d{7}$|^\d{11}$|^\d{4}-\d{7}$/,
|
|
12129
12774
|
'en-RW': /^(\+?250|0)?[7]\d{8}$/,
|
|
12775
|
+
'en-SG': /^(\+65)?[89]\d{7}$/,
|
|
12130
12776
|
'en-TZ': /^(\+?255|0)?[67]\d{8}$/,
|
|
12131
12777
|
'en-UG': /^(\+?256|0)?[7]\d{8}$/,
|
|
12132
12778
|
'en-US': /^(\+?1)?[2-9]\d{2}[2-9](?!11)\d{6}$/,
|
|
@@ -12138,11 +12784,12 @@ var phones = {
|
|
|
12138
12784
|
'fi-FI': /^(\+?358|0)\s?(4(0|1|2|4|5|6)?|50)\s?(\d\s?){4,8}\d$/,
|
|
12139
12785
|
'fo-FO': /^(\+?298)?\s?\d{2}\s?\d{2}\s?\d{2}$/,
|
|
12140
12786
|
'fr-FR': /^(\+?33|0)[67]\d{8}$/,
|
|
12141
|
-
'he-IL': /^(\+972|0)([23489]|5[
|
|
12787
|
+
'he-IL': /^(\+972|0)([23489]|5[012345689]|77)[1-9]\d{6}/,
|
|
12142
12788
|
'hu-HU': /^(\+?36)(20|30|70)\d{7}$/,
|
|
12143
12789
|
'id-ID': /^(\+?62|0[1-9])[\s|\d]+$/,
|
|
12144
12790
|
'it-IT': /^(\+?39)?\s?3\d{2} ?\d{6,7}$/,
|
|
12145
12791
|
'ja-JP': /^(\+?81|0)[789]0[ \-]?[1-9]\d{2}[ \-]?\d{5}$/,
|
|
12792
|
+
'kk-KZ': /^(\+?7|8)?7\d{9}$/,
|
|
12146
12793
|
'kl-GL': /^(\+?299)?\s?\d{2}\s?\d{2}\s?\d{2}$/,
|
|
12147
12794
|
'ko-KR': /^((\+?82)[ \-]?)?0?1([0|1|6|7|8|9]{1})[ \-]?\d{3,4}[ \-]?\d{4}$/,
|
|
12148
12795
|
'lt-LT': /^(\+370|8)\d{8}$/,
|
|
@@ -12157,10 +12804,11 @@ var phones = {
|
|
|
12157
12804
|
'ru-RU': /^(\+?7|8)?9\d{9}$/,
|
|
12158
12805
|
'sk-SK': /^(\+?421)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,
|
|
12159
12806
|
'sr-RS': /^(\+3816|06)[- \d]{5,9}$/,
|
|
12807
|
+
'th-TH': /^(\+66|66|0)\d{9}$/,
|
|
12160
12808
|
'tr-TR': /^(\+?90|0)?5\d{9}$/,
|
|
12161
12809
|
'uk-UA': /^(\+?38|8)?0\d{9}$/,
|
|
12162
12810
|
'vi-VN': /^(\+?84|0)?((1(2([0-9])|6([2-9])|88|99))|(9((?!5)[0-9])))([0-9]{7})$/,
|
|
12163
|
-
'zh-CN': /^(\+?0?86\-?)?1[
|
|
12811
|
+
'zh-CN': /^(\+?0?86\-?)?1[3456789]\d{9}$/,
|
|
12164
12812
|
'zh-TW': /^(\+?886\-?|0)?9\d{8}$/
|
|
12165
12813
|
};
|
|
12166
12814
|
/* eslint-enable max-len */
|
|
@@ -12170,8 +12818,11 @@ phones['en-CA'] = phones['en-US'];
|
|
|
12170
12818
|
phones['fr-BE'] = phones['nl-BE'];
|
|
12171
12819
|
phones['zh-HK'] = phones['en-HK'];
|
|
12172
12820
|
|
|
12173
|
-
function isMobilePhone(str, locale) {
|
|
12821
|
+
function isMobilePhone(str, locale, options) {
|
|
12174
12822
|
(0, _assertString2.default)(str);
|
|
12823
|
+
if (options && options.strictMode && !str.startsWith('+')) {
|
|
12824
|
+
return false;
|
|
12825
|
+
}
|
|
12175
12826
|
if (locale in phones) {
|
|
12176
12827
|
return phones[locale].test(str);
|
|
12177
12828
|
} else if (locale === 'any') {
|
|
@@ -12188,7 +12839,7 @@ function isMobilePhone(str, locale) {
|
|
|
12188
12839
|
throw new Error('Invalid locale \'' + locale + '\'');
|
|
12189
12840
|
}
|
|
12190
12841
|
module.exports = exports['default'];
|
|
12191
|
-
},{"./util/assertString":
|
|
12842
|
+
},{"./util/assertString":109}],86:[function(require,module,exports){
|
|
12192
12843
|
'use strict';
|
|
12193
12844
|
|
|
12194
12845
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12211,7 +12862,7 @@ function isMongoId(str) {
|
|
|
12211
12862
|
return (0, _isHexadecimal2.default)(str) && str.length === 24;
|
|
12212
12863
|
}
|
|
12213
12864
|
module.exports = exports['default'];
|
|
12214
|
-
},{"./isHexadecimal":
|
|
12865
|
+
},{"./isHexadecimal":67,"./util/assertString":109}],87:[function(require,module,exports){
|
|
12215
12866
|
'use strict';
|
|
12216
12867
|
|
|
12217
12868
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12234,7 +12885,7 @@ function isMultibyte(str) {
|
|
|
12234
12885
|
return multibyte.test(str);
|
|
12235
12886
|
}
|
|
12236
12887
|
module.exports = exports['default'];
|
|
12237
|
-
},{"./util/assertString":
|
|
12888
|
+
},{"./util/assertString":109}],88:[function(require,module,exports){
|
|
12238
12889
|
'use strict';
|
|
12239
12890
|
|
|
12240
12891
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12248,14 +12899,14 @@ var _assertString2 = _interopRequireDefault(_assertString);
|
|
|
12248
12899
|
|
|
12249
12900
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12250
12901
|
|
|
12251
|
-
var numeric = /^[
|
|
12902
|
+
var numeric = /^[+-]?([0-9]*[.])?[0-9]+$/;
|
|
12252
12903
|
|
|
12253
12904
|
function isNumeric(str) {
|
|
12254
12905
|
(0, _assertString2.default)(str);
|
|
12255
12906
|
return numeric.test(str);
|
|
12256
12907
|
}
|
|
12257
12908
|
module.exports = exports['default'];
|
|
12258
|
-
},{"./util/assertString":
|
|
12909
|
+
},{"./util/assertString":109}],89:[function(require,module,exports){
|
|
12259
12910
|
'use strict';
|
|
12260
12911
|
|
|
12261
12912
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12273,7 +12924,7 @@ function isPort(str) {
|
|
|
12273
12924
|
return (0, _isInt2.default)(str, { min: 0, max: 65535 });
|
|
12274
12925
|
}
|
|
12275
12926
|
module.exports = exports['default'];
|
|
12276
|
-
},{"./isInt":
|
|
12927
|
+
},{"./isInt":77}],90:[function(require,module,exports){
|
|
12277
12928
|
'use strict';
|
|
12278
12929
|
|
|
12279
12930
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12315,6 +12966,7 @@ var patterns = {
|
|
|
12315
12966
|
AT: fourDigit,
|
|
12316
12967
|
AU: fourDigit,
|
|
12317
12968
|
BE: fourDigit,
|
|
12969
|
+
BG: fourDigit,
|
|
12318
12970
|
CA: /^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJ-NPRSTV-Z][\s\-]?\d[ABCEGHJ-NPRSTV-Z]\d$/i,
|
|
12319
12971
|
CH: fourDigit,
|
|
12320
12972
|
CZ: /^\d{3}\s?\d{2}$/,
|
|
@@ -12337,19 +12989,60 @@ var patterns = {
|
|
|
12337
12989
|
NL: /^\d{4}\s?[a-z]{2}$/i,
|
|
12338
12990
|
NO: fourDigit,
|
|
12339
12991
|
PL: /^\d{2}\-\d{3}$/,
|
|
12340
|
-
PT: /^\d{4}
|
|
12992
|
+
PT: /^\d{4}\-\d{3}?$/,
|
|
12341
12993
|
RO: sixDigit,
|
|
12342
12994
|
RU: sixDigit,
|
|
12343
12995
|
SA: fiveDigit,
|
|
12344
12996
|
SE: /^\d{3}\s?\d{2}$/,
|
|
12997
|
+
SK: /^\d{3}\s?\d{2}$/,
|
|
12345
12998
|
TW: /^\d{3}(\d{2})?$/,
|
|
12346
12999
|
US: /^\d{5}(-\d{4})?$/,
|
|
12347
13000
|
ZA: fourDigit,
|
|
12348
13001
|
ZM: fiveDigit
|
|
12349
13002
|
};
|
|
12350
13003
|
|
|
12351
|
-
var locales = exports.locales = Object.keys(patterns);
|
|
12352
|
-
},{"./util/assertString":
|
|
13004
|
+
var locales = exports.locales = Object.keys(patterns);
|
|
13005
|
+
},{"./util/assertString":109}],91:[function(require,module,exports){
|
|
13006
|
+
'use strict';
|
|
13007
|
+
|
|
13008
|
+
Object.defineProperty(exports, "__esModule", {
|
|
13009
|
+
value: true
|
|
13010
|
+
});
|
|
13011
|
+
exports.default = isRFC3339;
|
|
13012
|
+
|
|
13013
|
+
var _assertString = require('./util/assertString');
|
|
13014
|
+
|
|
13015
|
+
var _assertString2 = _interopRequireDefault(_assertString);
|
|
13016
|
+
|
|
13017
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13018
|
+
|
|
13019
|
+
/* Based on https://tools.ietf.org/html/rfc3339#section-5.6 */
|
|
13020
|
+
|
|
13021
|
+
var dateFullYear = /[0-9]{4}/;
|
|
13022
|
+
var dateMonth = /(0[1-9]|1[0-2])/;
|
|
13023
|
+
var dateMDay = /([12]\d|0[1-9]|3[01])/;
|
|
13024
|
+
|
|
13025
|
+
var timeHour = /([01][0-9]|2[0-3])/;
|
|
13026
|
+
var timeMinute = /[0-5][0-9]/;
|
|
13027
|
+
var timeSecond = /([0-5][0-9]|60)/;
|
|
13028
|
+
|
|
13029
|
+
var timeSecFrac = /(\.[0-9]+)?/;
|
|
13030
|
+
var timeNumOffset = new RegExp('[-+]' + timeHour.source + ':' + timeMinute.source);
|
|
13031
|
+
var timeOffset = new RegExp('([zZ]|' + timeNumOffset.source + ')');
|
|
13032
|
+
|
|
13033
|
+
var partialTime = new RegExp(timeHour.source + ':' + timeMinute.source + ':' + timeSecond.source + timeSecFrac.source);
|
|
13034
|
+
|
|
13035
|
+
var fullDate = new RegExp(dateFullYear.source + '-' + dateMonth.source + '-' + dateMDay.source);
|
|
13036
|
+
var fullTime = new RegExp('' + partialTime.source + timeOffset.source);
|
|
13037
|
+
|
|
13038
|
+
var rfc3339 = new RegExp(fullDate.source + '[ tT]' + fullTime.source);
|
|
13039
|
+
|
|
13040
|
+
function isRFC3339(str) {
|
|
13041
|
+
(0, _assertString2.default)(str);
|
|
13042
|
+
return rfc3339.test(str);
|
|
13043
|
+
}
|
|
13044
|
+
module.exports = exports['default'];
|
|
13045
|
+
},{"./util/assertString":109}],92:[function(require,module,exports){
|
|
12353
13046
|
'use strict';
|
|
12354
13047
|
|
|
12355
13048
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12370,7 +13063,7 @@ function isSurrogatePair(str) {
|
|
|
12370
13063
|
return surrogatePair.test(str);
|
|
12371
13064
|
}
|
|
12372
13065
|
module.exports = exports['default'];
|
|
12373
|
-
},{"./util/assertString":
|
|
13066
|
+
},{"./util/assertString":109}],93:[function(require,module,exports){
|
|
12374
13067
|
'use strict';
|
|
12375
13068
|
|
|
12376
13069
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12518,7 +13211,7 @@ function isURL(url, options) {
|
|
|
12518
13211
|
return true;
|
|
12519
13212
|
}
|
|
12520
13213
|
module.exports = exports['default'];
|
|
12521
|
-
},{"./isFQDN":
|
|
13214
|
+
},{"./isFQDN":61,"./isIP":68,"./util/assertString":109,"./util/merge":110}],94:[function(require,module,exports){
|
|
12522
13215
|
'use strict';
|
|
12523
13216
|
|
|
12524
13217
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12547,7 +13240,7 @@ function isUUID(str) {
|
|
|
12547
13240
|
return pattern && pattern.test(str);
|
|
12548
13241
|
}
|
|
12549
13242
|
module.exports = exports['default'];
|
|
12550
|
-
},{"./util/assertString":
|
|
13243
|
+
},{"./util/assertString":109}],95:[function(require,module,exports){
|
|
12551
13244
|
'use strict';
|
|
12552
13245
|
|
|
12553
13246
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12566,7 +13259,7 @@ function isUppercase(str) {
|
|
|
12566
13259
|
return str === str.toUpperCase();
|
|
12567
13260
|
}
|
|
12568
13261
|
module.exports = exports['default'];
|
|
12569
|
-
},{"./util/assertString":
|
|
13262
|
+
},{"./util/assertString":109}],96:[function(require,module,exports){
|
|
12570
13263
|
'use strict';
|
|
12571
13264
|
|
|
12572
13265
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12589,7 +13282,7 @@ function isVariableWidth(str) {
|
|
|
12589
13282
|
return _isFullWidth.fullWidth.test(str) && _isHalfWidth.halfWidth.test(str);
|
|
12590
13283
|
}
|
|
12591
13284
|
module.exports = exports['default'];
|
|
12592
|
-
},{"./isFullWidth":
|
|
13285
|
+
},{"./isFullWidth":63,"./isHalfWidth":64,"./util/assertString":109}],97:[function(require,module,exports){
|
|
12593
13286
|
'use strict';
|
|
12594
13287
|
|
|
12595
13288
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12613,7 +13306,7 @@ function isWhitelisted(str, chars) {
|
|
|
12613
13306
|
return true;
|
|
12614
13307
|
}
|
|
12615
13308
|
module.exports = exports['default'];
|
|
12616
|
-
},{"./util/assertString":
|
|
13309
|
+
},{"./util/assertString":109}],98:[function(require,module,exports){
|
|
12617
13310
|
'use strict';
|
|
12618
13311
|
|
|
12619
13312
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12633,7 +13326,7 @@ function ltrim(str, chars) {
|
|
|
12633
13326
|
return str.replace(pattern, '');
|
|
12634
13327
|
}
|
|
12635
13328
|
module.exports = exports['default'];
|
|
12636
|
-
},{"./util/assertString":
|
|
13329
|
+
},{"./util/assertString":109}],99:[function(require,module,exports){
|
|
12637
13330
|
'use strict';
|
|
12638
13331
|
|
|
12639
13332
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12655,7 +13348,7 @@ function matches(str, pattern, modifiers) {
|
|
|
12655
13348
|
return pattern.test(str);
|
|
12656
13349
|
}
|
|
12657
13350
|
module.exports = exports['default'];
|
|
12658
|
-
},{"./util/assertString":
|
|
13351
|
+
},{"./util/assertString":109}],100:[function(require,module,exports){
|
|
12659
13352
|
'use strict';
|
|
12660
13353
|
|
|
12661
13354
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12698,6 +13391,10 @@ var default_normalize_email_options = {
|
|
|
12698
13391
|
// Removes the subaddress (e.g. "-foo") from the email address
|
|
12699
13392
|
yahoo_remove_subaddress: true,
|
|
12700
13393
|
|
|
13394
|
+
// The following conversions are specific to Yandex
|
|
13395
|
+
// Lowercases the local part of the Yandex address (known to be case-insensitive)
|
|
13396
|
+
yandex_lowercase: true,
|
|
13397
|
+
|
|
12701
13398
|
// The following conversions are specific to iCloud
|
|
12702
13399
|
// Lowercases the local part of the iCloud address (known to be case-insensitive)
|
|
12703
13400
|
icloud_lowercase: true,
|
|
@@ -12718,6 +13415,17 @@ var outlookdotcom_domains = ['hotmail.at', 'hotmail.be', 'hotmail.ca', 'hotmail.
|
|
|
12718
13415
|
// This list is likely incomplete
|
|
12719
13416
|
var yahoo_domains = ['rocketmail.com', 'yahoo.ca', 'yahoo.co.uk', 'yahoo.com', 'yahoo.de', 'yahoo.fr', 'yahoo.in', 'yahoo.it', 'ymail.com'];
|
|
12720
13417
|
|
|
13418
|
+
// List of domains used by yandex.ru
|
|
13419
|
+
var yandex_domains = ['yandex.ru', 'yandex.ua', 'yandex.kz', 'yandex.com', 'yandex.by', 'ya.ru'];
|
|
13420
|
+
|
|
13421
|
+
// replace single dots, but not multiple consecutive dots
|
|
13422
|
+
function dotsReplacer(match) {
|
|
13423
|
+
if (match.length > 1) {
|
|
13424
|
+
return match;
|
|
13425
|
+
}
|
|
13426
|
+
return '';
|
|
13427
|
+
}
|
|
13428
|
+
|
|
12721
13429
|
function normalizeEmail(email, options) {
|
|
12722
13430
|
options = (0, _merge2.default)(options, default_normalize_email_options);
|
|
12723
13431
|
|
|
@@ -12735,7 +13443,8 @@ function normalizeEmail(email, options) {
|
|
|
12735
13443
|
parts[0] = parts[0].split('+')[0];
|
|
12736
13444
|
}
|
|
12737
13445
|
if (options.gmail_remove_dots) {
|
|
12738
|
-
|
|
13446
|
+
// this does not replace consecutive dots like example..email@gmail.com
|
|
13447
|
+
parts[0] = parts[0].replace(/\.+/g, dotsReplacer);
|
|
12739
13448
|
}
|
|
12740
13449
|
if (!parts[0].length) {
|
|
12741
13450
|
return false;
|
|
@@ -12778,6 +13487,11 @@ function normalizeEmail(email, options) {
|
|
|
12778
13487
|
if (options.all_lowercase || options.yahoo_lowercase) {
|
|
12779
13488
|
parts[0] = parts[0].toLowerCase();
|
|
12780
13489
|
}
|
|
13490
|
+
} else if (~yandex_domains.indexOf(parts[1])) {
|
|
13491
|
+
if (options.all_lowercase || options.yandex_lowercase) {
|
|
13492
|
+
parts[0] = parts[0].toLowerCase();
|
|
13493
|
+
}
|
|
13494
|
+
parts[1] = 'yandex.ru'; // all yandex domains are equal, 1st preffered
|
|
12781
13495
|
} else if (options.all_lowercase) {
|
|
12782
13496
|
// Any other address
|
|
12783
13497
|
parts[0] = parts[0].toLowerCase();
|
|
@@ -12785,7 +13499,7 @@ function normalizeEmail(email, options) {
|
|
|
12785
13499
|
return parts.join('@');
|
|
12786
13500
|
}
|
|
12787
13501
|
module.exports = exports['default'];
|
|
12788
|
-
},{"./util/merge":
|
|
13502
|
+
},{"./util/merge":110}],101:[function(require,module,exports){
|
|
12789
13503
|
'use strict';
|
|
12790
13504
|
|
|
12791
13505
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12811,7 +13525,7 @@ function rtrim(str, chars) {
|
|
|
12811
13525
|
return idx < str.length ? str.substr(0, idx + 1) : str;
|
|
12812
13526
|
}
|
|
12813
13527
|
module.exports = exports['default'];
|
|
12814
|
-
},{"./util/assertString":
|
|
13528
|
+
},{"./util/assertString":109}],102:[function(require,module,exports){
|
|
12815
13529
|
'use strict';
|
|
12816
13530
|
|
|
12817
13531
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12835,7 +13549,7 @@ function stripLow(str, keep_new_lines) {
|
|
|
12835
13549
|
return (0, _blacklist2.default)(str, chars);
|
|
12836
13550
|
}
|
|
12837
13551
|
module.exports = exports['default'];
|
|
12838
|
-
},{"./blacklist":
|
|
13552
|
+
},{"./blacklist":42,"./util/assertString":109}],103:[function(require,module,exports){
|
|
12839
13553
|
'use strict';
|
|
12840
13554
|
|
|
12841
13555
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12857,7 +13571,7 @@ function toBoolean(str, strict) {
|
|
|
12857
13571
|
return str !== '0' && str !== 'false' && str !== '';
|
|
12858
13572
|
}
|
|
12859
13573
|
module.exports = exports['default'];
|
|
12860
|
-
},{"./util/assertString":
|
|
13574
|
+
},{"./util/assertString":109}],104:[function(require,module,exports){
|
|
12861
13575
|
'use strict';
|
|
12862
13576
|
|
|
12863
13577
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12877,7 +13591,7 @@ function toDate(date) {
|
|
|
12877
13591
|
return !isNaN(date) ? new Date(date) : null;
|
|
12878
13592
|
}
|
|
12879
13593
|
module.exports = exports['default'];
|
|
12880
|
-
},{"./util/assertString":
|
|
13594
|
+
},{"./util/assertString":109}],105:[function(require,module,exports){
|
|
12881
13595
|
'use strict';
|
|
12882
13596
|
|
|
12883
13597
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12896,7 +13610,7 @@ function toFloat(str) {
|
|
|
12896
13610
|
return parseFloat(str);
|
|
12897
13611
|
}
|
|
12898
13612
|
module.exports = exports['default'];
|
|
12899
|
-
},{"./util/assertString":
|
|
13613
|
+
},{"./util/assertString":109}],106:[function(require,module,exports){
|
|
12900
13614
|
'use strict';
|
|
12901
13615
|
|
|
12902
13616
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12915,7 +13629,7 @@ function toInt(str, radix) {
|
|
|
12915
13629
|
return parseInt(str, radix || 10);
|
|
12916
13630
|
}
|
|
12917
13631
|
module.exports = exports['default'];
|
|
12918
|
-
},{"./util/assertString":
|
|
13632
|
+
},{"./util/assertString":109}],107:[function(require,module,exports){
|
|
12919
13633
|
'use strict';
|
|
12920
13634
|
|
|
12921
13635
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12937,7 +13651,7 @@ function trim(str, chars) {
|
|
|
12937
13651
|
return (0, _rtrim2.default)((0, _ltrim2.default)(str, chars), chars);
|
|
12938
13652
|
}
|
|
12939
13653
|
module.exports = exports['default'];
|
|
12940
|
-
},{"./ltrim":
|
|
13654
|
+
},{"./ltrim":98,"./rtrim":101}],108:[function(require,module,exports){
|
|
12941
13655
|
'use strict';
|
|
12942
13656
|
|
|
12943
13657
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12956,7 +13670,7 @@ function unescape(str) {
|
|
|
12956
13670
|
return str.replace(/&/g, '&').replace(/"/g, '"').replace(/'/g, "'").replace(/</g, '<').replace(/>/g, '>').replace(///g, '/').replace(/\/g, '\\').replace(/`/g, '`');
|
|
12957
13671
|
}
|
|
12958
13672
|
module.exports = exports['default'];
|
|
12959
|
-
},{"./util/assertString":
|
|
13673
|
+
},{"./util/assertString":109}],109:[function(require,module,exports){
|
|
12960
13674
|
'use strict';
|
|
12961
13675
|
|
|
12962
13676
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12971,7 +13685,7 @@ function assertString(input) {
|
|
|
12971
13685
|
}
|
|
12972
13686
|
}
|
|
12973
13687
|
module.exports = exports['default'];
|
|
12974
|
-
},{}],
|
|
13688
|
+
},{}],110:[function(require,module,exports){
|
|
12975
13689
|
'use strict';
|
|
12976
13690
|
|
|
12977
13691
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12990,7 +13704,7 @@ function merge() {
|
|
|
12990
13704
|
return obj;
|
|
12991
13705
|
}
|
|
12992
13706
|
module.exports = exports['default'];
|
|
12993
|
-
},{}],
|
|
13707
|
+
},{}],111:[function(require,module,exports){
|
|
12994
13708
|
'use strict';
|
|
12995
13709
|
|
|
12996
13710
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -13013,7 +13727,7 @@ function toString(input) {
|
|
|
13013
13727
|
return String(input);
|
|
13014
13728
|
}
|
|
13015
13729
|
module.exports = exports['default'];
|
|
13016
|
-
},{}],
|
|
13730
|
+
},{}],112:[function(require,module,exports){
|
|
13017
13731
|
'use strict';
|
|
13018
13732
|
|
|
13019
13733
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -13032,7 +13746,7 @@ function whitelist(str, chars) {
|
|
|
13032
13746
|
return str.replace(new RegExp('[^' + chars + ']+', 'g'), '');
|
|
13033
13747
|
}
|
|
13034
13748
|
module.exports = exports['default'];
|
|
13035
|
-
},{"./util/assertString":
|
|
13749
|
+
},{"./util/assertString":109}],113:[function(require,module,exports){
|
|
13036
13750
|
module.exports = extend
|
|
13037
13751
|
|
|
13038
13752
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
@@ -13053,7 +13767,7 @@ function extend() {
|
|
|
13053
13767
|
return target
|
|
13054
13768
|
}
|
|
13055
13769
|
|
|
13056
|
-
},{}],
|
|
13770
|
+
},{}],114:[function(require,module,exports){
|
|
13057
13771
|
"use strict";
|
|
13058
13772
|
|
|
13059
13773
|
module.exports = {
|
|
@@ -13061,6 +13775,7 @@ module.exports = {
|
|
|
13061
13775
|
INVALID_TYPE: "Expected type {0} but found type {1}",
|
|
13062
13776
|
INVALID_FORMAT: "Object didn't pass validation for format {0}: {1}",
|
|
13063
13777
|
ENUM_MISMATCH: "No enum match for: {0}",
|
|
13778
|
+
ENUM_CASE_MISMATCH: "Enum does not match case for: {0}",
|
|
13064
13779
|
ANY_OF_MISSING: "Data does not match any schemas from 'anyOf'",
|
|
13065
13780
|
ONE_OF_MISSING: "Data does not match any schemas from 'oneOf'",
|
|
13066
13781
|
ONE_OF_MULTIPLE: "Data is valid against more than one schema from 'oneOf'",
|
|
@@ -13114,7 +13829,7 @@ module.exports = {
|
|
|
13114
13829
|
|
|
13115
13830
|
};
|
|
13116
13831
|
|
|
13117
|
-
},{}],
|
|
13832
|
+
},{}],115:[function(require,module,exports){
|
|
13118
13833
|
/*jshint maxlen: false*/
|
|
13119
13834
|
|
|
13120
13835
|
var validator = require("validator");
|
|
@@ -13245,7 +13960,7 @@ var FormatValidators = {
|
|
|
13245
13960
|
|
|
13246
13961
|
module.exports = FormatValidators;
|
|
13247
13962
|
|
|
13248
|
-
},{"validator":
|
|
13963
|
+
},{"validator":40}],116:[function(require,module,exports){
|
|
13249
13964
|
"use strict";
|
|
13250
13965
|
|
|
13251
13966
|
var FormatValidators = require("./FormatValidators"),
|
|
@@ -13494,23 +14209,35 @@ var JsonValidators = {
|
|
|
13494
14209
|
enum: function (report, schema, json) {
|
|
13495
14210
|
// http://json-schema.org/latest/json-schema-validation.html#rfc.section.5.5.1.2
|
|
13496
14211
|
var match = false,
|
|
14212
|
+
caseInsensitiveMatch = false,
|
|
13497
14213
|
idx = schema.enum.length;
|
|
13498
14214
|
while (idx--) {
|
|
13499
14215
|
if (Utils.areEqual(json, schema.enum[idx])) {
|
|
13500
14216
|
match = true;
|
|
13501
14217
|
break;
|
|
14218
|
+
} else if (Utils.areEqual(json, schema.enum[idx]), { caseInsensitiveComparison: true }) {
|
|
14219
|
+
caseInsensitiveMatch = true;
|
|
13502
14220
|
}
|
|
13503
14221
|
}
|
|
14222
|
+
|
|
13504
14223
|
if (match === false) {
|
|
13505
|
-
|
|
14224
|
+
var error = caseInsensitiveMatch && this.options.enumCaseInsensitiveComparison ? "ENUM_CASE_MISMATCH" : "ENUM_MISMATCH";
|
|
14225
|
+
report.addError(error, [json], null, schema.description);
|
|
13506
14226
|
}
|
|
13507
14227
|
},
|
|
13508
|
-
/*
|
|
13509
14228
|
type: function (report, schema, json) {
|
|
13510
14229
|
// http://json-schema.org/latest/json-schema-validation.html#rfc.section.5.5.2.2
|
|
13511
|
-
|
|
14230
|
+
var jsonType = Utils.whatIs(json);
|
|
14231
|
+
if (typeof schema.type === "string") {
|
|
14232
|
+
if (jsonType !== schema.type && (jsonType !== "integer" || schema.type !== "number")) {
|
|
14233
|
+
report.addError("INVALID_TYPE", [schema.type, jsonType], null, schema.description);
|
|
14234
|
+
}
|
|
14235
|
+
} else {
|
|
14236
|
+
if (schema.type.indexOf(jsonType) === -1 && (jsonType !== "integer" || schema.type.indexOf("number") === -1)) {
|
|
14237
|
+
report.addError("INVALID_TYPE", [schema.type, jsonType], null, schema.description);
|
|
14238
|
+
}
|
|
14239
|
+
}
|
|
13512
14240
|
},
|
|
13513
|
-
*/
|
|
13514
14241
|
allOf: function (report, schema, json) {
|
|
13515
14242
|
// http://json-schema.org/latest/json-schema-validation.html#rfc.section.5.5.3.2
|
|
13516
14243
|
var idx = schema.allOf.length;
|
|
@@ -13737,23 +14464,12 @@ exports.validate = function (report, schema, json) {
|
|
|
13737
14464
|
}
|
|
13738
14465
|
|
|
13739
14466
|
// type checking first
|
|
13740
|
-
// http://json-schema.org/latest/json-schema-validation.html#rfc.section.5.5.2.2
|
|
13741
14467
|
var jsonType = Utils.whatIs(json);
|
|
13742
14468
|
if (schema.type) {
|
|
13743
|
-
|
|
13744
|
-
|
|
13745
|
-
|
|
13746
|
-
|
|
13747
|
-
return false;
|
|
13748
|
-
}
|
|
13749
|
-
}
|
|
13750
|
-
} else {
|
|
13751
|
-
if (schema.type.indexOf(jsonType) === -1 && (jsonType !== "integer" || schema.type.indexOf("number") === -1)) {
|
|
13752
|
-
report.addError("INVALID_TYPE", [schema.type, jsonType], null, schema.description);
|
|
13753
|
-
if (this.options.breakOnFirstError) {
|
|
13754
|
-
return false;
|
|
13755
|
-
}
|
|
13756
|
-
}
|
|
14469
|
+
keys.splice(keys.indexOf("type"), 1);
|
|
14470
|
+
JsonValidators.type.call(this, report, schema, json);
|
|
14471
|
+
if (report.errors.length && this.options.breakOnFirstError) {
|
|
14472
|
+
return false;
|
|
13757
14473
|
}
|
|
13758
14474
|
}
|
|
13759
14475
|
|
|
@@ -13788,7 +14504,7 @@ exports.validate = function (report, schema, json) {
|
|
|
13788
14504
|
|
|
13789
14505
|
};
|
|
13790
14506
|
|
|
13791
|
-
},{"./FormatValidators":
|
|
14507
|
+
},{"./FormatValidators":115,"./Report":118,"./Utils":122}],117:[function(require,module,exports){
|
|
13792
14508
|
// Number.isFinite polyfill
|
|
13793
14509
|
// http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isfinite
|
|
13794
14510
|
if (typeof Number.isFinite !== "function") {
|
|
@@ -13806,7 +14522,7 @@ if (typeof Number.isFinite !== "function") {
|
|
|
13806
14522
|
};
|
|
13807
14523
|
}
|
|
13808
14524
|
|
|
13809
|
-
},{}],
|
|
14525
|
+
},{}],118:[function(require,module,exports){
|
|
13810
14526
|
(function (process){
|
|
13811
14527
|
"use strict";
|
|
13812
14528
|
|
|
@@ -13867,7 +14583,8 @@ Report.prototype.processAsyncTasks = function (timeout, callback) {
|
|
|
13867
14583
|
};
|
|
13868
14584
|
}
|
|
13869
14585
|
|
|
13870
|
-
if
|
|
14586
|
+
// finish if tasks are completed or there are any errors and breaking on first error was requested
|
|
14587
|
+
if (tasksCount === 0 || (this.errors.length > 0 && this.options.breakOnFirstError)) {
|
|
13871
14588
|
finish();
|
|
13872
14589
|
return;
|
|
13873
14590
|
}
|
|
@@ -14012,7 +14729,7 @@ Report.prototype.addCustomError = function (errorCode, errorMessage, params, sub
|
|
|
14012
14729
|
module.exports = Report;
|
|
14013
14730
|
|
|
14014
14731
|
}).call(this,require('_process'))
|
|
14015
|
-
},{"./Errors":
|
|
14732
|
+
},{"./Errors":114,"./Utils":122,"_process":15,"lodash.get":12}],119:[function(require,module,exports){
|
|
14016
14733
|
"use strict";
|
|
14017
14734
|
|
|
14018
14735
|
var isequal = require("lodash.isequal");
|
|
@@ -14176,7 +14893,7 @@ exports.getSchemaByUri = function (report, uri, root) {
|
|
|
14176
14893
|
|
|
14177
14894
|
exports.getRemotePath = getRemotePath;
|
|
14178
14895
|
|
|
14179
|
-
},{"./Report":
|
|
14896
|
+
},{"./Report":118,"./SchemaCompilation":120,"./SchemaValidation":121,"./Utils":122,"lodash.isequal":13}],120:[function(require,module,exports){
|
|
14180
14897
|
"use strict";
|
|
14181
14898
|
|
|
14182
14899
|
var Report = require("./Report");
|
|
@@ -14477,7 +15194,7 @@ exports.compileSchema = function (report, schema) {
|
|
|
14477
15194
|
|
|
14478
15195
|
};
|
|
14479
15196
|
|
|
14480
|
-
},{"./Report":
|
|
15197
|
+
},{"./Report":118,"./SchemaCache":119,"./Utils":122}],121:[function(require,module,exports){
|
|
14481
15198
|
"use strict";
|
|
14482
15199
|
|
|
14483
15200
|
var FormatValidators = require("./FormatValidators"),
|
|
@@ -15086,7 +15803,7 @@ exports.validateSchema = function (report, schema) {
|
|
|
15086
15803
|
return isValid;
|
|
15087
15804
|
};
|
|
15088
15805
|
|
|
15089
|
-
},{"./FormatValidators":
|
|
15806
|
+
},{"./FormatValidators":115,"./JsonValidation":116,"./Report":118,"./Utils":122}],122:[function(require,module,exports){
|
|
15090
15807
|
"use strict";
|
|
15091
15808
|
|
|
15092
15809
|
exports.isAbsoluteUri = function (uri) {
|
|
@@ -15130,7 +15847,11 @@ exports.whatIs = function (what) {
|
|
|
15130
15847
|
|
|
15131
15848
|
};
|
|
15132
15849
|
|
|
15133
|
-
exports.areEqual = function areEqual(json1, json2) {
|
|
15850
|
+
exports.areEqual = function areEqual(json1, json2, options) {
|
|
15851
|
+
|
|
15852
|
+
options = options || {};
|
|
15853
|
+
var caseInsensitiveComparison = options.caseInsensitiveComparison || false;
|
|
15854
|
+
|
|
15134
15855
|
// http://json-schema.org/latest/json-schema-core.html#rfc.section.3.6
|
|
15135
15856
|
|
|
15136
15857
|
// Two JSON values are said to be equal if and only if:
|
|
@@ -15141,6 +15862,12 @@ exports.areEqual = function areEqual(json1, json2) {
|
|
|
15141
15862
|
if (json1 === json2) {
|
|
15142
15863
|
return true;
|
|
15143
15864
|
}
|
|
15865
|
+
if (
|
|
15866
|
+
caseInsensitiveComparison === true &&
|
|
15867
|
+
typeof json1 === "string" && typeof json2 === "string" &&
|
|
15868
|
+
json1.toUpperCase() === json2.toUpperCase()) {
|
|
15869
|
+
return true;
|
|
15870
|
+
}
|
|
15144
15871
|
|
|
15145
15872
|
var i, len;
|
|
15146
15873
|
|
|
@@ -15153,7 +15880,7 @@ exports.areEqual = function areEqual(json1, json2) {
|
|
|
15153
15880
|
// items at the same index are equal according to this definition; or
|
|
15154
15881
|
len = json1.length;
|
|
15155
15882
|
for (i = 0; i < len; i++) {
|
|
15156
|
-
if (!areEqual(json1[i], json2[i])) {
|
|
15883
|
+
if (!areEqual(json1[i], json2[i], { caseInsensitiveComparison: caseInsensitiveComparison })) {
|
|
15157
15884
|
return false;
|
|
15158
15885
|
}
|
|
15159
15886
|
}
|
|
@@ -15165,13 +15892,13 @@ exports.areEqual = function areEqual(json1, json2) {
|
|
|
15165
15892
|
// have the same set of property names; and
|
|
15166
15893
|
var keys1 = Object.keys(json1);
|
|
15167
15894
|
var keys2 = Object.keys(json2);
|
|
15168
|
-
if (!areEqual(keys1, keys2)) {
|
|
15895
|
+
if (!areEqual(keys1, keys2, { caseInsensitiveComparison: caseInsensitiveComparison })) {
|
|
15169
15896
|
return false;
|
|
15170
15897
|
}
|
|
15171
15898
|
// values for a same property name are equal according to this definition.
|
|
15172
15899
|
len = keys1.length;
|
|
15173
15900
|
for (i = 0; i < len; i++) {
|
|
15174
|
-
if (!areEqual(json1[keys1[i]], json2[keys1[i]])) {
|
|
15901
|
+
if (!areEqual(json1[keys1[i]], json2[keys1[i]], { caseInsensitiveComparison: caseInsensitiveComparison })) {
|
|
15175
15902
|
return false;
|
|
15176
15903
|
}
|
|
15177
15904
|
}
|
|
@@ -15305,7 +16032,7 @@ exports.ucs2decode = function (string) {
|
|
|
15305
16032
|
};
|
|
15306
16033
|
/*jshint +W016*/
|
|
15307
16034
|
|
|
15308
|
-
},{}],
|
|
16035
|
+
},{}],123:[function(require,module,exports){
|
|
15309
16036
|
(function (process){
|
|
15310
16037
|
"use strict";
|
|
15311
16038
|
|
|
@@ -15331,6 +16058,8 @@ var defaultOptions = {
|
|
|
15331
16058
|
forceAdditional: false,
|
|
15332
16059
|
// assume additionalProperties and additionalItems are defined as "false" where appropriate
|
|
15333
16060
|
assumeAdditional: false,
|
|
16061
|
+
// do case insensitive comparison for enums
|
|
16062
|
+
enumCaseInsensitiveComparison: false,
|
|
15334
16063
|
// force items to be defined on "array" types
|
|
15335
16064
|
forceItems: false,
|
|
15336
16065
|
// force minItems to be defined on "array" types
|
|
@@ -15421,6 +16150,7 @@ function normalizeOptions(options) {
|
|
|
15421
16150
|
function ZSchema(options) {
|
|
15422
16151
|
this.cache = {};
|
|
15423
16152
|
this.referenceCache = [];
|
|
16153
|
+
this.validateOptions = {};
|
|
15424
16154
|
|
|
15425
16155
|
this.options = normalizeOptions(options);
|
|
15426
16156
|
|
|
@@ -15467,6 +16197,8 @@ ZSchema.prototype.validate = function (json, schema, options, callback) {
|
|
|
15467
16197
|
}
|
|
15468
16198
|
if (!options) { options = {}; }
|
|
15469
16199
|
|
|
16200
|
+
this.validateOptions = options;
|
|
16201
|
+
|
|
15470
16202
|
var whatIs = Utils.whatIs(schema);
|
|
15471
16203
|
if (whatIs !== "string" && whatIs !== "object") {
|
|
15472
16204
|
var e = new Error("Invalid .validate call - schema must be an string or object but " + whatIs + " was passed!");
|
|
@@ -15676,7 +16408,7 @@ ZSchema.getDefaultOptions = function () {
|
|
|
15676
16408
|
module.exports = ZSchema;
|
|
15677
16409
|
|
|
15678
16410
|
}).call(this,require('_process'))
|
|
15679
|
-
},{"./FormatValidators":
|
|
16411
|
+
},{"./FormatValidators":115,"./JsonValidation":116,"./Polyfills":117,"./Report":118,"./SchemaCache":119,"./SchemaCompilation":120,"./SchemaValidation":121,"./Utils":122,"./schemas/hyper-schema.json":124,"./schemas/schema.json":125,"_process":15,"lodash.get":12}],124:[function(require,module,exports){
|
|
15680
16412
|
module.exports={
|
|
15681
16413
|
"$schema": "http://json-schema.org/draft-04/hyper-schema#",
|
|
15682
16414
|
"id": "http://json-schema.org/draft-04/hyper-schema#",
|
|
@@ -15836,7 +16568,7 @@ module.exports={
|
|
|
15836
16568
|
}
|
|
15837
16569
|
|
|
15838
16570
|
|
|
15839
|
-
},{}],
|
|
16571
|
+
},{}],125:[function(require,module,exports){
|
|
15840
16572
|
module.exports={
|
|
15841
16573
|
"id": "http://json-schema.org/draft-04/schema#",
|
|
15842
16574
|
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
@@ -15989,7 +16721,7 @@ module.exports={
|
|
|
15989
16721
|
"default": {}
|
|
15990
16722
|
}
|
|
15991
16723
|
|
|
15992
|
-
},{}],
|
|
16724
|
+
},{}],126:[function(require,module,exports){
|
|
15993
16725
|
"use strict";
|
|
15994
16726
|
|
|
15995
16727
|
module.exports = {
|
|
@@ -16067,7 +16799,7 @@ module.exports = {
|
|
|
16067
16799
|
]
|
|
16068
16800
|
};
|
|
16069
16801
|
|
|
16070
|
-
},{}],
|
|
16802
|
+
},{}],127:[function(require,module,exports){
|
|
16071
16803
|
"use strict";
|
|
16072
16804
|
|
|
16073
16805
|
module.exports = {
|
|
@@ -16132,7 +16864,7 @@ module.exports = {
|
|
|
16132
16864
|
]
|
|
16133
16865
|
};
|
|
16134
16866
|
|
|
16135
|
-
},{}],
|
|
16867
|
+
},{}],128:[function(require,module,exports){
|
|
16136
16868
|
"use strict";
|
|
16137
16869
|
|
|
16138
16870
|
module.exports = {
|
|
@@ -16205,7 +16937,7 @@ module.exports = {
|
|
|
16205
16937
|
]
|
|
16206
16938
|
};
|
|
16207
16939
|
|
|
16208
|
-
},{}],
|
|
16940
|
+
},{}],129:[function(require,module,exports){
|
|
16209
16941
|
"use strict";
|
|
16210
16942
|
|
|
16211
16943
|
//Implement new 'shouldFail' keyword
|
|
@@ -16268,7 +17000,7 @@ module.exports = {
|
|
|
16268
17000
|
]
|
|
16269
17001
|
};
|
|
16270
17002
|
|
|
16271
|
-
},{}],
|
|
17003
|
+
},{}],130:[function(require,module,exports){
|
|
16272
17004
|
"use strict";
|
|
16273
17005
|
|
|
16274
17006
|
module.exports = {
|
|
@@ -16296,7 +17028,7 @@ module.exports = {
|
|
|
16296
17028
|
]
|
|
16297
17029
|
};
|
|
16298
17030
|
|
|
16299
|
-
},{}],
|
|
17031
|
+
},{}],131:[function(require,module,exports){
|
|
16300
17032
|
"use strict";
|
|
16301
17033
|
|
|
16302
17034
|
module.exports = {
|
|
@@ -16321,7 +17053,7 @@ module.exports = {
|
|
|
16321
17053
|
]
|
|
16322
17054
|
};
|
|
16323
17055
|
|
|
16324
|
-
},{}],
|
|
17056
|
+
},{}],132:[function(require,module,exports){
|
|
16325
17057
|
"use strict";
|
|
16326
17058
|
|
|
16327
17059
|
module.exports = {
|
|
@@ -16394,7 +17126,7 @@ module.exports = {
|
|
|
16394
17126
|
]
|
|
16395
17127
|
};
|
|
16396
17128
|
|
|
16397
|
-
},{}],
|
|
17129
|
+
},{}],133:[function(require,module,exports){
|
|
16398
17130
|
"use strict";
|
|
16399
17131
|
|
|
16400
17132
|
module.exports = {
|
|
@@ -16422,7 +17154,7 @@ module.exports = {
|
|
|
16422
17154
|
]
|
|
16423
17155
|
};
|
|
16424
17156
|
|
|
16425
|
-
},{}],
|
|
17157
|
+
},{}],134:[function(require,module,exports){
|
|
16426
17158
|
"use strict";
|
|
16427
17159
|
|
|
16428
17160
|
module.exports = {
|
|
@@ -16450,7 +17182,7 @@ module.exports = {
|
|
|
16450
17182
|
]
|
|
16451
17183
|
};
|
|
16452
17184
|
|
|
16453
|
-
},{}],
|
|
17185
|
+
},{}],135:[function(require,module,exports){
|
|
16454
17186
|
"use strict";
|
|
16455
17187
|
|
|
16456
17188
|
module.exports = {
|
|
@@ -16478,7 +17210,7 @@ module.exports = {
|
|
|
16478
17210
|
]
|
|
16479
17211
|
};
|
|
16480
17212
|
|
|
16481
|
-
},{}],
|
|
17213
|
+
},{}],136:[function(require,module,exports){
|
|
16482
17214
|
"use strict";
|
|
16483
17215
|
|
|
16484
17216
|
module.exports = {
|
|
@@ -16506,7 +17238,7 @@ module.exports = {
|
|
|
16506
17238
|
]
|
|
16507
17239
|
};
|
|
16508
17240
|
|
|
16509
|
-
},{}],
|
|
17241
|
+
},{}],137:[function(require,module,exports){
|
|
16510
17242
|
"use strict";
|
|
16511
17243
|
|
|
16512
17244
|
module.exports = {
|
|
@@ -16534,7 +17266,7 @@ module.exports = {
|
|
|
16534
17266
|
]
|
|
16535
17267
|
};
|
|
16536
17268
|
|
|
16537
|
-
},{}],
|
|
17269
|
+
},{}],138:[function(require,module,exports){
|
|
16538
17270
|
"use strict";
|
|
16539
17271
|
|
|
16540
17272
|
module.exports = {
|
|
@@ -16590,7 +17322,7 @@ module.exports = {
|
|
|
16590
17322
|
]
|
|
16591
17323
|
};
|
|
16592
17324
|
|
|
16593
|
-
},{}],
|
|
17325
|
+
},{}],139:[function(require,module,exports){
|
|
16594
17326
|
"use strict";
|
|
16595
17327
|
|
|
16596
17328
|
module.exports = {
|
|
@@ -16634,7 +17366,7 @@ module.exports = {
|
|
|
16634
17366
|
]
|
|
16635
17367
|
};
|
|
16636
17368
|
|
|
16637
|
-
},{}],
|
|
17369
|
+
},{}],140:[function(require,module,exports){
|
|
16638
17370
|
"use strict";
|
|
16639
17371
|
|
|
16640
17372
|
module.exports = {
|
|
@@ -16651,7 +17383,7 @@ module.exports = {
|
|
|
16651
17383
|
]
|
|
16652
17384
|
};
|
|
16653
17385
|
|
|
16654
|
-
},{}],
|
|
17386
|
+
},{}],141:[function(require,module,exports){
|
|
16655
17387
|
"use strict";
|
|
16656
17388
|
|
|
16657
17389
|
module.exports = {
|
|
@@ -16673,7 +17405,7 @@ module.exports = {
|
|
|
16673
17405
|
]
|
|
16674
17406
|
};
|
|
16675
17407
|
|
|
16676
|
-
},{}],
|
|
17408
|
+
},{}],142:[function(require,module,exports){
|
|
16677
17409
|
"use strict";
|
|
16678
17410
|
|
|
16679
17411
|
module.exports = {
|
|
@@ -16691,7 +17423,7 @@ module.exports = {
|
|
|
16691
17423
|
]
|
|
16692
17424
|
};
|
|
16693
17425
|
|
|
16694
|
-
},{}],
|
|
17426
|
+
},{}],143:[function(require,module,exports){
|
|
16695
17427
|
"use strict";
|
|
16696
17428
|
|
|
16697
17429
|
module.exports = {
|
|
@@ -16760,7 +17492,7 @@ module.exports = {
|
|
|
16760
17492
|
]
|
|
16761
17493
|
};
|
|
16762
17494
|
|
|
16763
|
-
},{}],
|
|
17495
|
+
},{}],144:[function(require,module,exports){
|
|
16764
17496
|
"use strict";
|
|
16765
17497
|
|
|
16766
17498
|
module.exports = {
|
|
@@ -16775,7 +17507,7 @@ module.exports = {
|
|
|
16775
17507
|
]
|
|
16776
17508
|
};
|
|
16777
17509
|
|
|
16778
|
-
},{}],
|
|
17510
|
+
},{}],145:[function(require,module,exports){
|
|
16779
17511
|
"use strict";
|
|
16780
17512
|
|
|
16781
17513
|
module.exports = {
|
|
@@ -16799,7 +17531,7 @@ module.exports = {
|
|
|
16799
17531
|
]
|
|
16800
17532
|
};
|
|
16801
17533
|
|
|
16802
|
-
},{}],
|
|
17534
|
+
},{}],146:[function(require,module,exports){
|
|
16803
17535
|
"use strict";
|
|
16804
17536
|
|
|
16805
17537
|
module.exports = {
|
|
@@ -16874,7 +17606,7 @@ module.exports = {
|
|
|
16874
17606
|
]
|
|
16875
17607
|
};
|
|
16876
17608
|
|
|
16877
|
-
},{}],
|
|
17609
|
+
},{}],147:[function(require,module,exports){
|
|
16878
17610
|
"use strict";
|
|
16879
17611
|
|
|
16880
17612
|
module.exports = {
|
|
@@ -16895,7 +17627,7 @@ module.exports = {
|
|
|
16895
17627
|
]
|
|
16896
17628
|
};
|
|
16897
17629
|
|
|
16898
|
-
},{}],
|
|
17630
|
+
},{}],148:[function(require,module,exports){
|
|
16899
17631
|
"use strict";
|
|
16900
17632
|
|
|
16901
17633
|
module.exports = {
|
|
@@ -16922,7 +17654,7 @@ module.exports = {
|
|
|
16922
17654
|
]
|
|
16923
17655
|
};
|
|
16924
17656
|
|
|
16925
|
-
},{}],
|
|
17657
|
+
},{}],149:[function(require,module,exports){
|
|
16926
17658
|
"use strict";
|
|
16927
17659
|
|
|
16928
17660
|
var REF_NAME = "int.json";
|
|
@@ -16969,7 +17701,7 @@ module.exports = {
|
|
|
16969
17701
|
]
|
|
16970
17702
|
};
|
|
16971
17703
|
|
|
16972
|
-
},{}],
|
|
17704
|
+
},{}],150:[function(require,module,exports){
|
|
16973
17705
|
"use strict";
|
|
16974
17706
|
|
|
16975
17707
|
module.exports = {
|
|
@@ -17142,7 +17874,7 @@ module.exports = {
|
|
|
17142
17874
|
]
|
|
17143
17875
|
};
|
|
17144
17876
|
|
|
17145
|
-
},{}],
|
|
17877
|
+
},{}],151:[function(require,module,exports){
|
|
17146
17878
|
"use strict";
|
|
17147
17879
|
|
|
17148
17880
|
module.exports = {
|
|
@@ -17187,7 +17919,7 @@ module.exports = {
|
|
|
17187
17919
|
]
|
|
17188
17920
|
};
|
|
17189
17921
|
|
|
17190
|
-
},{}],
|
|
17922
|
+
},{}],152:[function(require,module,exports){
|
|
17191
17923
|
"use strict";
|
|
17192
17924
|
|
|
17193
17925
|
module.exports = {
|
|
@@ -17230,7 +17962,7 @@ module.exports = {
|
|
|
17230
17962
|
]
|
|
17231
17963
|
};
|
|
17232
17964
|
|
|
17233
|
-
},{}],
|
|
17965
|
+
},{}],153:[function(require,module,exports){
|
|
17234
17966
|
"use strict";
|
|
17235
17967
|
|
|
17236
17968
|
var schema1 = {
|
|
@@ -17314,7 +18046,7 @@ module.exports = {
|
|
|
17314
18046
|
]
|
|
17315
18047
|
};
|
|
17316
18048
|
|
|
17317
|
-
},{}],
|
|
18049
|
+
},{}],154:[function(require,module,exports){
|
|
17318
18050
|
module.exports = {
|
|
17319
18051
|
description: "Issue #139 - add schema id if present to erro message via addError method",
|
|
17320
18052
|
tests: [
|
|
@@ -17373,7 +18105,7 @@ module.exports = {
|
|
|
17373
18105
|
]
|
|
17374
18106
|
};
|
|
17375
18107
|
|
|
17376
|
-
},{}],
|
|
18108
|
+
},{}],155:[function(require,module,exports){
|
|
17377
18109
|
"use strict";
|
|
17378
18110
|
|
|
17379
18111
|
module.exports = {
|
|
@@ -17391,7 +18123,7 @@ module.exports = {
|
|
|
17391
18123
|
]
|
|
17392
18124
|
};
|
|
17393
18125
|
|
|
17394
|
-
},{}],
|
|
18126
|
+
},{}],156:[function(require,module,exports){
|
|
17395
18127
|
"use strict";
|
|
17396
18128
|
|
|
17397
18129
|
module.exports = {
|
|
@@ -17421,7 +18153,7 @@ module.exports = {
|
|
|
17421
18153
|
]
|
|
17422
18154
|
};
|
|
17423
18155
|
|
|
17424
|
-
},{}],
|
|
18156
|
+
},{}],157:[function(require,module,exports){
|
|
17425
18157
|
"use strict";
|
|
17426
18158
|
|
|
17427
18159
|
module.exports = {
|
|
@@ -17449,7 +18181,7 @@ module.exports = {
|
|
|
17449
18181
|
]
|
|
17450
18182
|
};
|
|
17451
18183
|
|
|
17452
|
-
},{}],
|
|
18184
|
+
},{}],158:[function(require,module,exports){
|
|
17453
18185
|
"use strict";
|
|
17454
18186
|
|
|
17455
18187
|
module.exports = {
|
|
@@ -17476,7 +18208,7 @@ module.exports = {
|
|
|
17476
18208
|
]
|
|
17477
18209
|
};
|
|
17478
18210
|
|
|
17479
|
-
},{}],
|
|
18211
|
+
},{}],159:[function(require,module,exports){
|
|
17480
18212
|
"use strict";
|
|
17481
18213
|
|
|
17482
18214
|
module.exports = {
|
|
@@ -17552,7 +18284,7 @@ module.exports = {
|
|
|
17552
18284
|
]
|
|
17553
18285
|
};
|
|
17554
18286
|
|
|
17555
|
-
},{}],
|
|
18287
|
+
},{}],160:[function(require,module,exports){
|
|
17556
18288
|
"use strict";
|
|
17557
18289
|
|
|
17558
18290
|
module.exports = {
|
|
@@ -17588,7 +18320,7 @@ module.exports = {
|
|
|
17588
18320
|
]
|
|
17589
18321
|
};
|
|
17590
18322
|
|
|
17591
|
-
},{}],
|
|
18323
|
+
},{}],161:[function(require,module,exports){
|
|
17592
18324
|
"use strict";
|
|
17593
18325
|
|
|
17594
18326
|
module.exports = {
|
|
@@ -17678,7 +18410,7 @@ module.exports = {
|
|
|
17678
18410
|
]
|
|
17679
18411
|
};
|
|
17680
18412
|
|
|
17681
|
-
},{}],
|
|
18413
|
+
},{}],162:[function(require,module,exports){
|
|
17682
18414
|
"use strict";
|
|
17683
18415
|
|
|
17684
18416
|
module.exports = {
|
|
@@ -17703,7 +18435,7 @@ module.exports = {
|
|
|
17703
18435
|
]
|
|
17704
18436
|
};
|
|
17705
18437
|
|
|
17706
|
-
},{}],
|
|
18438
|
+
},{}],163:[function(require,module,exports){
|
|
17707
18439
|
"use strict";
|
|
17708
18440
|
|
|
17709
18441
|
module.exports = {
|
|
@@ -17779,7 +18511,7 @@ module.exports = {
|
|
|
17779
18511
|
]
|
|
17780
18512
|
};
|
|
17781
18513
|
|
|
17782
|
-
},{}],
|
|
18514
|
+
},{}],164:[function(require,module,exports){
|
|
17783
18515
|
"use strict";
|
|
17784
18516
|
|
|
17785
18517
|
module.exports = {
|
|
@@ -17892,7 +18624,7 @@ module.exports = {
|
|
|
17892
18624
|
]
|
|
17893
18625
|
};
|
|
17894
18626
|
|
|
17895
|
-
},{}],
|
|
18627
|
+
},{}],165:[function(require,module,exports){
|
|
17896
18628
|
"use strict";
|
|
17897
18629
|
|
|
17898
18630
|
module.exports = {
|
|
@@ -18072,7 +18804,7 @@ module.exports = {
|
|
|
18072
18804
|
]
|
|
18073
18805
|
};
|
|
18074
18806
|
|
|
18075
|
-
},{}],
|
|
18807
|
+
},{}],166:[function(require,module,exports){
|
|
18076
18808
|
"use strict";
|
|
18077
18809
|
|
|
18078
18810
|
module.exports = {
|
|
@@ -18119,7 +18851,7 @@ module.exports = {
|
|
|
18119
18851
|
]
|
|
18120
18852
|
};
|
|
18121
18853
|
|
|
18122
|
-
},{}],
|
|
18854
|
+
},{}],167:[function(require,module,exports){
|
|
18123
18855
|
"use strict";
|
|
18124
18856
|
|
|
18125
18857
|
var resourceObject = {
|
|
@@ -18415,7 +19147,7 @@ module.exports = {
|
|
|
18415
19147
|
]
|
|
18416
19148
|
};
|
|
18417
19149
|
|
|
18418
|
-
},{}],
|
|
19150
|
+
},{}],168:[function(require,module,exports){
|
|
18419
19151
|
"use strict";
|
|
18420
19152
|
|
|
18421
19153
|
var draft4 = require("./files/Issue47/draft4.json");
|
|
@@ -18444,7 +19176,7 @@ module.exports = {
|
|
|
18444
19176
|
]
|
|
18445
19177
|
};
|
|
18446
19178
|
|
|
18447
|
-
},{"./files/Issue47/draft4.json":
|
|
19179
|
+
},{"./files/Issue47/draft4.json":192,"./files/Issue47/sample.json":193,"./files/Issue47/swagger_draft.json":194,"./files/Issue47/swagger_draft_modified.json":195}],169:[function(require,module,exports){
|
|
18448
19180
|
"use strict";
|
|
18449
19181
|
|
|
18450
19182
|
module.exports = {
|
|
@@ -18477,7 +19209,7 @@ module.exports = {
|
|
|
18477
19209
|
]
|
|
18478
19210
|
};
|
|
18479
19211
|
|
|
18480
|
-
},{}],
|
|
19212
|
+
},{}],170:[function(require,module,exports){
|
|
18481
19213
|
"use strict";
|
|
18482
19214
|
|
|
18483
19215
|
module.exports = {
|
|
@@ -18495,7 +19227,7 @@ module.exports = {
|
|
|
18495
19227
|
]
|
|
18496
19228
|
};
|
|
18497
19229
|
|
|
18498
|
-
},{}],
|
|
19230
|
+
},{}],171:[function(require,module,exports){
|
|
18499
19231
|
"use strict";
|
|
18500
19232
|
|
|
18501
19233
|
module.exports = {
|
|
@@ -18517,7 +19249,7 @@ module.exports = {
|
|
|
18517
19249
|
]
|
|
18518
19250
|
};
|
|
18519
19251
|
|
|
18520
|
-
},{}],
|
|
19252
|
+
},{}],172:[function(require,module,exports){
|
|
18521
19253
|
"use strict";
|
|
18522
19254
|
|
|
18523
19255
|
module.exports = {
|
|
@@ -18588,7 +19320,7 @@ module.exports = {
|
|
|
18588
19320
|
]
|
|
18589
19321
|
};
|
|
18590
19322
|
|
|
18591
|
-
},{}],
|
|
19323
|
+
},{}],173:[function(require,module,exports){
|
|
18592
19324
|
"use strict";
|
|
18593
19325
|
|
|
18594
19326
|
var dataTypeBaseJson = {
|
|
@@ -19273,7 +20005,7 @@ module.exports = {
|
|
|
19273
20005
|
]
|
|
19274
20006
|
};
|
|
19275
20007
|
|
|
19276
|
-
},{}],
|
|
20008
|
+
},{}],174:[function(require,module,exports){
|
|
19277
20009
|
"use strict";
|
|
19278
20010
|
|
|
19279
20011
|
module.exports = {
|
|
@@ -19336,7 +20068,7 @@ module.exports = {
|
|
|
19336
20068
|
]
|
|
19337
20069
|
};
|
|
19338
20070
|
|
|
19339
|
-
},{}],
|
|
20071
|
+
},{}],175:[function(require,module,exports){
|
|
19340
20072
|
/*jshint -W101*/
|
|
19341
20073
|
|
|
19342
20074
|
"use strict";
|
|
@@ -19913,7 +20645,7 @@ module.exports = {
|
|
|
19913
20645
|
]
|
|
19914
20646
|
};
|
|
19915
20647
|
|
|
19916
|
-
},{}],
|
|
20648
|
+
},{}],176:[function(require,module,exports){
|
|
19917
20649
|
"use strict";
|
|
19918
20650
|
|
|
19919
20651
|
module.exports = {
|
|
@@ -19944,7 +20676,7 @@ module.exports = {
|
|
|
19944
20676
|
]
|
|
19945
20677
|
};
|
|
19946
20678
|
|
|
19947
|
-
},{}],
|
|
20679
|
+
},{}],177:[function(require,module,exports){
|
|
19948
20680
|
"use strict";
|
|
19949
20681
|
|
|
19950
20682
|
module.exports = {
|
|
@@ -19995,7 +20727,7 @@ module.exports = {
|
|
|
19995
20727
|
]
|
|
19996
20728
|
};
|
|
19997
20729
|
|
|
19998
|
-
},{}],
|
|
20730
|
+
},{}],178:[function(require,module,exports){
|
|
19999
20731
|
"use strict";
|
|
20000
20732
|
|
|
20001
20733
|
module.exports = {
|
|
@@ -20115,7 +20847,7 @@ module.exports = {
|
|
|
20115
20847
|
]
|
|
20116
20848
|
};
|
|
20117
20849
|
|
|
20118
|
-
},{}],
|
|
20850
|
+
},{}],179:[function(require,module,exports){
|
|
20119
20851
|
"use strict";
|
|
20120
20852
|
|
|
20121
20853
|
module.exports = {
|
|
@@ -20173,7 +20905,7 @@ module.exports = {
|
|
|
20173
20905
|
]
|
|
20174
20906
|
};
|
|
20175
20907
|
|
|
20176
|
-
},{}],
|
|
20908
|
+
},{}],180:[function(require,module,exports){
|
|
20177
20909
|
"use strict";
|
|
20178
20910
|
|
|
20179
20911
|
module.exports = {
|
|
@@ -20246,7 +20978,7 @@ module.exports = {
|
|
|
20246
20978
|
]
|
|
20247
20979
|
};
|
|
20248
20980
|
|
|
20249
|
-
},{}],
|
|
20981
|
+
},{}],181:[function(require,module,exports){
|
|
20250
20982
|
"use strict";
|
|
20251
20983
|
|
|
20252
20984
|
var innerSchema = {
|
|
@@ -20291,7 +21023,7 @@ module.exports = {
|
|
|
20291
21023
|
]
|
|
20292
21024
|
};
|
|
20293
21025
|
|
|
20294
|
-
},{}],
|
|
21026
|
+
},{}],182:[function(require,module,exports){
|
|
20295
21027
|
"use strict";
|
|
20296
21028
|
|
|
20297
21029
|
var schema1 = {
|
|
@@ -20335,7 +21067,7 @@ module.exports = {
|
|
|
20335
21067
|
]
|
|
20336
21068
|
};
|
|
20337
21069
|
|
|
20338
|
-
},{}],
|
|
21070
|
+
},{}],183:[function(require,module,exports){
|
|
20339
21071
|
"use strict";
|
|
20340
21072
|
|
|
20341
21073
|
module.exports = {
|
|
@@ -20353,7 +21085,7 @@ module.exports = {
|
|
|
20353
21085
|
]
|
|
20354
21086
|
};
|
|
20355
21087
|
|
|
20356
|
-
},{}],
|
|
21088
|
+
},{}],184:[function(require,module,exports){
|
|
20357
21089
|
"use strict";
|
|
20358
21090
|
|
|
20359
21091
|
module.exports = {
|
|
@@ -20385,7 +21117,7 @@ module.exports = {
|
|
|
20385
21117
|
]
|
|
20386
21118
|
};
|
|
20387
21119
|
|
|
20388
|
-
},{}],
|
|
21120
|
+
},{}],185:[function(require,module,exports){
|
|
20389
21121
|
"use strict";
|
|
20390
21122
|
|
|
20391
21123
|
module.exports = {
|
|
@@ -20444,7 +21176,7 @@ module.exports = {
|
|
|
20444
21176
|
]
|
|
20445
21177
|
};
|
|
20446
21178
|
|
|
20447
|
-
},{}],
|
|
21179
|
+
},{}],186:[function(require,module,exports){
|
|
20448
21180
|
"use strict";
|
|
20449
21181
|
|
|
20450
21182
|
module.exports = {
|
|
@@ -20469,7 +21201,7 @@ module.exports = {
|
|
|
20469
21201
|
]
|
|
20470
21202
|
};
|
|
20471
21203
|
|
|
20472
|
-
},{}],
|
|
21204
|
+
},{}],187:[function(require,module,exports){
|
|
20473
21205
|
"use strict";
|
|
20474
21206
|
|
|
20475
21207
|
module.exports = {
|
|
@@ -20494,7 +21226,7 @@ module.exports = {
|
|
|
20494
21226
|
]
|
|
20495
21227
|
};
|
|
20496
21228
|
|
|
20497
|
-
},{}],
|
|
21229
|
+
},{}],188:[function(require,module,exports){
|
|
20498
21230
|
"use strict";
|
|
20499
21231
|
|
|
20500
21232
|
module.exports = {
|
|
@@ -20539,7 +21271,7 @@ module.exports = {
|
|
|
20539
21271
|
]
|
|
20540
21272
|
};
|
|
20541
21273
|
|
|
20542
|
-
},{}],
|
|
21274
|
+
},{}],189:[function(require,module,exports){
|
|
20543
21275
|
"use strict";
|
|
20544
21276
|
|
|
20545
21277
|
module.exports = {
|
|
@@ -20564,7 +21296,7 @@ module.exports = {
|
|
|
20564
21296
|
]
|
|
20565
21297
|
};
|
|
20566
21298
|
|
|
20567
|
-
},{}],
|
|
21299
|
+
},{}],190:[function(require,module,exports){
|
|
20568
21300
|
"use strict";
|
|
20569
21301
|
|
|
20570
21302
|
module.exports = {
|
|
@@ -20603,7 +21335,7 @@ module.exports = {
|
|
|
20603
21335
|
]
|
|
20604
21336
|
};
|
|
20605
21337
|
|
|
20606
|
-
},{}],
|
|
21338
|
+
},{}],191:[function(require,module,exports){
|
|
20607
21339
|
"use strict";
|
|
20608
21340
|
|
|
20609
21341
|
module.exports = {
|
|
@@ -20633,7 +21365,7 @@ module.exports = {
|
|
|
20633
21365
|
]
|
|
20634
21366
|
};
|
|
20635
21367
|
|
|
20636
|
-
},{}],
|
|
21368
|
+
},{}],192:[function(require,module,exports){
|
|
20637
21369
|
module.exports={
|
|
20638
21370
|
"id": "http://json-schema.org/draft-04/schema#",
|
|
20639
21371
|
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
@@ -20785,7 +21517,7 @@ module.exports={
|
|
|
20785
21517
|
"default": {}
|
|
20786
21518
|
}
|
|
20787
21519
|
|
|
20788
|
-
},{}],
|
|
21520
|
+
},{}],193:[function(require,module,exports){
|
|
20789
21521
|
module.exports={
|
|
20790
21522
|
"swagger": 2,
|
|
20791
21523
|
"info": {
|
|
@@ -20876,7 +21608,7 @@ module.exports={
|
|
|
20876
21608
|
}
|
|
20877
21609
|
}
|
|
20878
21610
|
|
|
20879
|
-
},{}],
|
|
21611
|
+
},{}],194:[function(require,module,exports){
|
|
20880
21612
|
module.exports={
|
|
20881
21613
|
"title": "A JSON Schema for Swagger 2.0 API.",
|
|
20882
21614
|
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
@@ -21274,7 +22006,7 @@ module.exports={
|
|
|
21274
22006
|
}
|
|
21275
22007
|
}
|
|
21276
22008
|
|
|
21277
|
-
},{}],
|
|
22009
|
+
},{}],195:[function(require,module,exports){
|
|
21278
22010
|
module.exports={
|
|
21279
22011
|
"title": "A JSON Schema for Swagger 2.0 API.",
|
|
21280
22012
|
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
@@ -21672,7 +22404,7 @@ module.exports={
|
|
|
21672
22404
|
}
|
|
21673
22405
|
}
|
|
21674
22406
|
|
|
21675
|
-
},{}],
|
|
22407
|
+
},{}],196:[function(require,module,exports){
|
|
21676
22408
|
'use strict';
|
|
21677
22409
|
|
|
21678
22410
|
module.exports = {
|
|
@@ -21697,15 +22429,15 @@ module.exports = {
|
|
|
21697
22429
|
]
|
|
21698
22430
|
};
|
|
21699
22431
|
|
|
21700
|
-
},{}],
|
|
21701
|
-
arguments[4][
|
|
21702
|
-
},{"dup":
|
|
22432
|
+
},{}],197:[function(require,module,exports){
|
|
22433
|
+
arguments[4][192][0].apply(exports,arguments)
|
|
22434
|
+
},{"dup":192}],198:[function(require,module,exports){
|
|
21703
22435
|
module.exports={
|
|
21704
22436
|
"type": "integer"
|
|
21705
22437
|
}
|
|
21706
|
-
},{}],
|
|
21707
|
-
arguments[4][
|
|
21708
|
-
},{"dup":
|
|
22438
|
+
},{}],199:[function(require,module,exports){
|
|
22439
|
+
arguments[4][198][0].apply(exports,arguments)
|
|
22440
|
+
},{"dup":198}],200:[function(require,module,exports){
|
|
21709
22441
|
module.exports={
|
|
21710
22442
|
"integer": {
|
|
21711
22443
|
"type": "integer"
|
|
@@ -21714,7 +22446,7 @@ module.exports={
|
|
|
21714
22446
|
"$ref": "#/integer"
|
|
21715
22447
|
}
|
|
21716
22448
|
}
|
|
21717
|
-
},{}],
|
|
22449
|
+
},{}],201:[function(require,module,exports){
|
|
21718
22450
|
module.exports=[
|
|
21719
22451
|
{
|
|
21720
22452
|
"description": "additionalItems as schema",
|
|
@@ -21798,7 +22530,7 @@ module.exports=[
|
|
|
21798
22530
|
}
|
|
21799
22531
|
]
|
|
21800
22532
|
|
|
21801
|
-
},{}],
|
|
22533
|
+
},{}],202:[function(require,module,exports){
|
|
21802
22534
|
module.exports=[
|
|
21803
22535
|
{
|
|
21804
22536
|
"description":
|
|
@@ -21888,7 +22620,7 @@ module.exports=[
|
|
|
21888
22620
|
}
|
|
21889
22621
|
]
|
|
21890
22622
|
|
|
21891
|
-
},{}],
|
|
22623
|
+
},{}],203:[function(require,module,exports){
|
|
21892
22624
|
module.exports=[
|
|
21893
22625
|
{
|
|
21894
22626
|
"description": "allOf",
|
|
@@ -22002,7 +22734,7 @@ module.exports=[
|
|
|
22002
22734
|
}
|
|
22003
22735
|
]
|
|
22004
22736
|
|
|
22005
|
-
},{}],
|
|
22737
|
+
},{}],204:[function(require,module,exports){
|
|
22006
22738
|
module.exports=[
|
|
22007
22739
|
{
|
|
22008
22740
|
"description": "anyOf",
|
|
@@ -22072,7 +22804,7 @@ module.exports=[
|
|
|
22072
22804
|
}
|
|
22073
22805
|
]
|
|
22074
22806
|
|
|
22075
|
-
},{}],
|
|
22807
|
+
},{}],205:[function(require,module,exports){
|
|
22076
22808
|
module.exports=[
|
|
22077
22809
|
{
|
|
22078
22810
|
"description": "invalid type for default",
|
|
@@ -22123,7 +22855,7 @@ module.exports=[
|
|
|
22123
22855
|
}
|
|
22124
22856
|
]
|
|
22125
22857
|
|
|
22126
|
-
},{}],
|
|
22858
|
+
},{}],206:[function(require,module,exports){
|
|
22127
22859
|
module.exports=[
|
|
22128
22860
|
{
|
|
22129
22861
|
"description": "valid definition",
|
|
@@ -22157,7 +22889,7 @@ module.exports=[
|
|
|
22157
22889
|
}
|
|
22158
22890
|
]
|
|
22159
22891
|
|
|
22160
|
-
},{}],
|
|
22892
|
+
},{}],207:[function(require,module,exports){
|
|
22161
22893
|
module.exports=[
|
|
22162
22894
|
{
|
|
22163
22895
|
"description": "dependencies",
|
|
@@ -22272,7 +23004,7 @@ module.exports=[
|
|
|
22272
23004
|
}
|
|
22273
23005
|
]
|
|
22274
23006
|
|
|
22275
|
-
},{}],
|
|
23007
|
+
},{}],208:[function(require,module,exports){
|
|
22276
23008
|
module.exports=[
|
|
22277
23009
|
{
|
|
22278
23010
|
"description": "simple enum validation",
|
|
@@ -22346,7 +23078,7 @@ module.exports=[
|
|
|
22346
23078
|
}
|
|
22347
23079
|
]
|
|
22348
23080
|
|
|
22349
|
-
},{}],
|
|
23081
|
+
},{}],209:[function(require,module,exports){
|
|
22350
23082
|
module.exports=[
|
|
22351
23083
|
{
|
|
22352
23084
|
"description": "a schema given for items",
|
|
@@ -22394,7 +23126,7 @@ module.exports=[
|
|
|
22394
23126
|
}
|
|
22395
23127
|
]
|
|
22396
23128
|
|
|
22397
|
-
},{}],
|
|
23129
|
+
},{}],210:[function(require,module,exports){
|
|
22398
23130
|
module.exports=[
|
|
22399
23131
|
{
|
|
22400
23132
|
"description": "maxItems validation",
|
|
@@ -22424,7 +23156,7 @@ module.exports=[
|
|
|
22424
23156
|
}
|
|
22425
23157
|
]
|
|
22426
23158
|
|
|
22427
|
-
},{}],
|
|
23159
|
+
},{}],211:[function(require,module,exports){
|
|
22428
23160
|
module.exports=[
|
|
22429
23161
|
{
|
|
22430
23162
|
"description": "maxLength validation",
|
|
@@ -22459,7 +23191,7 @@ module.exports=[
|
|
|
22459
23191
|
}
|
|
22460
23192
|
]
|
|
22461
23193
|
|
|
22462
|
-
},{}],
|
|
23194
|
+
},{}],212:[function(require,module,exports){
|
|
22463
23195
|
module.exports=[
|
|
22464
23196
|
{
|
|
22465
23197
|
"description": "maxProperties validation",
|
|
@@ -22489,7 +23221,7 @@ module.exports=[
|
|
|
22489
23221
|
}
|
|
22490
23222
|
]
|
|
22491
23223
|
|
|
22492
|
-
},{}],
|
|
23224
|
+
},{}],213:[function(require,module,exports){
|
|
22493
23225
|
module.exports=[
|
|
22494
23226
|
{
|
|
22495
23227
|
"description": "maximum validation",
|
|
@@ -22533,7 +23265,7 @@ module.exports=[
|
|
|
22533
23265
|
}
|
|
22534
23266
|
]
|
|
22535
23267
|
|
|
22536
|
-
},{}],
|
|
23268
|
+
},{}],214:[function(require,module,exports){
|
|
22537
23269
|
module.exports=[
|
|
22538
23270
|
{
|
|
22539
23271
|
"description": "minItems validation",
|
|
@@ -22563,7 +23295,7 @@ module.exports=[
|
|
|
22563
23295
|
}
|
|
22564
23296
|
]
|
|
22565
23297
|
|
|
22566
|
-
},{}],
|
|
23298
|
+
},{}],215:[function(require,module,exports){
|
|
22567
23299
|
module.exports=[
|
|
22568
23300
|
{
|
|
22569
23301
|
"description": "minLength validation",
|
|
@@ -22598,7 +23330,7 @@ module.exports=[
|
|
|
22598
23330
|
}
|
|
22599
23331
|
]
|
|
22600
23332
|
|
|
22601
|
-
},{}],
|
|
23333
|
+
},{}],216:[function(require,module,exports){
|
|
22602
23334
|
module.exports=[
|
|
22603
23335
|
{
|
|
22604
23336
|
"description": "minProperties validation",
|
|
@@ -22628,7 +23360,7 @@ module.exports=[
|
|
|
22628
23360
|
}
|
|
22629
23361
|
]
|
|
22630
23362
|
|
|
22631
|
-
},{}],
|
|
23363
|
+
},{}],217:[function(require,module,exports){
|
|
22632
23364
|
module.exports=[
|
|
22633
23365
|
{
|
|
22634
23366
|
"description": "minimum validation",
|
|
@@ -22672,7 +23404,7 @@ module.exports=[
|
|
|
22672
23404
|
}
|
|
22673
23405
|
]
|
|
22674
23406
|
|
|
22675
|
-
},{}],
|
|
23407
|
+
},{}],218:[function(require,module,exports){
|
|
22676
23408
|
module.exports=[
|
|
22677
23409
|
{
|
|
22678
23410
|
"description": "by int",
|
|
@@ -22734,7 +23466,7 @@ module.exports=[
|
|
|
22734
23466
|
}
|
|
22735
23467
|
]
|
|
22736
23468
|
|
|
22737
|
-
},{}],
|
|
23469
|
+
},{}],219:[function(require,module,exports){
|
|
22738
23470
|
module.exports=[
|
|
22739
23471
|
{
|
|
22740
23472
|
"description": "not",
|
|
@@ -22832,7 +23564,7 @@ module.exports=[
|
|
|
22832
23564
|
|
|
22833
23565
|
]
|
|
22834
23566
|
|
|
22835
|
-
},{}],
|
|
23567
|
+
},{}],220:[function(require,module,exports){
|
|
22836
23568
|
module.exports=[
|
|
22837
23569
|
{
|
|
22838
23570
|
"description": "oneOf",
|
|
@@ -22902,7 +23634,7 @@ module.exports=[
|
|
|
22902
23634
|
}
|
|
22903
23635
|
]
|
|
22904
23636
|
|
|
22905
|
-
},{}],
|
|
23637
|
+
},{}],221:[function(require,module,exports){
|
|
22906
23638
|
module.exports=[
|
|
22907
23639
|
{
|
|
22908
23640
|
"description": "integer",
|
|
@@ -23011,7 +23743,7 @@ module.exports=[
|
|
|
23011
23743
|
}
|
|
23012
23744
|
]
|
|
23013
23745
|
|
|
23014
|
-
},{}],
|
|
23746
|
+
},{}],222:[function(require,module,exports){
|
|
23015
23747
|
module.exports=[
|
|
23016
23748
|
{
|
|
23017
23749
|
"description": "validation of date-time strings",
|
|
@@ -23156,7 +23888,7 @@ module.exports=[
|
|
|
23156
23888
|
}
|
|
23157
23889
|
]
|
|
23158
23890
|
|
|
23159
|
-
},{}],
|
|
23891
|
+
},{}],223:[function(require,module,exports){
|
|
23160
23892
|
module.exports=[
|
|
23161
23893
|
{
|
|
23162
23894
|
"description": "pattern validation",
|
|
@@ -23181,7 +23913,7 @@ module.exports=[
|
|
|
23181
23913
|
}
|
|
23182
23914
|
]
|
|
23183
23915
|
|
|
23184
|
-
},{}],
|
|
23916
|
+
},{}],224:[function(require,module,exports){
|
|
23185
23917
|
module.exports=[
|
|
23186
23918
|
{
|
|
23187
23919
|
"description":
|
|
@@ -23293,7 +24025,7 @@ module.exports=[
|
|
|
23293
24025
|
}
|
|
23294
24026
|
]
|
|
23295
24027
|
|
|
23296
|
-
},{}],
|
|
24028
|
+
},{}],225:[function(require,module,exports){
|
|
23297
24029
|
module.exports=[
|
|
23298
24030
|
{
|
|
23299
24031
|
"description": "object properties validation",
|
|
@@ -23387,7 +24119,7 @@ module.exports=[
|
|
|
23387
24119
|
}
|
|
23388
24120
|
]
|
|
23389
24121
|
|
|
23390
|
-
},{}],
|
|
24122
|
+
},{}],226:[function(require,module,exports){
|
|
23391
24123
|
module.exports=[
|
|
23392
24124
|
{
|
|
23393
24125
|
"description": "root pointer ref",
|
|
@@ -23533,7 +24265,7 @@ module.exports=[
|
|
|
23533
24265
|
}
|
|
23534
24266
|
]
|
|
23535
24267
|
|
|
23536
|
-
},{}],
|
|
24268
|
+
},{}],227:[function(require,module,exports){
|
|
23537
24269
|
module.exports=[
|
|
23538
24270
|
{
|
|
23539
24271
|
"description": "remote ref",
|
|
@@ -23609,7 +24341,7 @@ module.exports=[
|
|
|
23609
24341
|
}
|
|
23610
24342
|
]
|
|
23611
24343
|
|
|
23612
|
-
},{}],
|
|
24344
|
+
},{}],228:[function(require,module,exports){
|
|
23613
24345
|
module.exports=[
|
|
23614
24346
|
{
|
|
23615
24347
|
"description": "required validation",
|
|
@@ -23650,7 +24382,7 @@ module.exports=[
|
|
|
23650
24382
|
}
|
|
23651
24383
|
]
|
|
23652
24384
|
|
|
23653
|
-
},{}],
|
|
24385
|
+
},{}],229:[function(require,module,exports){
|
|
23654
24386
|
module.exports=[
|
|
23655
24387
|
{
|
|
23656
24388
|
"description": "integer type matches integers",
|
|
@@ -23982,7 +24714,7 @@ module.exports=[
|
|
|
23982
24714
|
}
|
|
23983
24715
|
]
|
|
23984
24716
|
|
|
23985
|
-
},{}],
|
|
24717
|
+
},{}],230:[function(require,module,exports){
|
|
23986
24718
|
module.exports=[
|
|
23987
24719
|
{
|
|
23988
24720
|
"description": "uniqueItems validation",
|
|
@@ -24063,7 +24795,7 @@ module.exports=[
|
|
|
24063
24795
|
}
|
|
24064
24796
|
]
|
|
24065
24797
|
|
|
24066
|
-
},{}],
|
|
24798
|
+
},{}],231:[function(require,module,exports){
|
|
24067
24799
|
"use strict";
|
|
24068
24800
|
|
|
24069
24801
|
var isBrowser = typeof window !== "undefined";
|
|
@@ -24156,7 +24888,7 @@ describe("Automatic schema loading", function () {
|
|
|
24156
24888
|
|
|
24157
24889
|
});
|
|
24158
24890
|
|
|
24159
|
-
},{"../../src/ZSchema":
|
|
24891
|
+
},{"../../src/ZSchema":123,"https":7}],232:[function(require,module,exports){
|
|
24160
24892
|
"use strict";
|
|
24161
24893
|
|
|
24162
24894
|
var ZSchema = require("../../src/ZSchema");
|
|
@@ -24228,7 +24960,7 @@ describe("Basic", function () {
|
|
|
24228
24960
|
|
|
24229
24961
|
});
|
|
24230
24962
|
|
|
24231
|
-
},{"../../src/ZSchema":
|
|
24963
|
+
},{"../../src/ZSchema":123,"../files/draft-04-schema.json":197,"../jsonSchemaTestSuite/remotes/folder/folderInteger.json":198,"../jsonSchemaTestSuite/remotes/integer.json":199,"../jsonSchemaTestSuite/remotes/subSchemas.json":200}],233:[function(require,module,exports){
|
|
24232
24964
|
"use strict";
|
|
24233
24965
|
|
|
24234
24966
|
var ZSchema = require("../../src/ZSchema");
|
|
@@ -24324,7 +25056,7 @@ describe("JsonSchemaTestSuite", function () {
|
|
|
24324
25056
|
|
|
24325
25057
|
});
|
|
24326
25058
|
|
|
24327
|
-
},{"../../src/ZSchema":
|
|
25059
|
+
},{"../../src/ZSchema":123,"../files/draft-04-schema.json":197,"../jsonSchemaTestSuite/remotes/folder/folderInteger.json":198,"../jsonSchemaTestSuite/remotes/integer.json":199,"../jsonSchemaTestSuite/remotes/subSchemas.json":200,"../jsonSchemaTestSuite/tests/draft4/additionalItems.json":201,"../jsonSchemaTestSuite/tests/draft4/additionalProperties.json":202,"../jsonSchemaTestSuite/tests/draft4/allOf.json":203,"../jsonSchemaTestSuite/tests/draft4/anyOf.json":204,"../jsonSchemaTestSuite/tests/draft4/default.json":205,"../jsonSchemaTestSuite/tests/draft4/definitions.json":206,"../jsonSchemaTestSuite/tests/draft4/dependencies.json":207,"../jsonSchemaTestSuite/tests/draft4/enum.json":208,"../jsonSchemaTestSuite/tests/draft4/items.json":209,"../jsonSchemaTestSuite/tests/draft4/maxItems.json":210,"../jsonSchemaTestSuite/tests/draft4/maxLength.json":211,"../jsonSchemaTestSuite/tests/draft4/maxProperties.json":212,"../jsonSchemaTestSuite/tests/draft4/maximum.json":213,"../jsonSchemaTestSuite/tests/draft4/minItems.json":214,"../jsonSchemaTestSuite/tests/draft4/minLength.json":215,"../jsonSchemaTestSuite/tests/draft4/minProperties.json":216,"../jsonSchemaTestSuite/tests/draft4/minimum.json":217,"../jsonSchemaTestSuite/tests/draft4/multipleOf.json":218,"../jsonSchemaTestSuite/tests/draft4/not.json":219,"../jsonSchemaTestSuite/tests/draft4/oneOf.json":220,"../jsonSchemaTestSuite/tests/draft4/optional/bignum.json":221,"../jsonSchemaTestSuite/tests/draft4/optional/format.json":222,"../jsonSchemaTestSuite/tests/draft4/pattern.json":223,"../jsonSchemaTestSuite/tests/draft4/patternProperties.json":224,"../jsonSchemaTestSuite/tests/draft4/properties.json":225,"../jsonSchemaTestSuite/tests/draft4/ref.json":226,"../jsonSchemaTestSuite/tests/draft4/refRemote.json":227,"../jsonSchemaTestSuite/tests/draft4/required.json":228,"../jsonSchemaTestSuite/tests/draft4/type.json":229,"../jsonSchemaTestSuite/tests/draft4/uniqueItems.json":230}],234:[function(require,module,exports){
|
|
24328
25060
|
"use strict";
|
|
24329
25061
|
|
|
24330
25062
|
var ZSchema = require("../../src/ZSchema");
|
|
@@ -24358,7 +25090,7 @@ describe("Using multiple instances of Z-Schema", function () {
|
|
|
24358
25090
|
|
|
24359
25091
|
});
|
|
24360
25092
|
|
|
24361
|
-
},{"../../src/ZSchema":
|
|
25093
|
+
},{"../../src/ZSchema":123}],235:[function(require,module,exports){
|
|
24362
25094
|
/*jshint -W030 */
|
|
24363
25095
|
|
|
24364
25096
|
"use strict";
|
|
@@ -24556,7 +25288,7 @@ describe("ZSchemaTestSuite", function () {
|
|
|
24556
25288
|
|
|
24557
25289
|
});
|
|
24558
25290
|
|
|
24559
|
-
},{"../../src/ZSchema":
|
|
25291
|
+
},{"../../src/ZSchema":123,"../ZSchemaTestSuite/AssumeAdditional.js":126,"../ZSchemaTestSuite/CustomFormats.js":127,"../ZSchemaTestSuite/CustomFormatsAsync.js":128,"../ZSchemaTestSuite/CustomValidator.js":129,"../ZSchemaTestSuite/ErrorPathAsArray.js":130,"../ZSchemaTestSuite/ErrorPathAsJSONPointer.js":131,"../ZSchemaTestSuite/ForceAdditional.js":132,"../ZSchemaTestSuite/ForceItems.js":133,"../ZSchemaTestSuite/ForceMaxItems.js":134,"../ZSchemaTestSuite/ForceMaxLength.js":135,"../ZSchemaTestSuite/ForceMinItems.js":136,"../ZSchemaTestSuite/ForceMinLength.js":137,"../ZSchemaTestSuite/ForceProperties.js":138,"../ZSchemaTestSuite/IgnoreUnresolvableReferences.js":139,"../ZSchemaTestSuite/InvalidId.js":140,"../ZSchemaTestSuite/Issue101.js":141,"../ZSchemaTestSuite/Issue102.js":142,"../ZSchemaTestSuite/Issue103.js":143,"../ZSchemaTestSuite/Issue106.js":144,"../ZSchemaTestSuite/Issue107.js":145,"../ZSchemaTestSuite/Issue12.js":146,"../ZSchemaTestSuite/Issue121.js":147,"../ZSchemaTestSuite/Issue125.js":148,"../ZSchemaTestSuite/Issue126.js":149,"../ZSchemaTestSuite/Issue13.js":150,"../ZSchemaTestSuite/Issue130.js":151,"../ZSchemaTestSuite/Issue131.js":152,"../ZSchemaTestSuite/Issue137.js":153,"../ZSchemaTestSuite/Issue139.js":154,"../ZSchemaTestSuite/Issue142.js":155,"../ZSchemaTestSuite/Issue146.js":156,"../ZSchemaTestSuite/Issue151.js":157,"../ZSchemaTestSuite/Issue16.js":158,"../ZSchemaTestSuite/Issue22.js":159,"../ZSchemaTestSuite/Issue25.js":160,"../ZSchemaTestSuite/Issue26.js":161,"../ZSchemaTestSuite/Issue37.js":162,"../ZSchemaTestSuite/Issue40.js":163,"../ZSchemaTestSuite/Issue41.js":164,"../ZSchemaTestSuite/Issue43.js":165,"../ZSchemaTestSuite/Issue44.js":166,"../ZSchemaTestSuite/Issue45.js":167,"../ZSchemaTestSuite/Issue47.js":168,"../ZSchemaTestSuite/Issue48.js":169,"../ZSchemaTestSuite/Issue49.js":170,"../ZSchemaTestSuite/Issue53.js":171,"../ZSchemaTestSuite/Issue56.js":172,"../ZSchemaTestSuite/Issue57.js":173,"../ZSchemaTestSuite/Issue58.js":174,"../ZSchemaTestSuite/Issue63.js":175,"../ZSchemaTestSuite/Issue64.js":176,"../ZSchemaTestSuite/Issue67.js":177,"../ZSchemaTestSuite/Issue71.js":178,"../ZSchemaTestSuite/Issue73.js":179,"../ZSchemaTestSuite/Issue76.js":180,"../ZSchemaTestSuite/Issue85.js":181,"../ZSchemaTestSuite/Issue94.js":182,"../ZSchemaTestSuite/Issue96.js":183,"../ZSchemaTestSuite/Issue98.js":184,"../ZSchemaTestSuite/MultipleSchemas.js":185,"../ZSchemaTestSuite/NoEmptyArrays.js":186,"../ZSchemaTestSuite/NoEmptyStrings.js":187,"../ZSchemaTestSuite/NoExtraKeywords.js":188,"../ZSchemaTestSuite/NoTypeless.js":189,"../ZSchemaTestSuite/PedanticCheck.js":190,"../ZSchemaTestSuite/StrictUris.js":191,"../ZSchemaTestSuite/getRegisteredFormats.js":196}],236:[function(require,module,exports){
|
|
24560
25292
|
"use strict";
|
|
24561
25293
|
|
|
24562
25294
|
var ZSchema = require("../../src/ZSchema");
|
|
@@ -24655,4 +25387,4 @@ describe("Using path to schema as a third argument", function () {
|
|
|
24655
25387
|
|
|
24656
25388
|
});
|
|
24657
25389
|
|
|
24658
|
-
},{"../../src/ZSchema":
|
|
25390
|
+
},{"../../src/ZSchema":123}]},{},[231,232,233,234,236,235]);
|