z-schema 3.18.4 → 3.21.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 +1439 -671
- package/dist/ZSchema-browser.js +501 -157
- package/package.json +15 -17
- package/src/Errors.js +1 -0
- package/src/JsonValidation.js +6 -1
- package/src/Report.js +2 -1
- package/src/SchemaCache.js +9 -1
- package/src/Utils.js +14 -4
- package/src/ZSchema.js +41 -21
|
@@ -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]
|
|
44
59
|
|
|
45
|
-
arr = new Arr((
|
|
60
|
+
var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
|
|
61
|
+
|
|
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
|
+
};
|
|
2190
2397
|
|
|
2191
|
-
|
|
2192
|
-
|
|
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
|
+
}
|
|
2193
2432
|
|
|
2194
|
-
|
|
2195
|
-
|
|
2433
|
+
if (position < 0)
|
|
2434
|
+
return this;
|
|
2196
2435
|
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
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;
|
|
2436
|
+
if (position === 0)
|
|
2437
|
+
list.shift();
|
|
2438
|
+
else
|
|
2439
|
+
spliceOne(list, position);
|
|
2440
|
+
|
|
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){
|
|
@@ -2349,7 +2625,7 @@ function validateParams (params) {
|
|
|
2349
2625
|
},{"http":30,"url":36}],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,27 +7895,25 @@ 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
|
}
|
|
@@ -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;
|
|
@@ -8291,12 +8610,10 @@ Writable.prototype._destroy = function (err, cb) {
|
|
|
8291
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,"util-deprecate":38}],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":36,"xtend":
|
|
8929
|
+
},{"./lib/request":32,"./lib/response":33,"builtin-status-codes":4,"url":36,"xtend":112}],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) {
|
|
@@ -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
|
|
|
@@ -10359,6 +10783,10 @@ var _isNumeric = require('./lib/isNumeric');
|
|
|
10359
10783
|
|
|
10360
10784
|
var _isNumeric2 = _interopRequireDefault(_isNumeric);
|
|
10361
10785
|
|
|
10786
|
+
var _isPort = require('./lib/isPort');
|
|
10787
|
+
|
|
10788
|
+
var _isPort2 = _interopRequireDefault(_isPort);
|
|
10789
|
+
|
|
10362
10790
|
var _isLowercase = require('./lib/isLowercase');
|
|
10363
10791
|
|
|
10364
10792
|
var _isLowercase2 = _interopRequireDefault(_isLowercase);
|
|
@@ -10491,6 +10919,18 @@ var _isISO = require('./lib/isISO8601');
|
|
|
10491
10919
|
|
|
10492
10920
|
var _isISO2 = _interopRequireDefault(_isISO);
|
|
10493
10921
|
|
|
10922
|
+
var _isRFC = require('./lib/isRFC3339');
|
|
10923
|
+
|
|
10924
|
+
var _isRFC2 = _interopRequireDefault(_isRFC);
|
|
10925
|
+
|
|
10926
|
+
var _isISO31661Alpha = require('./lib/isISO31661Alpha2');
|
|
10927
|
+
|
|
10928
|
+
var _isISO31661Alpha2 = _interopRequireDefault(_isISO31661Alpha);
|
|
10929
|
+
|
|
10930
|
+
var _isISO31661Alpha3 = require('./lib/isISO31661Alpha3');
|
|
10931
|
+
|
|
10932
|
+
var _isISO31661Alpha4 = _interopRequireDefault(_isISO31661Alpha3);
|
|
10933
|
+
|
|
10494
10934
|
var _isBase = require('./lib/isBase64');
|
|
10495
10935
|
|
|
10496
10936
|
var _isBase2 = _interopRequireDefault(_isBase);
|
|
@@ -10499,6 +10939,10 @@ var _isDataURI = require('./lib/isDataURI');
|
|
|
10499
10939
|
|
|
10500
10940
|
var _isDataURI2 = _interopRequireDefault(_isDataURI);
|
|
10501
10941
|
|
|
10942
|
+
var _isMimeType = require('./lib/isMimeType');
|
|
10943
|
+
|
|
10944
|
+
var _isMimeType2 = _interopRequireDefault(_isMimeType);
|
|
10945
|
+
|
|
10502
10946
|
var _isLatLong = require('./lib/isLatLong');
|
|
10503
10947
|
|
|
10504
10948
|
var _isLatLong2 = _interopRequireDefault(_isLatLong);
|
|
@@ -10553,7 +10997,7 @@ var _toString2 = _interopRequireDefault(_toString);
|
|
|
10553
10997
|
|
|
10554
10998
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10555
10999
|
|
|
10556
|
-
var version = '
|
|
11000
|
+
var version = '10.2.0';
|
|
10557
11001
|
|
|
10558
11002
|
var validator = {
|
|
10559
11003
|
version: version,
|
|
@@ -10573,6 +11017,7 @@ var validator = {
|
|
|
10573
11017
|
isAlpha: _isAlpha2.default,
|
|
10574
11018
|
isAlphanumeric: _isAlphanumeric2.default,
|
|
10575
11019
|
isNumeric: _isNumeric2.default,
|
|
11020
|
+
isPort: _isPort2.default,
|
|
10576
11021
|
isLowercase: _isLowercase2.default,
|
|
10577
11022
|
isUppercase: _isUppercase2.default,
|
|
10578
11023
|
isAscii: _isAscii2.default,
|
|
@@ -10605,10 +11050,15 @@ var validator = {
|
|
|
10605
11050
|
isISSN: _isISSN2.default,
|
|
10606
11051
|
isMobilePhone: _isMobilePhone2.default,
|
|
10607
11052
|
isPostalCode: _isPostalCode2.default,
|
|
11053
|
+
isPostalCodeLocales: _isPostalCode.locales,
|
|
10608
11054
|
isCurrency: _isCurrency2.default,
|
|
10609
11055
|
isISO8601: _isISO2.default,
|
|
11056
|
+
isRFC3339: _isRFC2.default,
|
|
11057
|
+
isISO31661Alpha2: _isISO31661Alpha2.default,
|
|
11058
|
+
isISO31661Alpha3: _isISO31661Alpha4.default,
|
|
10610
11059
|
isBase64: _isBase2.default,
|
|
10611
11060
|
isDataURI: _isDataURI2.default,
|
|
11061
|
+
isMimeType: _isMimeType2.default,
|
|
10612
11062
|
isLatLong: _isLatLong2.default,
|
|
10613
11063
|
ltrim: _ltrim2.default,
|
|
10614
11064
|
rtrim: _rtrim2.default,
|
|
@@ -10625,7 +11075,7 @@ var validator = {
|
|
|
10625
11075
|
|
|
10626
11076
|
exports.default = validator;
|
|
10627
11077
|
module.exports = exports['default'];
|
|
10628
|
-
},{"./lib/blacklist":41,"./lib/contains":42,"./lib/equals":43,"./lib/escape":44,"./lib/isAfter":45,"./lib/isAlpha":46,"./lib/isAlphanumeric":47,"./lib/isAscii":48,"./lib/isBase64":49,"./lib/isBefore":50,"./lib/isBoolean":51,"./lib/isByteLength":52,"./lib/isCreditCard":53,"./lib/isCurrency":54,"./lib/isDataURI":55,"./lib/isDecimal":56,"./lib/isDivisibleBy":57,"./lib/isEmail":58,"./lib/isEmpty":59,"./lib/isFQDN":60,"./lib/isFloat":61,"./lib/isFullWidth":62,"./lib/isHalfWidth":63,"./lib/isHash":64,"./lib/isHexColor":65,"./lib/isHexadecimal":66,"./lib/isIP":67,"./lib/isISBN":68,"./lib/isISIN":69,"./lib/
|
|
11078
|
+
},{"./lib/blacklist":41,"./lib/contains":42,"./lib/equals":43,"./lib/escape":44,"./lib/isAfter":45,"./lib/isAlpha":46,"./lib/isAlphanumeric":47,"./lib/isAscii":48,"./lib/isBase64":49,"./lib/isBefore":50,"./lib/isBoolean":51,"./lib/isByteLength":52,"./lib/isCreditCard":53,"./lib/isCurrency":54,"./lib/isDataURI":55,"./lib/isDecimal":56,"./lib/isDivisibleBy":57,"./lib/isEmail":58,"./lib/isEmpty":59,"./lib/isFQDN":60,"./lib/isFloat":61,"./lib/isFullWidth":62,"./lib/isHalfWidth":63,"./lib/isHash":64,"./lib/isHexColor":65,"./lib/isHexadecimal":66,"./lib/isIP":67,"./lib/isISBN":68,"./lib/isISIN":69,"./lib/isISO31661Alpha2":70,"./lib/isISO31661Alpha3":71,"./lib/isISO8601":72,"./lib/isISRC":73,"./lib/isISSN":74,"./lib/isIn":75,"./lib/isInt":76,"./lib/isJSON":77,"./lib/isLatLong":78,"./lib/isLength":79,"./lib/isLowercase":80,"./lib/isMACAddress":81,"./lib/isMD5":82,"./lib/isMimeType":83,"./lib/isMobilePhone":84,"./lib/isMongoId":85,"./lib/isMultibyte":86,"./lib/isNumeric":87,"./lib/isPort":88,"./lib/isPostalCode":89,"./lib/isRFC3339":90,"./lib/isSurrogatePair":91,"./lib/isURL":92,"./lib/isUUID":93,"./lib/isUppercase":94,"./lib/isVariableWidth":95,"./lib/isWhitelisted":96,"./lib/ltrim":97,"./lib/matches":98,"./lib/normalizeEmail":99,"./lib/rtrim":100,"./lib/stripLow":101,"./lib/toBoolean":102,"./lib/toDate":103,"./lib/toFloat":104,"./lib/toInt":105,"./lib/trim":106,"./lib/unescape":107,"./lib/util/toString":110,"./lib/whitelist":111}],40:[function(require,module,exports){
|
|
10629
11079
|
'use strict';
|
|
10630
11080
|
|
|
10631
11081
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -10633,9 +11083,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
10633
11083
|
});
|
|
10634
11084
|
var alpha = exports.alpha = {
|
|
10635
11085
|
'en-US': /^[A-Z]+$/i,
|
|
11086
|
+
'bg-BG': /^[А-Я]+$/i,
|
|
10636
11087
|
'cs-CZ': /^[A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i,
|
|
10637
11088
|
'da-DK': /^[A-ZÆØÅ]+$/i,
|
|
10638
11089
|
'de-DE': /^[A-ZÄÖÜß]+$/i,
|
|
11090
|
+
'el-GR': /^[Α-ω]+$/i,
|
|
10639
11091
|
'es-ES': /^[A-ZÁÉÍÑÓÚÜ]+$/i,
|
|
10640
11092
|
'fr-FR': /^[A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,
|
|
10641
11093
|
'it-IT': /^[A-ZÀÉÈÌÎÓÒÙ]+$/i,
|
|
@@ -10646,19 +11098,22 @@ var alpha = exports.alpha = {
|
|
|
10646
11098
|
'pl-PL': /^[A-ZĄĆĘŚŁŃÓŻŹ]+$/i,
|
|
10647
11099
|
'pt-PT': /^[A-ZÃÁÀÂÇÉÊÍÕÓÔÚÜ]+$/i,
|
|
10648
11100
|
'ru-RU': /^[А-ЯЁ]+$/i,
|
|
11101
|
+
'sk-SK': /^[A-ZÁČĎÉÍŇÓŠŤÚÝŽĹŔĽÄÔ]+$/i,
|
|
10649
11102
|
'sr-RS@latin': /^[A-ZČĆŽŠĐ]+$/i,
|
|
10650
11103
|
'sr-RS': /^[А-ЯЂЈЉЊЋЏ]+$/i,
|
|
10651
11104
|
'sv-SE': /^[A-ZÅÄÖ]+$/i,
|
|
10652
11105
|
'tr-TR': /^[A-ZÇĞİıÖŞÜ]+$/i,
|
|
10653
|
-
'uk-UA': /^[А-ЩЬЮЯЄI
|
|
11106
|
+
'uk-UA': /^[А-ЩЬЮЯЄIЇҐі]+$/i,
|
|
10654
11107
|
ar: /^[ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/
|
|
10655
11108
|
};
|
|
10656
11109
|
|
|
10657
11110
|
var alphanumeric = exports.alphanumeric = {
|
|
10658
11111
|
'en-US': /^[0-9A-Z]+$/i,
|
|
11112
|
+
'bg-BG': /^[0-9А-Я]+$/i,
|
|
10659
11113
|
'cs-CZ': /^[0-9A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i,
|
|
10660
11114
|
'da-DK': /^[0-9A-ZÆØÅ]+$/i,
|
|
10661
11115
|
'de-DE': /^[0-9A-ZÄÖÜß]+$/i,
|
|
11116
|
+
'el-GR': /^[0-9Α-ω]+$/i,
|
|
10662
11117
|
'es-ES': /^[0-9A-ZÁÉÍÑÓÚÜ]+$/i,
|
|
10663
11118
|
'fr-FR': /^[0-9A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,
|
|
10664
11119
|
'it-IT': /^[0-9A-ZÀÉÈÌÎÓÒÙ]+$/i,
|
|
@@ -10669,25 +11124,29 @@ var alphanumeric = exports.alphanumeric = {
|
|
|
10669
11124
|
'pl-PL': /^[0-9A-ZĄĆĘŚŁŃÓŻŹ]+$/i,
|
|
10670
11125
|
'pt-PT': /^[0-9A-ZÃÁÀÂÇÉÊÍÕÓÔÚÜ]+$/i,
|
|
10671
11126
|
'ru-RU': /^[0-9А-ЯЁ]+$/i,
|
|
11127
|
+
'sk-SK': /^[0-9A-ZÁČĎÉÍŇÓŠŤÚÝŽĹŔĽÄÔ]+$/i,
|
|
10672
11128
|
'sr-RS@latin': /^[0-9A-ZČĆŽŠĐ]+$/i,
|
|
10673
11129
|
'sr-RS': /^[0-9А-ЯЂЈЉЊЋЏ]+$/i,
|
|
10674
11130
|
'sv-SE': /^[0-9A-ZÅÄÖ]+$/i,
|
|
10675
11131
|
'tr-TR': /^[0-9A-ZÇĞİıÖŞÜ]+$/i,
|
|
10676
|
-
'uk-UA': /^[0-9А-ЩЬЮЯЄI
|
|
11132
|
+
'uk-UA': /^[0-9А-ЩЬЮЯЄIЇҐі]+$/i,
|
|
10677
11133
|
ar: /^[٠١٢٣٤٥٦٧٨٩0-9ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/
|
|
10678
11134
|
};
|
|
10679
11135
|
|
|
11136
|
+
var decimal = exports.decimal = {
|
|
11137
|
+
'en-US': '.',
|
|
11138
|
+
ar: '٫'
|
|
11139
|
+
};
|
|
11140
|
+
|
|
10680
11141
|
var englishLocales = exports.englishLocales = ['AU', 'GB', 'HK', 'IN', 'NZ', 'ZA', 'ZM'];
|
|
10681
11142
|
|
|
10682
11143
|
for (var locale, i = 0; i < englishLocales.length; i++) {
|
|
10683
11144
|
locale = 'en-' + englishLocales[i];
|
|
10684
11145
|
alpha[locale] = alpha['en-US'];
|
|
10685
11146
|
alphanumeric[locale] = alphanumeric['en-US'];
|
|
11147
|
+
decimal[locale] = decimal['en-US'];
|
|
10686
11148
|
}
|
|
10687
11149
|
|
|
10688
|
-
alpha['pt-BR'] = alpha['pt-PT'];
|
|
10689
|
-
alphanumeric['pt-BR'] = alphanumeric['pt-PT'];
|
|
10690
|
-
|
|
10691
11150
|
// Source: http://www.localeplanet.com/java/
|
|
10692
11151
|
var arabicLocales = exports.arabicLocales = ['AE', 'BH', 'DZ', 'EG', 'IQ', 'JO', 'KW', 'LB', 'LY', 'MA', 'QM', 'QA', 'SA', 'SD', 'SY', 'TN', 'YE'];
|
|
10693
11152
|
|
|
@@ -10695,7 +11154,24 @@ for (var _locale, _i = 0; _i < arabicLocales.length; _i++) {
|
|
|
10695
11154
|
_locale = 'ar-' + arabicLocales[_i];
|
|
10696
11155
|
alpha[_locale] = alpha.ar;
|
|
10697
11156
|
alphanumeric[_locale] = alphanumeric.ar;
|
|
11157
|
+
decimal[_locale] = decimal.ar;
|
|
10698
11158
|
}
|
|
11159
|
+
|
|
11160
|
+
// Source: https://en.wikipedia.org/wiki/Decimal_mark
|
|
11161
|
+
var dotDecimal = exports.dotDecimal = [];
|
|
11162
|
+
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'];
|
|
11163
|
+
|
|
11164
|
+
for (var _i2 = 0; _i2 < dotDecimal.length; _i2++) {
|
|
11165
|
+
decimal[dotDecimal[_i2]] = decimal['en-US'];
|
|
11166
|
+
}
|
|
11167
|
+
|
|
11168
|
+
for (var _i3 = 0; _i3 < commaDecimal.length; _i3++) {
|
|
11169
|
+
decimal[commaDecimal[_i3]] = ',';
|
|
11170
|
+
}
|
|
11171
|
+
|
|
11172
|
+
alpha['pt-BR'] = alpha['pt-PT'];
|
|
11173
|
+
alphanumeric['pt-BR'] = alphanumeric['pt-PT'];
|
|
11174
|
+
decimal['pt-BR'] = decimal['pt-PT'];
|
|
10699
11175
|
},{}],41:[function(require,module,exports){
|
|
10700
11176
|
'use strict';
|
|
10701
11177
|
|
|
@@ -10715,7 +11191,7 @@ function blacklist(str, chars) {
|
|
|
10715
11191
|
return str.replace(new RegExp('[' + chars + ']+', 'g'), '');
|
|
10716
11192
|
}
|
|
10717
11193
|
module.exports = exports['default'];
|
|
10718
|
-
},{"./util/assertString":
|
|
11194
|
+
},{"./util/assertString":108}],42:[function(require,module,exports){
|
|
10719
11195
|
'use strict';
|
|
10720
11196
|
|
|
10721
11197
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -10738,7 +11214,7 @@ function contains(str, elem) {
|
|
|
10738
11214
|
return str.indexOf((0, _toString2.default)(elem)) >= 0;
|
|
10739
11215
|
}
|
|
10740
11216
|
module.exports = exports['default'];
|
|
10741
|
-
},{"./util/assertString":
|
|
11217
|
+
},{"./util/assertString":108,"./util/toString":110}],43:[function(require,module,exports){
|
|
10742
11218
|
'use strict';
|
|
10743
11219
|
|
|
10744
11220
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -10757,7 +11233,7 @@ function equals(str, comparison) {
|
|
|
10757
11233
|
return str === comparison;
|
|
10758
11234
|
}
|
|
10759
11235
|
module.exports = exports['default'];
|
|
10760
|
-
},{"./util/assertString":
|
|
11236
|
+
},{"./util/assertString":108}],44:[function(require,module,exports){
|
|
10761
11237
|
'use strict';
|
|
10762
11238
|
|
|
10763
11239
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -10776,7 +11252,7 @@ function escape(str) {
|
|
|
10776
11252
|
return str.replace(/&/g, '&').replace(/"/g, '"').replace(/'/g, ''').replace(/</g, '<').replace(/>/g, '>').replace(/\//g, '/').replace(/\\/g, '\').replace(/`/g, '`');
|
|
10777
11253
|
}
|
|
10778
11254
|
module.exports = exports['default'];
|
|
10779
|
-
},{"./util/assertString":
|
|
11255
|
+
},{"./util/assertString":108}],45:[function(require,module,exports){
|
|
10780
11256
|
'use strict';
|
|
10781
11257
|
|
|
10782
11258
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -10803,7 +11279,7 @@ function isAfter(str) {
|
|
|
10803
11279
|
return !!(original && comparison && original > comparison);
|
|
10804
11280
|
}
|
|
10805
11281
|
module.exports = exports['default'];
|
|
10806
|
-
},{"./toDate":
|
|
11282
|
+
},{"./toDate":103,"./util/assertString":108}],46:[function(require,module,exports){
|
|
10807
11283
|
'use strict';
|
|
10808
11284
|
|
|
10809
11285
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -10829,7 +11305,7 @@ function isAlpha(str) {
|
|
|
10829
11305
|
throw new Error('Invalid locale \'' + locale + '\'');
|
|
10830
11306
|
}
|
|
10831
11307
|
module.exports = exports['default'];
|
|
10832
|
-
},{"./alpha":40,"./util/assertString":
|
|
11308
|
+
},{"./alpha":40,"./util/assertString":108}],47:[function(require,module,exports){
|
|
10833
11309
|
'use strict';
|
|
10834
11310
|
|
|
10835
11311
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -10855,7 +11331,7 @@ function isAlphanumeric(str) {
|
|
|
10855
11331
|
throw new Error('Invalid locale \'' + locale + '\'');
|
|
10856
11332
|
}
|
|
10857
11333
|
module.exports = exports['default'];
|
|
10858
|
-
},{"./alpha":40,"./util/assertString":
|
|
11334
|
+
},{"./alpha":40,"./util/assertString":108}],48:[function(require,module,exports){
|
|
10859
11335
|
'use strict';
|
|
10860
11336
|
|
|
10861
11337
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -10878,7 +11354,7 @@ function isAscii(str) {
|
|
|
10878
11354
|
return ascii.test(str);
|
|
10879
11355
|
}
|
|
10880
11356
|
module.exports = exports['default'];
|
|
10881
|
-
},{"./util/assertString":
|
|
11357
|
+
},{"./util/assertString":108}],49:[function(require,module,exports){
|
|
10882
11358
|
'use strict';
|
|
10883
11359
|
|
|
10884
11360
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -10904,7 +11380,7 @@ function isBase64(str) {
|
|
|
10904
11380
|
return firstPaddingChar === -1 || firstPaddingChar === len - 1 || firstPaddingChar === len - 2 && str[len - 1] === '=';
|
|
10905
11381
|
}
|
|
10906
11382
|
module.exports = exports['default'];
|
|
10907
|
-
},{"./util/assertString":
|
|
11383
|
+
},{"./util/assertString":108}],50:[function(require,module,exports){
|
|
10908
11384
|
'use strict';
|
|
10909
11385
|
|
|
10910
11386
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -10931,7 +11407,7 @@ function isBefore(str) {
|
|
|
10931
11407
|
return !!(original && comparison && original < comparison);
|
|
10932
11408
|
}
|
|
10933
11409
|
module.exports = exports['default'];
|
|
10934
|
-
},{"./toDate":
|
|
11410
|
+
},{"./toDate":103,"./util/assertString":108}],51:[function(require,module,exports){
|
|
10935
11411
|
'use strict';
|
|
10936
11412
|
|
|
10937
11413
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -10950,7 +11426,7 @@ function isBoolean(str) {
|
|
|
10950
11426
|
return ['true', 'false', '1', '0'].indexOf(str) >= 0;
|
|
10951
11427
|
}
|
|
10952
11428
|
module.exports = exports['default'];
|
|
10953
|
-
},{"./util/assertString":
|
|
11429
|
+
},{"./util/assertString":108}],52:[function(require,module,exports){
|
|
10954
11430
|
'use strict';
|
|
10955
11431
|
|
|
10956
11432
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -10984,7 +11460,7 @@ function isByteLength(str, options) {
|
|
|
10984
11460
|
return len >= min && (typeof max === 'undefined' || len <= max);
|
|
10985
11461
|
}
|
|
10986
11462
|
module.exports = exports['default'];
|
|
10987
|
-
},{"./util/assertString":
|
|
11463
|
+
},{"./util/assertString":108}],53:[function(require,module,exports){
|
|
10988
11464
|
'use strict';
|
|
10989
11465
|
|
|
10990
11466
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -10999,7 +11475,7 @@ var _assertString2 = _interopRequireDefault(_assertString);
|
|
|
10999
11475
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11000
11476
|
|
|
11001
11477
|
/* eslint-disable max-len */
|
|
11002
|
-
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}|
|
|
11478
|
+
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})$/;
|
|
11003
11479
|
/* eslint-enable max-len */
|
|
11004
11480
|
|
|
11005
11481
|
function isCreditCard(str) {
|
|
@@ -11030,7 +11506,7 @@ function isCreditCard(str) {
|
|
|
11030
11506
|
return !!(sum % 10 === 0 ? sanitized : false);
|
|
11031
11507
|
}
|
|
11032
11508
|
module.exports = exports['default'];
|
|
11033
|
-
},{"./util/assertString":
|
|
11509
|
+
},{"./util/assertString":108}],54:[function(require,module,exports){
|
|
11034
11510
|
'use strict';
|
|
11035
11511
|
|
|
11036
11512
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11123,7 +11599,7 @@ function isCurrency(str, options) {
|
|
|
11123
11599
|
return currencyRegex(options).test(str);
|
|
11124
11600
|
}
|
|
11125
11601
|
module.exports = exports['default'];
|
|
11126
|
-
},{"./util/assertString":
|
|
11602
|
+
},{"./util/assertString":108,"./util/merge":109}],55:[function(require,module,exports){
|
|
11127
11603
|
'use strict';
|
|
11128
11604
|
|
|
11129
11605
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11137,14 +11613,43 @@ var _assertString2 = _interopRequireDefault(_assertString);
|
|
|
11137
11613
|
|
|
11138
11614
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11139
11615
|
|
|
11140
|
-
var
|
|
11616
|
+
var validMediaType = /^[a-z]+\/[a-z0-9\-\+]+$/i;
|
|
11617
|
+
|
|
11618
|
+
var validAttribute = /^[a-z\-]+=[a-z0-9\-]+$/i;
|
|
11619
|
+
|
|
11620
|
+
var validData = /^[a-z0-9!\$&'\(\)\*\+,;=\-\._~:@\/\?%\s]*$/i;
|
|
11141
11621
|
|
|
11142
11622
|
function isDataURI(str) {
|
|
11143
11623
|
(0, _assertString2.default)(str);
|
|
11144
|
-
|
|
11624
|
+
var data = str.split(',');
|
|
11625
|
+
if (data.length < 2) {
|
|
11626
|
+
return false;
|
|
11627
|
+
}
|
|
11628
|
+
var attributes = data.shift().trim().split(';');
|
|
11629
|
+
var schemeAndMediaType = attributes.shift();
|
|
11630
|
+
if (schemeAndMediaType.substr(0, 5) !== 'data:') {
|
|
11631
|
+
return false;
|
|
11632
|
+
}
|
|
11633
|
+
var mediaType = schemeAndMediaType.substr(5);
|
|
11634
|
+
if (mediaType !== '' && !validMediaType.test(mediaType)) {
|
|
11635
|
+
return false;
|
|
11636
|
+
}
|
|
11637
|
+
for (var i = 0; i < attributes.length; i++) {
|
|
11638
|
+
if (i === attributes.length - 1 && attributes[i].toLowerCase() === 'base64') {
|
|
11639
|
+
// ok
|
|
11640
|
+
} else if (!validAttribute.test(attributes[i])) {
|
|
11641
|
+
return false;
|
|
11642
|
+
}
|
|
11643
|
+
}
|
|
11644
|
+
for (var _i = 0; _i < data.length; _i++) {
|
|
11645
|
+
if (!validData.test(data[_i])) {
|
|
11646
|
+
return false;
|
|
11647
|
+
}
|
|
11648
|
+
}
|
|
11649
|
+
return true;
|
|
11145
11650
|
}
|
|
11146
11651
|
module.exports = exports['default'];
|
|
11147
|
-
},{"./util/assertString":
|
|
11652
|
+
},{"./util/assertString":108}],56:[function(require,module,exports){
|
|
11148
11653
|
'use strict';
|
|
11149
11654
|
|
|
11150
11655
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11152,20 +11657,41 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
11152
11657
|
});
|
|
11153
11658
|
exports.default = isDecimal;
|
|
11154
11659
|
|
|
11660
|
+
var _merge = require('./util/merge');
|
|
11661
|
+
|
|
11662
|
+
var _merge2 = _interopRequireDefault(_merge);
|
|
11663
|
+
|
|
11155
11664
|
var _assertString = require('./util/assertString');
|
|
11156
11665
|
|
|
11157
11666
|
var _assertString2 = _interopRequireDefault(_assertString);
|
|
11158
11667
|
|
|
11668
|
+
var _alpha = require('./alpha');
|
|
11669
|
+
|
|
11159
11670
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11160
11671
|
|
|
11161
|
-
|
|
11672
|
+
function decimalRegExp(options) {
|
|
11673
|
+
var regExp = new RegExp('^[-+]?([0-9]+)?(\\' + _alpha.decimal[options.locale] + '[0-9]{' + options.decimal_digits + '})' + (options.force_decimal ? '' : '?') + '$');
|
|
11674
|
+
return regExp;
|
|
11675
|
+
}
|
|
11676
|
+
|
|
11677
|
+
var default_decimal_options = {
|
|
11678
|
+
force_decimal: false,
|
|
11679
|
+
decimal_digits: '1,',
|
|
11680
|
+
locale: 'en-US'
|
|
11681
|
+
};
|
|
11682
|
+
|
|
11683
|
+
var blacklist = ['', '-', '+'];
|
|
11162
11684
|
|
|
11163
|
-
function isDecimal(str) {
|
|
11685
|
+
function isDecimal(str, options) {
|
|
11164
11686
|
(0, _assertString2.default)(str);
|
|
11165
|
-
|
|
11687
|
+
options = (0, _merge2.default)(options, default_decimal_options);
|
|
11688
|
+
if (options.locale in _alpha.decimal) {
|
|
11689
|
+
return !blacklist.includes(str.replace(/ /g, '')) && decimalRegExp(options).test(str);
|
|
11690
|
+
}
|
|
11691
|
+
throw new Error('Invalid locale \'' + options.locale + '\'');
|
|
11166
11692
|
}
|
|
11167
11693
|
module.exports = exports['default'];
|
|
11168
|
-
},{"./util/assertString":
|
|
11694
|
+
},{"./alpha":40,"./util/assertString":108,"./util/merge":109}],57:[function(require,module,exports){
|
|
11169
11695
|
'use strict';
|
|
11170
11696
|
|
|
11171
11697
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11188,7 +11714,7 @@ function isDivisibleBy(str, num) {
|
|
|
11188
11714
|
return (0, _toFloat2.default)(str) % parseInt(num, 10) === 0;
|
|
11189
11715
|
}
|
|
11190
11716
|
module.exports = exports['default'];
|
|
11191
|
-
},{"./toFloat":
|
|
11717
|
+
},{"./toFloat":104,"./util/assertString":108}],58:[function(require,module,exports){
|
|
11192
11718
|
'use strict';
|
|
11193
11719
|
|
|
11194
11720
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11249,8 +11775,16 @@ function isEmail(str, options) {
|
|
|
11249
11775
|
var user = parts.join('@');
|
|
11250
11776
|
|
|
11251
11777
|
var lower_domain = domain.toLowerCase();
|
|
11778
|
+
|
|
11252
11779
|
if (lower_domain === 'gmail.com' || lower_domain === 'googlemail.com') {
|
|
11253
|
-
|
|
11780
|
+
/*
|
|
11781
|
+
Previously we removed dots for gmail addresses before validating.
|
|
11782
|
+
This was removed because it allows `multiple..dots@gmail.com`
|
|
11783
|
+
to be reported as valid, but it is not.
|
|
11784
|
+
Gmail only normalizes single dots, removing them from here is pointless,
|
|
11785
|
+
should be done in normalizeEmail
|
|
11786
|
+
*/
|
|
11787
|
+
user = user.toLowerCase();
|
|
11254
11788
|
}
|
|
11255
11789
|
|
|
11256
11790
|
if (!(0, _isByteLength2.default)(user, { max: 64 }) || !(0, _isByteLength2.default)(domain, { max: 254 })) {
|
|
@@ -11278,7 +11812,7 @@ function isEmail(str, options) {
|
|
|
11278
11812
|
return true;
|
|
11279
11813
|
}
|
|
11280
11814
|
module.exports = exports['default'];
|
|
11281
|
-
},{"./isByteLength":52,"./isFQDN":60,"./util/assertString":
|
|
11815
|
+
},{"./isByteLength":52,"./isFQDN":60,"./util/assertString":108,"./util/merge":109}],59:[function(require,module,exports){
|
|
11282
11816
|
'use strict';
|
|
11283
11817
|
|
|
11284
11818
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11297,13 +11831,13 @@ function isEmpty(str) {
|
|
|
11297
11831
|
return str.length === 0;
|
|
11298
11832
|
}
|
|
11299
11833
|
module.exports = exports['default'];
|
|
11300
|
-
},{"./util/assertString":
|
|
11834
|
+
},{"./util/assertString":108}],60:[function(require,module,exports){
|
|
11301
11835
|
'use strict';
|
|
11302
11836
|
|
|
11303
11837
|
Object.defineProperty(exports, "__esModule", {
|
|
11304
11838
|
value: true
|
|
11305
11839
|
});
|
|
11306
|
-
exports.default =
|
|
11840
|
+
exports.default = isFQDN;
|
|
11307
11841
|
|
|
11308
11842
|
var _assertString = require('./util/assertString');
|
|
11309
11843
|
|
|
@@ -11321,7 +11855,7 @@ var default_fqdn_options = {
|
|
|
11321
11855
|
allow_trailing_dot: false
|
|
11322
11856
|
};
|
|
11323
11857
|
|
|
11324
|
-
function
|
|
11858
|
+
function isFQDN(str, options) {
|
|
11325
11859
|
(0, _assertString2.default)(str);
|
|
11326
11860
|
options = (0, _merge2.default)(options, default_fqdn_options);
|
|
11327
11861
|
|
|
@@ -11330,6 +11864,11 @@ function isFDQN(str, options) {
|
|
|
11330
11864
|
str = str.substring(0, str.length - 1);
|
|
11331
11865
|
}
|
|
11332
11866
|
var parts = str.split('.');
|
|
11867
|
+
for (var i = 0; i < parts.length; i++) {
|
|
11868
|
+
if (parts[i].length > 63) {
|
|
11869
|
+
return false;
|
|
11870
|
+
}
|
|
11871
|
+
}
|
|
11333
11872
|
if (options.require_tld) {
|
|
11334
11873
|
var tld = parts.pop();
|
|
11335
11874
|
if (!parts.length || !/^([a-z\u00a1-\uffff]{2,}|xn[a-z0-9-]{2,})$/i.test(tld)) {
|
|
@@ -11340,8 +11879,8 @@ function isFDQN(str, options) {
|
|
|
11340
11879
|
return false;
|
|
11341
11880
|
}
|
|
11342
11881
|
}
|
|
11343
|
-
for (var part,
|
|
11344
|
-
part = parts[
|
|
11882
|
+
for (var part, _i = 0; _i < parts.length; _i++) {
|
|
11883
|
+
part = parts[_i];
|
|
11345
11884
|
if (options.allow_underscores) {
|
|
11346
11885
|
part = part.replace(/_/g, '');
|
|
11347
11886
|
}
|
|
@@ -11359,7 +11898,7 @@ function isFDQN(str, options) {
|
|
|
11359
11898
|
return true;
|
|
11360
11899
|
}
|
|
11361
11900
|
module.exports = exports['default'];
|
|
11362
|
-
},{"./util/assertString":
|
|
11901
|
+
},{"./util/assertString":108,"./util/merge":109}],61:[function(require,module,exports){
|
|
11363
11902
|
'use strict';
|
|
11364
11903
|
|
|
11365
11904
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11371,20 +11910,22 @@ var _assertString = require('./util/assertString');
|
|
|
11371
11910
|
|
|
11372
11911
|
var _assertString2 = _interopRequireDefault(_assertString);
|
|
11373
11912
|
|
|
11374
|
-
|
|
11913
|
+
var _alpha = require('./alpha');
|
|
11375
11914
|
|
|
11376
|
-
|
|
11915
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11377
11916
|
|
|
11378
11917
|
function isFloat(str, options) {
|
|
11379
11918
|
(0, _assertString2.default)(str);
|
|
11380
11919
|
options = options || {};
|
|
11381
|
-
|
|
11920
|
+
var float = new RegExp('^(?:[-+])?(?:[0-9]+)?(?:\\' + (options.locale ? _alpha.decimal[options.locale] : '.') + '[0-9]*)?(?:[eE][\\+\\-]?(?:[0-9]+))?$');
|
|
11921
|
+
if (str === '' || str === '.' || str === '-' || str === '+') {
|
|
11382
11922
|
return false;
|
|
11383
11923
|
}
|
|
11384
|
-
|
|
11924
|
+
var value = parseFloat(str.replace(',', '.'));
|
|
11925
|
+
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);
|
|
11385
11926
|
}
|
|
11386
11927
|
module.exports = exports['default'];
|
|
11387
|
-
},{"./util/assertString":
|
|
11928
|
+
},{"./alpha":40,"./util/assertString":108}],62:[function(require,module,exports){
|
|
11388
11929
|
'use strict';
|
|
11389
11930
|
|
|
11390
11931
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11405,7 +11946,7 @@ function isFullWidth(str) {
|
|
|
11405
11946
|
(0, _assertString2.default)(str);
|
|
11406
11947
|
return fullWidth.test(str);
|
|
11407
11948
|
}
|
|
11408
|
-
},{"./util/assertString":
|
|
11949
|
+
},{"./util/assertString":108}],63:[function(require,module,exports){
|
|
11409
11950
|
'use strict';
|
|
11410
11951
|
|
|
11411
11952
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11426,7 +11967,7 @@ function isHalfWidth(str) {
|
|
|
11426
11967
|
(0, _assertString2.default)(str);
|
|
11427
11968
|
return halfWidth.test(str);
|
|
11428
11969
|
}
|
|
11429
|
-
},{"./util/assertString":
|
|
11970
|
+
},{"./util/assertString":108}],64:[function(require,module,exports){
|
|
11430
11971
|
'use strict';
|
|
11431
11972
|
|
|
11432
11973
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11462,7 +12003,7 @@ function isHash(str, algorithm) {
|
|
|
11462
12003
|
return hash.test(str);
|
|
11463
12004
|
}
|
|
11464
12005
|
module.exports = exports['default'];
|
|
11465
|
-
},{"./util/assertString":
|
|
12006
|
+
},{"./util/assertString":108}],65:[function(require,module,exports){
|
|
11466
12007
|
'use strict';
|
|
11467
12008
|
|
|
11468
12009
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11483,7 +12024,7 @@ function isHexColor(str) {
|
|
|
11483
12024
|
return hexcolor.test(str);
|
|
11484
12025
|
}
|
|
11485
12026
|
module.exports = exports['default'];
|
|
11486
|
-
},{"./util/assertString":
|
|
12027
|
+
},{"./util/assertString":108}],66:[function(require,module,exports){
|
|
11487
12028
|
'use strict';
|
|
11488
12029
|
|
|
11489
12030
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11504,7 +12045,7 @@ function isHexadecimal(str) {
|
|
|
11504
12045
|
return hexadecimal.test(str);
|
|
11505
12046
|
}
|
|
11506
12047
|
module.exports = exports['default'];
|
|
11507
|
-
},{"./util/assertString":
|
|
12048
|
+
},{"./util/assertString":108}],67:[function(require,module,exports){
|
|
11508
12049
|
'use strict';
|
|
11509
12050
|
|
|
11510
12051
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11586,7 +12127,7 @@ function isIP(str) {
|
|
|
11586
12127
|
return false;
|
|
11587
12128
|
}
|
|
11588
12129
|
module.exports = exports['default'];
|
|
11589
|
-
},{"./util/assertString":
|
|
12130
|
+
},{"./util/assertString":108}],68:[function(require,module,exports){
|
|
11590
12131
|
'use strict';
|
|
11591
12132
|
|
|
11592
12133
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11644,7 +12185,7 @@ function isISBN(str) {
|
|
|
11644
12185
|
return false;
|
|
11645
12186
|
}
|
|
11646
12187
|
module.exports = exports['default'];
|
|
11647
|
-
},{"./util/assertString":
|
|
12188
|
+
},{"./util/assertString":108}],69:[function(require,module,exports){
|
|
11648
12189
|
'use strict';
|
|
11649
12190
|
|
|
11650
12191
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11693,7 +12234,51 @@ function isISIN(str) {
|
|
|
11693
12234
|
return parseInt(str.substr(str.length - 1), 10) === (10000 - sum) % 10;
|
|
11694
12235
|
}
|
|
11695
12236
|
module.exports = exports['default'];
|
|
11696
|
-
},{"./util/assertString":
|
|
12237
|
+
},{"./util/assertString":108}],70:[function(require,module,exports){
|
|
12238
|
+
'use strict';
|
|
12239
|
+
|
|
12240
|
+
Object.defineProperty(exports, "__esModule", {
|
|
12241
|
+
value: true
|
|
12242
|
+
});
|
|
12243
|
+
exports.default = isISO31661Alpha2;
|
|
12244
|
+
|
|
12245
|
+
var _assertString = require('./util/assertString');
|
|
12246
|
+
|
|
12247
|
+
var _assertString2 = _interopRequireDefault(_assertString);
|
|
12248
|
+
|
|
12249
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12250
|
+
|
|
12251
|
+
// from https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
|
|
12252
|
+
var validISO31661Alpha2CountriesCodes = ['AD', 'AE', 'AF', 'AG', 'AI', 'AL', 'AM', 'AO', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AW', 'AX', 'AZ', 'BA', 'BB', 'BD', 'BE', 'BF', 'BG', 'BH', 'BI', 'BJ', 'BL', 'BM', 'BN', 'BO', 'BQ', 'BR', 'BS', 'BT', 'BV', 'BW', 'BY', 'BZ', 'CA', 'CC', 'CD', 'CF', 'CG', 'CH', 'CI', 'CK', 'CL', 'CM', 'CN', 'CO', 'CR', 'CU', 'CV', 'CW', 'CX', 'CY', 'CZ', 'DE', 'DJ', 'DK', 'DM', 'DO', 'DZ', 'EC', 'EE', 'EG', 'EH', 'ER', 'ES', 'ET', 'FI', 'FJ', 'FK', 'FM', 'FO', 'FR', 'GA', 'GB', 'GD', 'GE', 'GF', 'GG', 'GH', 'GI', 'GL', 'GM', 'GN', 'GP', 'GQ', 'GR', 'GS', 'GT', 'GU', 'GW', 'GY', 'HK', 'HM', 'HN', 'HR', 'HT', 'HU', 'ID', 'IE', 'IL', 'IM', 'IN', 'IO', 'IQ', 'IR', 'IS', 'IT', 'JE', 'JM', 'JO', 'JP', 'KE', 'KG', 'KH', 'KI', 'KM', 'KN', 'KP', 'KR', 'KW', 'KY', 'KZ', 'LA', 'LB', 'LC', 'LI', 'LK', 'LR', 'LS', 'LT', 'LU', 'LV', 'LY', 'MA', 'MC', 'MD', 'ME', 'MF', 'MG', 'MH', 'MK', 'ML', 'MM', 'MN', 'MO', 'MP', 'MQ', 'MR', 'MS', 'MT', 'MU', 'MV', 'MW', 'MX', 'MY', 'MZ', 'NA', 'NC', 'NE', 'NF', 'NG', 'NI', 'NL', 'NO', 'NP', 'NR', 'NU', 'NZ', 'OM', 'PA', 'PE', 'PF', 'PG', 'PH', 'PK', 'PL', 'PM', 'PN', 'PR', 'PS', 'PT', 'PW', 'PY', 'QA', 'RE', 'RO', 'RS', 'RU', 'RW', 'SA', 'SB', 'SC', 'SD', 'SE', 'SG', 'SH', 'SI', 'SJ', 'SK', 'SL', 'SM', 'SN', 'SO', 'SR', 'SS', 'ST', 'SV', 'SX', 'SY', 'SZ', 'TC', 'TD', 'TF', 'TG', 'TH', 'TJ', 'TK', 'TL', 'TM', 'TN', 'TO', 'TR', 'TT', 'TV', 'TW', 'TZ', 'UA', 'UG', 'UM', 'US', 'UY', 'UZ', 'VA', 'VC', 'VE', 'VG', 'VI', 'VN', 'VU', 'WF', 'WS', 'YE', 'YT', 'ZA', 'ZM', 'ZW'];
|
|
12253
|
+
|
|
12254
|
+
function isISO31661Alpha2(str) {
|
|
12255
|
+
(0, _assertString2.default)(str);
|
|
12256
|
+
return validISO31661Alpha2CountriesCodes.includes(str.toUpperCase());
|
|
12257
|
+
}
|
|
12258
|
+
module.exports = exports['default'];
|
|
12259
|
+
},{"./util/assertString":108}],71:[function(require,module,exports){
|
|
12260
|
+
'use strict';
|
|
12261
|
+
|
|
12262
|
+
Object.defineProperty(exports, "__esModule", {
|
|
12263
|
+
value: true
|
|
12264
|
+
});
|
|
12265
|
+
exports.default = isISO31661Alpha3;
|
|
12266
|
+
|
|
12267
|
+
var _assertString = require('./util/assertString');
|
|
12268
|
+
|
|
12269
|
+
var _assertString2 = _interopRequireDefault(_assertString);
|
|
12270
|
+
|
|
12271
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12272
|
+
|
|
12273
|
+
// from https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3
|
|
12274
|
+
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'];
|
|
12275
|
+
|
|
12276
|
+
function isISO31661Alpha3(str) {
|
|
12277
|
+
(0, _assertString2.default)(str);
|
|
12278
|
+
return validISO31661Alpha3CountriesCodes.includes(str.toUpperCase());
|
|
12279
|
+
}
|
|
12280
|
+
module.exports = exports['default'];
|
|
12281
|
+
},{"./util/assertString":108}],72:[function(require,module,exports){
|
|
11697
12282
|
'use strict';
|
|
11698
12283
|
|
|
11699
12284
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11717,7 +12302,7 @@ function isISO8601(str) {
|
|
|
11717
12302
|
return iso8601.test(str);
|
|
11718
12303
|
}
|
|
11719
12304
|
module.exports = exports['default'];
|
|
11720
|
-
},{"./util/assertString":
|
|
12305
|
+
},{"./util/assertString":108}],73:[function(require,module,exports){
|
|
11721
12306
|
'use strict';
|
|
11722
12307
|
|
|
11723
12308
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11739,7 +12324,7 @@ function isISRC(str) {
|
|
|
11739
12324
|
return isrc.test(str);
|
|
11740
12325
|
}
|
|
11741
12326
|
module.exports = exports['default'];
|
|
11742
|
-
},{"./util/assertString":
|
|
12327
|
+
},{"./util/assertString":108}],74:[function(require,module,exports){
|
|
11743
12328
|
'use strict';
|
|
11744
12329
|
|
|
11745
12330
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11798,7 +12383,7 @@ function isISSN(str) {
|
|
|
11798
12383
|
return checksum % 11 === 0;
|
|
11799
12384
|
}
|
|
11800
12385
|
module.exports = exports['default'];
|
|
11801
|
-
},{"./util/assertString":
|
|
12386
|
+
},{"./util/assertString":108}],75:[function(require,module,exports){
|
|
11802
12387
|
'use strict';
|
|
11803
12388
|
|
|
11804
12389
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11838,7 +12423,7 @@ function isIn(str, options) {
|
|
|
11838
12423
|
return false;
|
|
11839
12424
|
}
|
|
11840
12425
|
module.exports = exports['default'];
|
|
11841
|
-
},{"./util/assertString":
|
|
12426
|
+
},{"./util/assertString":108,"./util/toString":110}],76:[function(require,module,exports){
|
|
11842
12427
|
'use strict';
|
|
11843
12428
|
|
|
11844
12429
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11872,7 +12457,7 @@ function isInt(str, options) {
|
|
|
11872
12457
|
return regex.test(str) && minCheckPassed && maxCheckPassed && ltCheckPassed && gtCheckPassed;
|
|
11873
12458
|
}
|
|
11874
12459
|
module.exports = exports['default'];
|
|
11875
|
-
},{"./util/assertString":
|
|
12460
|
+
},{"./util/assertString":108}],77:[function(require,module,exports){
|
|
11876
12461
|
'use strict';
|
|
11877
12462
|
|
|
11878
12463
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11898,7 +12483,7 @@ function isJSON(str) {
|
|
|
11898
12483
|
return false;
|
|
11899
12484
|
}
|
|
11900
12485
|
module.exports = exports['default'];
|
|
11901
|
-
},{"./util/assertString":
|
|
12486
|
+
},{"./util/assertString":108}],78:[function(require,module,exports){
|
|
11902
12487
|
'use strict';
|
|
11903
12488
|
|
|
11904
12489
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11922,7 +12507,7 @@ var lat = /^\(?[+-]?(90(\.0+)?|[1-8]?\d(\.\d+)?)$/;
|
|
|
11922
12507
|
var long = /^\s?[+-]?(180(\.0+)?|1[0-7]\d(\.\d+)?|\d{1,2}(\.\d+)?)\)?$/;
|
|
11923
12508
|
|
|
11924
12509
|
module.exports = exports['default'];
|
|
11925
|
-
},{"./util/assertString":
|
|
12510
|
+
},{"./util/assertString":108}],79:[function(require,module,exports){
|
|
11926
12511
|
'use strict';
|
|
11927
12512
|
|
|
11928
12513
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11957,7 +12542,7 @@ function isLength(str, options) {
|
|
|
11957
12542
|
return len >= min && (typeof max === 'undefined' || len <= max);
|
|
11958
12543
|
}
|
|
11959
12544
|
module.exports = exports['default'];
|
|
11960
|
-
},{"./util/assertString":
|
|
12545
|
+
},{"./util/assertString":108}],80:[function(require,module,exports){
|
|
11961
12546
|
'use strict';
|
|
11962
12547
|
|
|
11963
12548
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11976,7 +12561,7 @@ function isLowercase(str) {
|
|
|
11976
12561
|
return str === str.toLowerCase();
|
|
11977
12562
|
}
|
|
11978
12563
|
module.exports = exports['default'];
|
|
11979
|
-
},{"./util/assertString":
|
|
12564
|
+
},{"./util/assertString":108}],81:[function(require,module,exports){
|
|
11980
12565
|
'use strict';
|
|
11981
12566
|
|
|
11982
12567
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -11997,7 +12582,7 @@ function isMACAddress(str) {
|
|
|
11997
12582
|
return macAddress.test(str);
|
|
11998
12583
|
}
|
|
11999
12584
|
module.exports = exports['default'];
|
|
12000
|
-
},{"./util/assertString":
|
|
12585
|
+
},{"./util/assertString":108}],82:[function(require,module,exports){
|
|
12001
12586
|
'use strict';
|
|
12002
12587
|
|
|
12003
12588
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12018,7 +12603,60 @@ function isMD5(str) {
|
|
|
12018
12603
|
return md5.test(str);
|
|
12019
12604
|
}
|
|
12020
12605
|
module.exports = exports['default'];
|
|
12021
|
-
},{"./util/assertString":
|
|
12606
|
+
},{"./util/assertString":108}],83:[function(require,module,exports){
|
|
12607
|
+
'use strict';
|
|
12608
|
+
|
|
12609
|
+
Object.defineProperty(exports, "__esModule", {
|
|
12610
|
+
value: true
|
|
12611
|
+
});
|
|
12612
|
+
exports.default = isMimeType;
|
|
12613
|
+
|
|
12614
|
+
var _assertString = require('./util/assertString');
|
|
12615
|
+
|
|
12616
|
+
var _assertString2 = _interopRequireDefault(_assertString);
|
|
12617
|
+
|
|
12618
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12619
|
+
|
|
12620
|
+
/*
|
|
12621
|
+
Checks if the provided string matches to a correct Media type format (MIME type)
|
|
12622
|
+
|
|
12623
|
+
This function only checks is the string format follows the
|
|
12624
|
+
etablished rules by the according RFC specifications.
|
|
12625
|
+
This function supports 'charset' in textual media types
|
|
12626
|
+
(https://tools.ietf.org/html/rfc6657).
|
|
12627
|
+
|
|
12628
|
+
This function does not check against all the media types listed
|
|
12629
|
+
by the IANA (https://www.iana.org/assignments/media-types/media-types.xhtml)
|
|
12630
|
+
because of lightness purposes : it would require to include
|
|
12631
|
+
all these MIME types in this librairy, which would weigh it
|
|
12632
|
+
significantly. This kind of effort maybe is not worth for the use that
|
|
12633
|
+
this function has in this entire librairy.
|
|
12634
|
+
|
|
12635
|
+
More informations in the RFC specifications :
|
|
12636
|
+
- https://tools.ietf.org/html/rfc2045
|
|
12637
|
+
- https://tools.ietf.org/html/rfc2046
|
|
12638
|
+
- https://tools.ietf.org/html/rfc7231#section-3.1.1.1
|
|
12639
|
+
- https://tools.ietf.org/html/rfc7231#section-3.1.1.5
|
|
12640
|
+
*/
|
|
12641
|
+
|
|
12642
|
+
// Match simple MIME types
|
|
12643
|
+
// NB :
|
|
12644
|
+
// Subtype length must not exceed 100 characters.
|
|
12645
|
+
// This rule does not comply to the RFC specs (what is the max length ?).
|
|
12646
|
+
var mimeTypeSimple = /^(application|audio|font|image|message|model|multipart|text|video)\/[a-zA-Z0-9\.\-\+]{1,100}$/i; // eslint-disable-line max-len
|
|
12647
|
+
|
|
12648
|
+
// Handle "charset" in "text/*"
|
|
12649
|
+
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
|
|
12650
|
+
|
|
12651
|
+
// Handle "boundary" in "multipart/*"
|
|
12652
|
+
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
|
|
12653
|
+
|
|
12654
|
+
function isMimeType(str) {
|
|
12655
|
+
(0, _assertString2.default)(str);
|
|
12656
|
+
return mimeTypeSimple.test(str) || mimeTypeText.test(str) || mimeTypeMultipart.test(str);
|
|
12657
|
+
}
|
|
12658
|
+
module.exports = exports['default'];
|
|
12659
|
+
},{"./util/assertString":108}],84:[function(require,module,exports){
|
|
12022
12660
|
'use strict';
|
|
12023
12661
|
|
|
12024
12662
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12038,37 +12676,44 @@ var phones = {
|
|
|
12038
12676
|
'ar-DZ': /^(\+?213|0)(5|6|7)\d{8}$/,
|
|
12039
12677
|
'ar-EG': /^((\+?20)|0)?1[012]\d{8}$/,
|
|
12040
12678
|
'ar-JO': /^(\+?962|0)?7[789]\d{7}$/,
|
|
12041
|
-
'ar-SY': /^(!?(\+?963)|0)?9\d{8}$/,
|
|
12042
12679
|
'ar-SA': /^(!?(\+?966)|0)?5\d{8}$/,
|
|
12043
|
-
'
|
|
12680
|
+
'ar-SY': /^(!?(\+?963)|0)?9\d{8}$/,
|
|
12681
|
+
'be-BY': /^(\+?375)?(24|25|29|33|44)\d{7}$/,
|
|
12682
|
+
'bg-BG': /^(\+?359|0)?8[789]\d{7}$/,
|
|
12044
12683
|
'cs-CZ': /^(\+?420)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,
|
|
12045
|
-
'
|
|
12684
|
+
'da-DK': /^(\+?45)?\s?\d{2}\s?\d{2}\s?\d{2}\s?\d{2}$/,
|
|
12046
12685
|
'de-DE': /^(\+?49[ \.\-])?([\(]{1}[0-9]{1,6}[\)])?([0-9 \.\-\/]{3,20})((x|ext|extension)[ ]?[0-9]{1,4})?$/,
|
|
12047
|
-
'
|
|
12048
|
-
'el-GR': /^(\+?30)?(69\d{8})$/,
|
|
12686
|
+
'el-GR': /^(\+?30|0)?(69\d{8})$/,
|
|
12049
12687
|
'en-AU': /^(\+?61|0)4\d{8}$/,
|
|
12050
12688
|
'en-GB': /^(\+?44|0)7\d{9}$/,
|
|
12051
|
-
'en-HK': /^(\+?852\-?)?[
|
|
12052
|
-
'en-IN': /^(\+?91|0)?[
|
|
12689
|
+
'en-HK': /^(\+?852\-?)?[456789]\d{3}\-?\d{4}$/,
|
|
12690
|
+
'en-IN': /^(\+?91|0)?[6789]\d{9}$/,
|
|
12053
12691
|
'en-KE': /^(\+?254|0)?[7]\d{8}$/,
|
|
12054
12692
|
'en-NG': /^(\+?234|0)?[789]\d{9}$/,
|
|
12055
12693
|
'en-NZ': /^(\+?64|0)2\d{7,9}$/,
|
|
12056
|
-
'en-
|
|
12694
|
+
'en-PK': /^((\+92)|(0092))-{0,1}\d{3}-{0,1}\d{7}$|^\d{11}$|^\d{4}-\d{7}$/,
|
|
12057
12695
|
'en-RW': /^(\+?250|0)?[7]\d{8}$/,
|
|
12696
|
+
'en-SG': /^(\+65)?[89]\d{7}$/,
|
|
12058
12697
|
'en-TZ': /^(\+?255|0)?[67]\d{8}$/,
|
|
12698
|
+
'en-UG': /^(\+?256|0)?[7]\d{8}$/,
|
|
12699
|
+
'en-US': /^(\+?1)?[2-9]\d{2}[2-9](?!11)\d{6}$/,
|
|
12059
12700
|
'en-ZA': /^(\+?27|0)\d{9}$/,
|
|
12060
12701
|
'en-ZM': /^(\+?26)?09[567]\d{7}$/,
|
|
12061
12702
|
'es-ES': /^(\+?34)?(6\d{1}|7[1234])\d{7}$/,
|
|
12062
|
-
'
|
|
12703
|
+
'et-EE': /^(\+?372)?\s?(5|8[1-4])\s?([0-9]\s?){6,7}$/,
|
|
12063
12704
|
'fa-IR': /^(\+?98[\-\s]?|0)9[0-39]\d[\-\s]?\d{3}[\-\s]?\d{4}$/,
|
|
12705
|
+
'fi-FI': /^(\+?358|0)\s?(4(0|1|2|4|5|6)?|50)\s?(\d\s?){4,8}\d$/,
|
|
12706
|
+
'fo-FO': /^(\+?298)?\s?\d{2}\s?\d{2}\s?\d{2}$/,
|
|
12064
12707
|
'fr-FR': /^(\+?33|0)[67]\d{8}$/,
|
|
12065
|
-
'he-IL': /^(\+972|0)([23489]|5[
|
|
12708
|
+
'he-IL': /^(\+972|0)([23489]|5[012345689]|77)[1-9]\d{6}/,
|
|
12066
12709
|
'hu-HU': /^(\+?36)(20|30|70)\d{7}$/,
|
|
12067
|
-
'lt-LT': /^(\+370|8)\d{8}$/,
|
|
12068
12710
|
'id-ID': /^(\+?62|0[1-9])[\s|\d]+$/,
|
|
12069
12711
|
'it-IT': /^(\+?39)?\s?3\d{2} ?\d{6,7}$/,
|
|
12712
|
+
'ja-JP': /^(\+?81|0)[789]0[ \-]?[1-9]\d{2}[ \-]?\d{5}$/,
|
|
12713
|
+
'kk-KZ': /^(\+?7|8)?7\d{9}$/,
|
|
12714
|
+
'kl-GL': /^(\+?299)?\s?\d{2}\s?\d{2}\s?\d{2}$/,
|
|
12070
12715
|
'ko-KR': /^((\+?82)[ \-]?)?0?1([0|1|6|7|8|9]{1})[ \-]?\d{3,4}[ \-]?\d{4}$/,
|
|
12071
|
-
'
|
|
12716
|
+
'lt-LT': /^(\+370|8)\d{8}$/,
|
|
12072
12717
|
'ms-MY': /^(\+?6?01){1}(([145]{1}(\-|\s)?\d{7,8})|([236789]{1}(\s|\-)?\d{7}))$/,
|
|
12073
12718
|
'nb-NO': /^(\+?47)?[49]\d{7}$/,
|
|
12074
12719
|
'nl-BE': /^(\+?32|0)4?\d{8}$/,
|
|
@@ -12077,12 +12722,14 @@ var phones = {
|
|
|
12077
12722
|
'pt-BR': /^(\+?55|0)\-?[1-9]{2}\-?[2-9]{1}\d{3,4}\-?\d{4}$/,
|
|
12078
12723
|
'pt-PT': /^(\+?351)?9[1236]\d{7}$/,
|
|
12079
12724
|
'ro-RO': /^(\+?4?0)\s?7\d{2}(\/|\s|\.|\-)?\d{3}(\s|\.|\-)?\d{3}$/,
|
|
12080
|
-
'en-PK': /^((\+92)|(0092))-{0,1}\d{3}-{0,1}\d{7}$|^\d{11}$|^\d{4}-\d{7}$/,
|
|
12081
12725
|
'ru-RU': /^(\+?7|8)?9\d{9}$/,
|
|
12726
|
+
'sk-SK': /^(\+?421)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,
|
|
12082
12727
|
'sr-RS': /^(\+3816|06)[- \d]{5,9}$/,
|
|
12728
|
+
'th-TH': /^(\+66|66|0)\d{9}$/,
|
|
12083
12729
|
'tr-TR': /^(\+?90|0)?5\d{9}$/,
|
|
12730
|
+
'uk-UA': /^(\+?38|8)?0\d{9}$/,
|
|
12084
12731
|
'vi-VN': /^(\+?84|0)?((1(2([0-9])|6([2-9])|88|99))|(9((?!5)[0-9])))([0-9]{7})$/,
|
|
12085
|
-
'zh-CN': /^(\+?0?86\-?)?1[
|
|
12732
|
+
'zh-CN': /^(\+?0?86\-?)?1[3456789]\d{9}$/,
|
|
12086
12733
|
'zh-TW': /^(\+?886\-?|0)?9\d{8}$/
|
|
12087
12734
|
};
|
|
12088
12735
|
/* eslint-enable max-len */
|
|
@@ -12092,8 +12739,11 @@ phones['en-CA'] = phones['en-US'];
|
|
|
12092
12739
|
phones['fr-BE'] = phones['nl-BE'];
|
|
12093
12740
|
phones['zh-HK'] = phones['en-HK'];
|
|
12094
12741
|
|
|
12095
|
-
function isMobilePhone(str, locale) {
|
|
12742
|
+
function isMobilePhone(str, locale, options) {
|
|
12096
12743
|
(0, _assertString2.default)(str);
|
|
12744
|
+
if (options && options.strictMode && !str.startsWith('+')) {
|
|
12745
|
+
return false;
|
|
12746
|
+
}
|
|
12097
12747
|
if (locale in phones) {
|
|
12098
12748
|
return phones[locale].test(str);
|
|
12099
12749
|
} else if (locale === 'any') {
|
|
@@ -12110,7 +12760,7 @@ function isMobilePhone(str, locale) {
|
|
|
12110
12760
|
throw new Error('Invalid locale \'' + locale + '\'');
|
|
12111
12761
|
}
|
|
12112
12762
|
module.exports = exports['default'];
|
|
12113
|
-
},{"./util/assertString":
|
|
12763
|
+
},{"./util/assertString":108}],85:[function(require,module,exports){
|
|
12114
12764
|
'use strict';
|
|
12115
12765
|
|
|
12116
12766
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12133,7 +12783,7 @@ function isMongoId(str) {
|
|
|
12133
12783
|
return (0, _isHexadecimal2.default)(str) && str.length === 24;
|
|
12134
12784
|
}
|
|
12135
12785
|
module.exports = exports['default'];
|
|
12136
|
-
},{"./isHexadecimal":66,"./util/assertString":
|
|
12786
|
+
},{"./isHexadecimal":66,"./util/assertString":108}],86:[function(require,module,exports){
|
|
12137
12787
|
'use strict';
|
|
12138
12788
|
|
|
12139
12789
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12156,7 +12806,7 @@ function isMultibyte(str) {
|
|
|
12156
12806
|
return multibyte.test(str);
|
|
12157
12807
|
}
|
|
12158
12808
|
module.exports = exports['default'];
|
|
12159
|
-
},{"./util/assertString":
|
|
12809
|
+
},{"./util/assertString":108}],87:[function(require,module,exports){
|
|
12160
12810
|
'use strict';
|
|
12161
12811
|
|
|
12162
12812
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12170,14 +12820,32 @@ var _assertString2 = _interopRequireDefault(_assertString);
|
|
|
12170
12820
|
|
|
12171
12821
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12172
12822
|
|
|
12173
|
-
var numeric = /^[
|
|
12823
|
+
var numeric = /^[+-]?([0-9]*[.])?[0-9]+$/;
|
|
12174
12824
|
|
|
12175
12825
|
function isNumeric(str) {
|
|
12176
12826
|
(0, _assertString2.default)(str);
|
|
12177
12827
|
return numeric.test(str);
|
|
12178
12828
|
}
|
|
12179
12829
|
module.exports = exports['default'];
|
|
12180
|
-
},{"./util/assertString":
|
|
12830
|
+
},{"./util/assertString":108}],88:[function(require,module,exports){
|
|
12831
|
+
'use strict';
|
|
12832
|
+
|
|
12833
|
+
Object.defineProperty(exports, "__esModule", {
|
|
12834
|
+
value: true
|
|
12835
|
+
});
|
|
12836
|
+
exports.default = isPort;
|
|
12837
|
+
|
|
12838
|
+
var _isInt = require('./isInt');
|
|
12839
|
+
|
|
12840
|
+
var _isInt2 = _interopRequireDefault(_isInt);
|
|
12841
|
+
|
|
12842
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12843
|
+
|
|
12844
|
+
function isPort(str) {
|
|
12845
|
+
return (0, _isInt2.default)(str, { min: 0, max: 65535 });
|
|
12846
|
+
}
|
|
12847
|
+
module.exports = exports['default'];
|
|
12848
|
+
},{"./isInt":76}],89:[function(require,module,exports){
|
|
12181
12849
|
'use strict';
|
|
12182
12850
|
|
|
12183
12851
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12217,8 +12885,9 @@ var sixDigit = /^\d{6}$/;
|
|
|
12217
12885
|
|
|
12218
12886
|
var patterns = {
|
|
12219
12887
|
AT: fourDigit,
|
|
12220
|
-
AU:
|
|
12888
|
+
AU: fourDigit,
|
|
12221
12889
|
BE: fourDigit,
|
|
12890
|
+
BG: fourDigit,
|
|
12222
12891
|
CA: /^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJ-NPRSTV-Z][\s\-]?\d[ABCEGHJ-NPRSTV-Z]\d$/i,
|
|
12223
12892
|
CH: fourDigit,
|
|
12224
12893
|
CZ: /^\d{3}\s?\d{2}$/,
|
|
@@ -12241,19 +12910,60 @@ var patterns = {
|
|
|
12241
12910
|
NL: /^\d{4}\s?[a-z]{2}$/i,
|
|
12242
12911
|
NO: fourDigit,
|
|
12243
12912
|
PL: /^\d{2}\-\d{3}$/,
|
|
12244
|
-
PT: /^\d{4}
|
|
12913
|
+
PT: /^\d{4}\-\d{3}?$/,
|
|
12245
12914
|
RO: sixDigit,
|
|
12246
12915
|
RU: sixDigit,
|
|
12247
12916
|
SA: fiveDigit,
|
|
12248
12917
|
SE: /^\d{3}\s?\d{2}$/,
|
|
12918
|
+
SK: /^\d{3}\s?\d{2}$/,
|
|
12249
12919
|
TW: /^\d{3}(\d{2})?$/,
|
|
12250
12920
|
US: /^\d{5}(-\d{4})?$/,
|
|
12251
12921
|
ZA: fourDigit,
|
|
12252
12922
|
ZM: fiveDigit
|
|
12253
12923
|
};
|
|
12254
12924
|
|
|
12255
|
-
var locales = exports.locales = Object.keys(patterns);
|
|
12256
|
-
},{"./util/assertString":
|
|
12925
|
+
var locales = exports.locales = Object.keys(patterns);
|
|
12926
|
+
},{"./util/assertString":108}],90:[function(require,module,exports){
|
|
12927
|
+
'use strict';
|
|
12928
|
+
|
|
12929
|
+
Object.defineProperty(exports, "__esModule", {
|
|
12930
|
+
value: true
|
|
12931
|
+
});
|
|
12932
|
+
exports.default = isRFC3339;
|
|
12933
|
+
|
|
12934
|
+
var _assertString = require('./util/assertString');
|
|
12935
|
+
|
|
12936
|
+
var _assertString2 = _interopRequireDefault(_assertString);
|
|
12937
|
+
|
|
12938
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12939
|
+
|
|
12940
|
+
/* Based on https://tools.ietf.org/html/rfc3339#section-5.6 */
|
|
12941
|
+
|
|
12942
|
+
var dateFullYear = /[0-9]{4}/;
|
|
12943
|
+
var dateMonth = /(0[1-9]|1[0-2])/;
|
|
12944
|
+
var dateMDay = /([12]\d|0[1-9]|3[01])/;
|
|
12945
|
+
|
|
12946
|
+
var timeHour = /([01][0-9]|2[0-3])/;
|
|
12947
|
+
var timeMinute = /[0-5][0-9]/;
|
|
12948
|
+
var timeSecond = /([0-5][0-9]|60)/;
|
|
12949
|
+
|
|
12950
|
+
var timeSecFrac = /(\.[0-9]+)?/;
|
|
12951
|
+
var timeNumOffset = new RegExp('[-+]' + timeHour.source + ':' + timeMinute.source);
|
|
12952
|
+
var timeOffset = new RegExp('([zZ]|' + timeNumOffset.source + ')');
|
|
12953
|
+
|
|
12954
|
+
var partialTime = new RegExp(timeHour.source + ':' + timeMinute.source + ':' + timeSecond.source + timeSecFrac.source);
|
|
12955
|
+
|
|
12956
|
+
var fullDate = new RegExp(dateFullYear.source + '-' + dateMonth.source + '-' + dateMDay.source);
|
|
12957
|
+
var fullTime = new RegExp('' + partialTime.source + timeOffset.source);
|
|
12958
|
+
|
|
12959
|
+
var rfc3339 = new RegExp(fullDate.source + '[ tT]' + fullTime.source);
|
|
12960
|
+
|
|
12961
|
+
function isRFC3339(str) {
|
|
12962
|
+
(0, _assertString2.default)(str);
|
|
12963
|
+
return rfc3339.test(str);
|
|
12964
|
+
}
|
|
12965
|
+
module.exports = exports['default'];
|
|
12966
|
+
},{"./util/assertString":108}],91:[function(require,module,exports){
|
|
12257
12967
|
'use strict';
|
|
12258
12968
|
|
|
12259
12969
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12274,7 +12984,7 @@ function isSurrogatePair(str) {
|
|
|
12274
12984
|
return surrogatePair.test(str);
|
|
12275
12985
|
}
|
|
12276
12986
|
module.exports = exports['default'];
|
|
12277
|
-
},{"./util/assertString":
|
|
12987
|
+
},{"./util/assertString":108}],92:[function(require,module,exports){
|
|
12278
12988
|
'use strict';
|
|
12279
12989
|
|
|
12280
12990
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12422,7 +13132,7 @@ function isURL(url, options) {
|
|
|
12422
13132
|
return true;
|
|
12423
13133
|
}
|
|
12424
13134
|
module.exports = exports['default'];
|
|
12425
|
-
},{"./isFQDN":60,"./isIP":67,"./util/assertString":
|
|
13135
|
+
},{"./isFQDN":60,"./isIP":67,"./util/assertString":108,"./util/merge":109}],93:[function(require,module,exports){
|
|
12426
13136
|
'use strict';
|
|
12427
13137
|
|
|
12428
13138
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12451,7 +13161,7 @@ function isUUID(str) {
|
|
|
12451
13161
|
return pattern && pattern.test(str);
|
|
12452
13162
|
}
|
|
12453
13163
|
module.exports = exports['default'];
|
|
12454
|
-
},{"./util/assertString":
|
|
13164
|
+
},{"./util/assertString":108}],94:[function(require,module,exports){
|
|
12455
13165
|
'use strict';
|
|
12456
13166
|
|
|
12457
13167
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12470,7 +13180,7 @@ function isUppercase(str) {
|
|
|
12470
13180
|
return str === str.toUpperCase();
|
|
12471
13181
|
}
|
|
12472
13182
|
module.exports = exports['default'];
|
|
12473
|
-
},{"./util/assertString":
|
|
13183
|
+
},{"./util/assertString":108}],95:[function(require,module,exports){
|
|
12474
13184
|
'use strict';
|
|
12475
13185
|
|
|
12476
13186
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12493,7 +13203,7 @@ function isVariableWidth(str) {
|
|
|
12493
13203
|
return _isFullWidth.fullWidth.test(str) && _isHalfWidth.halfWidth.test(str);
|
|
12494
13204
|
}
|
|
12495
13205
|
module.exports = exports['default'];
|
|
12496
|
-
},{"./isFullWidth":62,"./isHalfWidth":63,"./util/assertString":
|
|
13206
|
+
},{"./isFullWidth":62,"./isHalfWidth":63,"./util/assertString":108}],96:[function(require,module,exports){
|
|
12497
13207
|
'use strict';
|
|
12498
13208
|
|
|
12499
13209
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12517,7 +13227,7 @@ function isWhitelisted(str, chars) {
|
|
|
12517
13227
|
return true;
|
|
12518
13228
|
}
|
|
12519
13229
|
module.exports = exports['default'];
|
|
12520
|
-
},{"./util/assertString":
|
|
13230
|
+
},{"./util/assertString":108}],97:[function(require,module,exports){
|
|
12521
13231
|
'use strict';
|
|
12522
13232
|
|
|
12523
13233
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12537,7 +13247,7 @@ function ltrim(str, chars) {
|
|
|
12537
13247
|
return str.replace(pattern, '');
|
|
12538
13248
|
}
|
|
12539
13249
|
module.exports = exports['default'];
|
|
12540
|
-
},{"./util/assertString":
|
|
13250
|
+
},{"./util/assertString":108}],98:[function(require,module,exports){
|
|
12541
13251
|
'use strict';
|
|
12542
13252
|
|
|
12543
13253
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12559,7 +13269,7 @@ function matches(str, pattern, modifiers) {
|
|
|
12559
13269
|
return pattern.test(str);
|
|
12560
13270
|
}
|
|
12561
13271
|
module.exports = exports['default'];
|
|
12562
|
-
},{"./util/assertString":
|
|
13272
|
+
},{"./util/assertString":108}],99:[function(require,module,exports){
|
|
12563
13273
|
'use strict';
|
|
12564
13274
|
|
|
12565
13275
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12567,10 +13277,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
12567
13277
|
});
|
|
12568
13278
|
exports.default = normalizeEmail;
|
|
12569
13279
|
|
|
12570
|
-
var _isEmail = require('./isEmail');
|
|
12571
|
-
|
|
12572
|
-
var _isEmail2 = _interopRequireDefault(_isEmail);
|
|
12573
|
-
|
|
12574
13280
|
var _merge = require('./util/merge');
|
|
12575
13281
|
|
|
12576
13282
|
var _merge2 = _interopRequireDefault(_merge);
|
|
@@ -12606,6 +13312,10 @@ var default_normalize_email_options = {
|
|
|
12606
13312
|
// Removes the subaddress (e.g. "-foo") from the email address
|
|
12607
13313
|
yahoo_remove_subaddress: true,
|
|
12608
13314
|
|
|
13315
|
+
// The following conversions are specific to Yandex
|
|
13316
|
+
// Lowercases the local part of the Yandex address (known to be case-insensitive)
|
|
13317
|
+
yandex_lowercase: true,
|
|
13318
|
+
|
|
12609
13319
|
// The following conversions are specific to iCloud
|
|
12610
13320
|
// Lowercases the local part of the iCloud address (known to be case-insensitive)
|
|
12611
13321
|
icloud_lowercase: true,
|
|
@@ -12626,12 +13336,19 @@ var outlookdotcom_domains = ['hotmail.at', 'hotmail.be', 'hotmail.ca', 'hotmail.
|
|
|
12626
13336
|
// This list is likely incomplete
|
|
12627
13337
|
var yahoo_domains = ['rocketmail.com', 'yahoo.ca', 'yahoo.co.uk', 'yahoo.com', 'yahoo.de', 'yahoo.fr', 'yahoo.in', 'yahoo.it', 'ymail.com'];
|
|
12628
13338
|
|
|
12629
|
-
|
|
12630
|
-
|
|
13339
|
+
// List of domains used by yandex.ru
|
|
13340
|
+
var yandex_domains = ['yandex.ru', 'yandex.ua', 'yandex.kz', 'yandex.com', 'yandex.by', 'ya.ru'];
|
|
12631
13341
|
|
|
12632
|
-
|
|
12633
|
-
|
|
13342
|
+
// replace single dots, but not multiple consecutive dots
|
|
13343
|
+
function dotsReplacer(match) {
|
|
13344
|
+
if (match.length > 1) {
|
|
13345
|
+
return match;
|
|
12634
13346
|
}
|
|
13347
|
+
return '';
|
|
13348
|
+
}
|
|
13349
|
+
|
|
13350
|
+
function normalizeEmail(email, options) {
|
|
13351
|
+
options = (0, _merge2.default)(options, default_normalize_email_options);
|
|
12635
13352
|
|
|
12636
13353
|
var raw_parts = email.split('@');
|
|
12637
13354
|
var domain = raw_parts.pop();
|
|
@@ -12647,7 +13364,8 @@ function normalizeEmail(email, options) {
|
|
|
12647
13364
|
parts[0] = parts[0].split('+')[0];
|
|
12648
13365
|
}
|
|
12649
13366
|
if (options.gmail_remove_dots) {
|
|
12650
|
-
|
|
13367
|
+
// this does not replace consecutive dots like example..email@gmail.com
|
|
13368
|
+
parts[0] = parts[0].replace(/\.+/g, dotsReplacer);
|
|
12651
13369
|
}
|
|
12652
13370
|
if (!parts[0].length) {
|
|
12653
13371
|
return false;
|
|
@@ -12690,6 +13408,11 @@ function normalizeEmail(email, options) {
|
|
|
12690
13408
|
if (options.all_lowercase || options.yahoo_lowercase) {
|
|
12691
13409
|
parts[0] = parts[0].toLowerCase();
|
|
12692
13410
|
}
|
|
13411
|
+
} else if (~yandex_domains.indexOf(parts[1])) {
|
|
13412
|
+
if (options.all_lowercase || options.yandex_lowercase) {
|
|
13413
|
+
parts[0] = parts[0].toLowerCase();
|
|
13414
|
+
}
|
|
13415
|
+
parts[1] = 'yandex.ru'; // all yandex domains are equal, 1st preffered
|
|
12693
13416
|
} else if (options.all_lowercase) {
|
|
12694
13417
|
// Any other address
|
|
12695
13418
|
parts[0] = parts[0].toLowerCase();
|
|
@@ -12697,7 +13420,7 @@ function normalizeEmail(email, options) {
|
|
|
12697
13420
|
return parts.join('@');
|
|
12698
13421
|
}
|
|
12699
13422
|
module.exports = exports['default'];
|
|
12700
|
-
},{"./
|
|
13423
|
+
},{"./util/merge":109}],100:[function(require,module,exports){
|
|
12701
13424
|
'use strict';
|
|
12702
13425
|
|
|
12703
13426
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12723,7 +13446,7 @@ function rtrim(str, chars) {
|
|
|
12723
13446
|
return idx < str.length ? str.substr(0, idx + 1) : str;
|
|
12724
13447
|
}
|
|
12725
13448
|
module.exports = exports['default'];
|
|
12726
|
-
},{"./util/assertString":
|
|
13449
|
+
},{"./util/assertString":108}],101:[function(require,module,exports){
|
|
12727
13450
|
'use strict';
|
|
12728
13451
|
|
|
12729
13452
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12747,7 +13470,7 @@ function stripLow(str, keep_new_lines) {
|
|
|
12747
13470
|
return (0, _blacklist2.default)(str, chars);
|
|
12748
13471
|
}
|
|
12749
13472
|
module.exports = exports['default'];
|
|
12750
|
-
},{"./blacklist":41,"./util/assertString":
|
|
13473
|
+
},{"./blacklist":41,"./util/assertString":108}],102:[function(require,module,exports){
|
|
12751
13474
|
'use strict';
|
|
12752
13475
|
|
|
12753
13476
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12769,7 +13492,7 @@ function toBoolean(str, strict) {
|
|
|
12769
13492
|
return str !== '0' && str !== 'false' && str !== '';
|
|
12770
13493
|
}
|
|
12771
13494
|
module.exports = exports['default'];
|
|
12772
|
-
},{"./util/assertString":
|
|
13495
|
+
},{"./util/assertString":108}],103:[function(require,module,exports){
|
|
12773
13496
|
'use strict';
|
|
12774
13497
|
|
|
12775
13498
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12789,7 +13512,7 @@ function toDate(date) {
|
|
|
12789
13512
|
return !isNaN(date) ? new Date(date) : null;
|
|
12790
13513
|
}
|
|
12791
13514
|
module.exports = exports['default'];
|
|
12792
|
-
},{"./util/assertString":
|
|
13515
|
+
},{"./util/assertString":108}],104:[function(require,module,exports){
|
|
12793
13516
|
'use strict';
|
|
12794
13517
|
|
|
12795
13518
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12808,7 +13531,7 @@ function toFloat(str) {
|
|
|
12808
13531
|
return parseFloat(str);
|
|
12809
13532
|
}
|
|
12810
13533
|
module.exports = exports['default'];
|
|
12811
|
-
},{"./util/assertString":
|
|
13534
|
+
},{"./util/assertString":108}],105:[function(require,module,exports){
|
|
12812
13535
|
'use strict';
|
|
12813
13536
|
|
|
12814
13537
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12827,7 +13550,7 @@ function toInt(str, radix) {
|
|
|
12827
13550
|
return parseInt(str, radix || 10);
|
|
12828
13551
|
}
|
|
12829
13552
|
module.exports = exports['default'];
|
|
12830
|
-
},{"./util/assertString":
|
|
13553
|
+
},{"./util/assertString":108}],106:[function(require,module,exports){
|
|
12831
13554
|
'use strict';
|
|
12832
13555
|
|
|
12833
13556
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12849,7 +13572,7 @@ function trim(str, chars) {
|
|
|
12849
13572
|
return (0, _rtrim2.default)((0, _ltrim2.default)(str, chars), chars);
|
|
12850
13573
|
}
|
|
12851
13574
|
module.exports = exports['default'];
|
|
12852
|
-
},{"./ltrim":
|
|
13575
|
+
},{"./ltrim":97,"./rtrim":100}],107:[function(require,module,exports){
|
|
12853
13576
|
'use strict';
|
|
12854
13577
|
|
|
12855
13578
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12868,7 +13591,7 @@ function unescape(str) {
|
|
|
12868
13591
|
return str.replace(/&/g, '&').replace(/"/g, '"').replace(/'/g, "'").replace(/</g, '<').replace(/>/g, '>').replace(///g, '/').replace(/\/g, '\\').replace(/`/g, '`');
|
|
12869
13592
|
}
|
|
12870
13593
|
module.exports = exports['default'];
|
|
12871
|
-
},{"./util/assertString":
|
|
13594
|
+
},{"./util/assertString":108}],108:[function(require,module,exports){
|
|
12872
13595
|
'use strict';
|
|
12873
13596
|
|
|
12874
13597
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12883,7 +13606,7 @@ function assertString(input) {
|
|
|
12883
13606
|
}
|
|
12884
13607
|
}
|
|
12885
13608
|
module.exports = exports['default'];
|
|
12886
|
-
},{}],
|
|
13609
|
+
},{}],109:[function(require,module,exports){
|
|
12887
13610
|
'use strict';
|
|
12888
13611
|
|
|
12889
13612
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12902,7 +13625,7 @@ function merge() {
|
|
|
12902
13625
|
return obj;
|
|
12903
13626
|
}
|
|
12904
13627
|
module.exports = exports['default'];
|
|
12905
|
-
},{}],
|
|
13628
|
+
},{}],110:[function(require,module,exports){
|
|
12906
13629
|
'use strict';
|
|
12907
13630
|
|
|
12908
13631
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12925,7 +13648,7 @@ function toString(input) {
|
|
|
12925
13648
|
return String(input);
|
|
12926
13649
|
}
|
|
12927
13650
|
module.exports = exports['default'];
|
|
12928
|
-
},{}],
|
|
13651
|
+
},{}],111:[function(require,module,exports){
|
|
12929
13652
|
'use strict';
|
|
12930
13653
|
|
|
12931
13654
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12944,7 +13667,7 @@ function whitelist(str, chars) {
|
|
|
12944
13667
|
return str.replace(new RegExp('[^' + chars + ']+', 'g'), '');
|
|
12945
13668
|
}
|
|
12946
13669
|
module.exports = exports['default'];
|
|
12947
|
-
},{"./util/assertString":
|
|
13670
|
+
},{"./util/assertString":108}],112:[function(require,module,exports){
|
|
12948
13671
|
module.exports = extend
|
|
12949
13672
|
|
|
12950
13673
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
@@ -12965,7 +13688,7 @@ function extend() {
|
|
|
12965
13688
|
return target
|
|
12966
13689
|
}
|
|
12967
13690
|
|
|
12968
|
-
},{}],
|
|
13691
|
+
},{}],113:[function(require,module,exports){
|
|
12969
13692
|
"use strict";
|
|
12970
13693
|
|
|
12971
13694
|
module.exports = {
|
|
@@ -12973,6 +13696,7 @@ module.exports = {
|
|
|
12973
13696
|
INVALID_TYPE: "Expected type {0} but found type {1}",
|
|
12974
13697
|
INVALID_FORMAT: "Object didn't pass validation for format {0}: {1}",
|
|
12975
13698
|
ENUM_MISMATCH: "No enum match for: {0}",
|
|
13699
|
+
ENUM_CASE_MISMATCH: "Enum does not match case for: {0}",
|
|
12976
13700
|
ANY_OF_MISSING: "Data does not match any schemas from 'anyOf'",
|
|
12977
13701
|
ONE_OF_MISSING: "Data does not match any schemas from 'oneOf'",
|
|
12978
13702
|
ONE_OF_MULTIPLE: "Data is valid against more than one schema from 'oneOf'",
|
|
@@ -13026,7 +13750,7 @@ module.exports = {
|
|
|
13026
13750
|
|
|
13027
13751
|
};
|
|
13028
13752
|
|
|
13029
|
-
},{}],
|
|
13753
|
+
},{}],114:[function(require,module,exports){
|
|
13030
13754
|
/*jshint maxlen: false*/
|
|
13031
13755
|
|
|
13032
13756
|
var validator = require("validator");
|
|
@@ -13157,7 +13881,7 @@ var FormatValidators = {
|
|
|
13157
13881
|
|
|
13158
13882
|
module.exports = FormatValidators;
|
|
13159
13883
|
|
|
13160
|
-
},{"validator":39}],
|
|
13884
|
+
},{"validator":39}],115:[function(require,module,exports){
|
|
13161
13885
|
"use strict";
|
|
13162
13886
|
|
|
13163
13887
|
var FormatValidators = require("./FormatValidators"),
|
|
@@ -13406,15 +14130,20 @@ var JsonValidators = {
|
|
|
13406
14130
|
enum: function (report, schema, json) {
|
|
13407
14131
|
// http://json-schema.org/latest/json-schema-validation.html#rfc.section.5.5.1.2
|
|
13408
14132
|
var match = false,
|
|
14133
|
+
caseInsensitiveMatch = false,
|
|
13409
14134
|
idx = schema.enum.length;
|
|
13410
14135
|
while (idx--) {
|
|
13411
14136
|
if (Utils.areEqual(json, schema.enum[idx])) {
|
|
13412
14137
|
match = true;
|
|
13413
14138
|
break;
|
|
14139
|
+
} else if (Utils.areEqual(json, schema.enum[idx]), { caseInsensitiveComparison: true }) {
|
|
14140
|
+
caseInsensitiveMatch = true;
|
|
13414
14141
|
}
|
|
13415
14142
|
}
|
|
14143
|
+
|
|
13416
14144
|
if (match === false) {
|
|
13417
|
-
|
|
14145
|
+
var error = caseInsensitiveMatch && this.options.enumCaseInsensitiveComparison ? "ENUM_CASE_MISMATCH" : "ENUM_MISMATCH";
|
|
14146
|
+
report.addError(error, [json], null, schema.description);
|
|
13418
14147
|
}
|
|
13419
14148
|
},
|
|
13420
14149
|
/*
|
|
@@ -13700,7 +14429,7 @@ exports.validate = function (report, schema, json) {
|
|
|
13700
14429
|
|
|
13701
14430
|
};
|
|
13702
14431
|
|
|
13703
|
-
},{"./FormatValidators":
|
|
14432
|
+
},{"./FormatValidators":114,"./Report":117,"./Utils":121}],116:[function(require,module,exports){
|
|
13704
14433
|
// Number.isFinite polyfill
|
|
13705
14434
|
// http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isfinite
|
|
13706
14435
|
if (typeof Number.isFinite !== "function") {
|
|
@@ -13718,7 +14447,7 @@ if (typeof Number.isFinite !== "function") {
|
|
|
13718
14447
|
};
|
|
13719
14448
|
}
|
|
13720
14449
|
|
|
13721
|
-
},{}],
|
|
14450
|
+
},{}],117:[function(require,module,exports){
|
|
13722
14451
|
(function (process){
|
|
13723
14452
|
"use strict";
|
|
13724
14453
|
|
|
@@ -13779,7 +14508,8 @@ Report.prototype.processAsyncTasks = function (timeout, callback) {
|
|
|
13779
14508
|
};
|
|
13780
14509
|
}
|
|
13781
14510
|
|
|
13782
|
-
if
|
|
14511
|
+
// finish if tasks are completed or there are any errors and breaking on first error was requested
|
|
14512
|
+
if (tasksCount === 0 || (this.errors.length > 0 && this.options.breakOnFirstError)) {
|
|
13783
14513
|
finish();
|
|
13784
14514
|
return;
|
|
13785
14515
|
}
|
|
@@ -13924,7 +14654,7 @@ Report.prototype.addCustomError = function (errorCode, errorMessage, params, sub
|
|
|
13924
14654
|
module.exports = Report;
|
|
13925
14655
|
|
|
13926
14656
|
}).call(this,require('_process'))
|
|
13927
|
-
},{"./Errors":
|
|
14657
|
+
},{"./Errors":113,"./Utils":121,"_process":15,"lodash.get":12}],118:[function(require,module,exports){
|
|
13928
14658
|
"use strict";
|
|
13929
14659
|
|
|
13930
14660
|
var isequal = require("lodash.isequal");
|
|
@@ -14048,7 +14778,15 @@ exports.getSchemaByUri = function (report, uri, root) {
|
|
|
14048
14778
|
|
|
14049
14779
|
var remoteReport = new Report(report);
|
|
14050
14780
|
if (SchemaCompilation.compileSchema.call(this, remoteReport, result)) {
|
|
14051
|
-
|
|
14781
|
+
var savedOptions = this.options;
|
|
14782
|
+
try {
|
|
14783
|
+
// If custom validationOptions were provided to setRemoteReference(),
|
|
14784
|
+
// use them instead of the default options
|
|
14785
|
+
this.options = result.__$validationOptions || this.options;
|
|
14786
|
+
SchemaValidation.validateSchema.call(this, remoteReport, result);
|
|
14787
|
+
} finally {
|
|
14788
|
+
this.options = savedOptions;
|
|
14789
|
+
}
|
|
14052
14790
|
}
|
|
14053
14791
|
var remoteReportIsValid = remoteReport.isValid();
|
|
14054
14792
|
if (!remoteReportIsValid) {
|
|
@@ -14080,7 +14818,7 @@ exports.getSchemaByUri = function (report, uri, root) {
|
|
|
14080
14818
|
|
|
14081
14819
|
exports.getRemotePath = getRemotePath;
|
|
14082
14820
|
|
|
14083
|
-
},{"./Report":
|
|
14821
|
+
},{"./Report":117,"./SchemaCompilation":119,"./SchemaValidation":120,"./Utils":121,"lodash.isequal":13}],119:[function(require,module,exports){
|
|
14084
14822
|
"use strict";
|
|
14085
14823
|
|
|
14086
14824
|
var Report = require("./Report");
|
|
@@ -14381,7 +15119,7 @@ exports.compileSchema = function (report, schema) {
|
|
|
14381
15119
|
|
|
14382
15120
|
};
|
|
14383
15121
|
|
|
14384
|
-
},{"./Report":
|
|
15122
|
+
},{"./Report":117,"./SchemaCache":118,"./Utils":121}],120:[function(require,module,exports){
|
|
14385
15123
|
"use strict";
|
|
14386
15124
|
|
|
14387
15125
|
var FormatValidators = require("./FormatValidators"),
|
|
@@ -14990,7 +15728,7 @@ exports.validateSchema = function (report, schema) {
|
|
|
14990
15728
|
return isValid;
|
|
14991
15729
|
};
|
|
14992
15730
|
|
|
14993
|
-
},{"./FormatValidators":
|
|
15731
|
+
},{"./FormatValidators":114,"./JsonValidation":115,"./Report":117,"./Utils":121}],121:[function(require,module,exports){
|
|
14994
15732
|
"use strict";
|
|
14995
15733
|
|
|
14996
15734
|
exports.isAbsoluteUri = function (uri) {
|
|
@@ -15034,7 +15772,11 @@ exports.whatIs = function (what) {
|
|
|
15034
15772
|
|
|
15035
15773
|
};
|
|
15036
15774
|
|
|
15037
|
-
exports.areEqual = function areEqual(json1, json2) {
|
|
15775
|
+
exports.areEqual = function areEqual(json1, json2, options) {
|
|
15776
|
+
|
|
15777
|
+
options = options || {};
|
|
15778
|
+
var caseInsensitiveComparison = options.caseInsensitiveComparison || false;
|
|
15779
|
+
|
|
15038
15780
|
// http://json-schema.org/latest/json-schema-core.html#rfc.section.3.6
|
|
15039
15781
|
|
|
15040
15782
|
// Two JSON values are said to be equal if and only if:
|
|
@@ -15045,6 +15787,12 @@ exports.areEqual = function areEqual(json1, json2) {
|
|
|
15045
15787
|
if (json1 === json2) {
|
|
15046
15788
|
return true;
|
|
15047
15789
|
}
|
|
15790
|
+
if (
|
|
15791
|
+
caseInsensitiveComparison === true &&
|
|
15792
|
+
typeof json1 === "string" && typeof json2 === "string" &&
|
|
15793
|
+
json1.toUpperCase() === json2.toUpperCase()) {
|
|
15794
|
+
return true;
|
|
15795
|
+
}
|
|
15048
15796
|
|
|
15049
15797
|
var i, len;
|
|
15050
15798
|
|
|
@@ -15057,7 +15805,7 @@ exports.areEqual = function areEqual(json1, json2) {
|
|
|
15057
15805
|
// items at the same index are equal according to this definition; or
|
|
15058
15806
|
len = json1.length;
|
|
15059
15807
|
for (i = 0; i < len; i++) {
|
|
15060
|
-
if (!areEqual(json1[i], json2[i])) {
|
|
15808
|
+
if (!areEqual(json1[i], json2[i], { caseInsensitiveComparison: caseInsensitiveComparison })) {
|
|
15061
15809
|
return false;
|
|
15062
15810
|
}
|
|
15063
15811
|
}
|
|
@@ -15069,13 +15817,13 @@ exports.areEqual = function areEqual(json1, json2) {
|
|
|
15069
15817
|
// have the same set of property names; and
|
|
15070
15818
|
var keys1 = Object.keys(json1);
|
|
15071
15819
|
var keys2 = Object.keys(json2);
|
|
15072
|
-
if (!areEqual(keys1, keys2)) {
|
|
15820
|
+
if (!areEqual(keys1, keys2, { caseInsensitiveComparison: caseInsensitiveComparison })) {
|
|
15073
15821
|
return false;
|
|
15074
15822
|
}
|
|
15075
15823
|
// values for a same property name are equal according to this definition.
|
|
15076
15824
|
len = keys1.length;
|
|
15077
15825
|
for (i = 0; i < len; i++) {
|
|
15078
|
-
if (!areEqual(json1[keys1[i]], json2[keys1[i]])) {
|
|
15826
|
+
if (!areEqual(json1[keys1[i]], json2[keys1[i]], { caseInsensitiveComparison: caseInsensitiveComparison })) {
|
|
15079
15827
|
return false;
|
|
15080
15828
|
}
|
|
15081
15829
|
}
|
|
@@ -15209,7 +15957,7 @@ exports.ucs2decode = function (string) {
|
|
|
15209
15957
|
};
|
|
15210
15958
|
/*jshint +W016*/
|
|
15211
15959
|
|
|
15212
|
-
},{}],
|
|
15960
|
+
},{}],122:[function(require,module,exports){
|
|
15213
15961
|
(function (process){
|
|
15214
15962
|
"use strict";
|
|
15215
15963
|
|
|
@@ -15235,6 +15983,8 @@ var defaultOptions = {
|
|
|
15235
15983
|
forceAdditional: false,
|
|
15236
15984
|
// assume additionalProperties and additionalItems are defined as "false" where appropriate
|
|
15237
15985
|
assumeAdditional: false,
|
|
15986
|
+
// do case insensitive comparison for enums
|
|
15987
|
+
enumCaseInsensitiveComparison: false,
|
|
15238
15988
|
// force items to be defined on "array" types
|
|
15239
15989
|
forceItems: false,
|
|
15240
15990
|
// force minItems to be defined on "array" types
|
|
@@ -15273,15 +16023,8 @@ var defaultOptions = {
|
|
|
15273
16023
|
customValidator: null
|
|
15274
16024
|
};
|
|
15275
16025
|
|
|
15276
|
-
|
|
15277
|
-
|
|
15278
|
-
*/
|
|
15279
|
-
function ZSchema(options) {
|
|
15280
|
-
this.cache = {};
|
|
15281
|
-
this.referenceCache = [];
|
|
15282
|
-
|
|
15283
|
-
this.setRemoteReference("http://json-schema.org/draft-04/schema", Draft4Schema);
|
|
15284
|
-
this.setRemoteReference("http://json-schema.org/draft-04/hyper-schema", Draft4HyperSchema);
|
|
16026
|
+
function normalizeOptions(options) {
|
|
16027
|
+
var normalized;
|
|
15285
16028
|
|
|
15286
16029
|
// options
|
|
15287
16030
|
if (typeof options === "object") {
|
|
@@ -15307,22 +16050,40 @@ function ZSchema(options) {
|
|
|
15307
16050
|
}
|
|
15308
16051
|
}
|
|
15309
16052
|
|
|
15310
|
-
|
|
16053
|
+
normalized = options;
|
|
15311
16054
|
} else {
|
|
15312
|
-
|
|
16055
|
+
normalized = Utils.clone(defaultOptions);
|
|
15313
16056
|
}
|
|
15314
16057
|
|
|
15315
|
-
if (
|
|
15316
|
-
|
|
15317
|
-
|
|
15318
|
-
|
|
15319
|
-
|
|
15320
|
-
|
|
15321
|
-
|
|
15322
|
-
|
|
15323
|
-
|
|
16058
|
+
if (normalized.strictMode === true) {
|
|
16059
|
+
normalized.forceAdditional = true;
|
|
16060
|
+
normalized.forceItems = true;
|
|
16061
|
+
normalized.forceMaxLength = true;
|
|
16062
|
+
normalized.forceProperties = true;
|
|
16063
|
+
normalized.noExtraKeywords = true;
|
|
16064
|
+
normalized.noTypeless = true;
|
|
16065
|
+
normalized.noEmptyStrings = true;
|
|
16066
|
+
normalized.noEmptyArrays = true;
|
|
15324
16067
|
}
|
|
15325
16068
|
|
|
16069
|
+
return normalized;
|
|
16070
|
+
}
|
|
16071
|
+
|
|
16072
|
+
/*
|
|
16073
|
+
constructor
|
|
16074
|
+
*/
|
|
16075
|
+
function ZSchema(options) {
|
|
16076
|
+
this.cache = {};
|
|
16077
|
+
this.referenceCache = [];
|
|
16078
|
+
this.validateOptions = {};
|
|
16079
|
+
|
|
16080
|
+
this.options = normalizeOptions(options);
|
|
16081
|
+
|
|
16082
|
+
// Disable strict validation for the built-in schemas
|
|
16083
|
+
var metaschemaOptions = normalizeOptions({ });
|
|
16084
|
+
|
|
16085
|
+
this.setRemoteReference("http://json-schema.org/draft-04/schema", Draft4Schema, metaschemaOptions);
|
|
16086
|
+
this.setRemoteReference("http://json-schema.org/draft-04/hyper-schema", Draft4HyperSchema, metaschemaOptions);
|
|
15326
16087
|
}
|
|
15327
16088
|
|
|
15328
16089
|
/*
|
|
@@ -15361,6 +16122,8 @@ ZSchema.prototype.validate = function (json, schema, options, callback) {
|
|
|
15361
16122
|
}
|
|
15362
16123
|
if (!options) { options = {}; }
|
|
15363
16124
|
|
|
16125
|
+
this.validateOptions = options;
|
|
16126
|
+
|
|
15364
16127
|
var whatIs = Utils.whatIs(schema);
|
|
15365
16128
|
if (whatIs !== "string" && whatIs !== "object") {
|
|
15366
16129
|
var e = new Error("Invalid .validate call - schema must be an string or object but " + whatIs + " was passed!");
|
|
@@ -15470,12 +16233,17 @@ ZSchema.prototype.getMissingRemoteReferences = function () {
|
|
|
15470
16233
|
}
|
|
15471
16234
|
return missingRemoteReferences;
|
|
15472
16235
|
};
|
|
15473
|
-
ZSchema.prototype.setRemoteReference = function (uri, schema) {
|
|
16236
|
+
ZSchema.prototype.setRemoteReference = function (uri, schema, validationOptions) {
|
|
15474
16237
|
if (typeof schema === "string") {
|
|
15475
16238
|
schema = JSON.parse(schema);
|
|
15476
16239
|
} else {
|
|
15477
16240
|
schema = Utils.cloneDeep(schema);
|
|
15478
16241
|
}
|
|
16242
|
+
|
|
16243
|
+
if (validationOptions) {
|
|
16244
|
+
schema.__$validationOptions = normalizeOptions(validationOptions);
|
|
16245
|
+
}
|
|
16246
|
+
|
|
15479
16247
|
SchemaCache.cacheSchemaByUri.call(this, uri, schema);
|
|
15480
16248
|
};
|
|
15481
16249
|
ZSchema.prototype.getResolvedSchema = function (schema) {
|
|
@@ -15565,7 +16333,7 @@ ZSchema.getDefaultOptions = function () {
|
|
|
15565
16333
|
module.exports = ZSchema;
|
|
15566
16334
|
|
|
15567
16335
|
}).call(this,require('_process'))
|
|
15568
|
-
},{"./FormatValidators":
|
|
16336
|
+
},{"./FormatValidators":114,"./JsonValidation":115,"./Polyfills":116,"./Report":117,"./SchemaCache":118,"./SchemaCompilation":119,"./SchemaValidation":120,"./Utils":121,"./schemas/hyper-schema.json":123,"./schemas/schema.json":124,"_process":15,"lodash.get":12}],123:[function(require,module,exports){
|
|
15569
16337
|
module.exports={
|
|
15570
16338
|
"$schema": "http://json-schema.org/draft-04/hyper-schema#",
|
|
15571
16339
|
"id": "http://json-schema.org/draft-04/hyper-schema#",
|
|
@@ -15725,7 +16493,7 @@ module.exports={
|
|
|
15725
16493
|
}
|
|
15726
16494
|
|
|
15727
16495
|
|
|
15728
|
-
},{}],
|
|
16496
|
+
},{}],124:[function(require,module,exports){
|
|
15729
16497
|
module.exports={
|
|
15730
16498
|
"id": "http://json-schema.org/draft-04/schema#",
|
|
15731
16499
|
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
@@ -15878,7 +16646,7 @@ module.exports={
|
|
|
15878
16646
|
"default": {}
|
|
15879
16647
|
}
|
|
15880
16648
|
|
|
15881
|
-
},{}],
|
|
16649
|
+
},{}],125:[function(require,module,exports){
|
|
15882
16650
|
"use strict";
|
|
15883
16651
|
|
|
15884
16652
|
module.exports = {
|
|
@@ -15956,7 +16724,7 @@ module.exports = {
|
|
|
15956
16724
|
]
|
|
15957
16725
|
};
|
|
15958
16726
|
|
|
15959
|
-
},{}],
|
|
16727
|
+
},{}],126:[function(require,module,exports){
|
|
15960
16728
|
"use strict";
|
|
15961
16729
|
|
|
15962
16730
|
module.exports = {
|
|
@@ -16021,7 +16789,7 @@ module.exports = {
|
|
|
16021
16789
|
]
|
|
16022
16790
|
};
|
|
16023
16791
|
|
|
16024
|
-
},{}],
|
|
16792
|
+
},{}],127:[function(require,module,exports){
|
|
16025
16793
|
"use strict";
|
|
16026
16794
|
|
|
16027
16795
|
module.exports = {
|
|
@@ -16094,7 +16862,7 @@ module.exports = {
|
|
|
16094
16862
|
]
|
|
16095
16863
|
};
|
|
16096
16864
|
|
|
16097
|
-
},{}],
|
|
16865
|
+
},{}],128:[function(require,module,exports){
|
|
16098
16866
|
"use strict";
|
|
16099
16867
|
|
|
16100
16868
|
//Implement new 'shouldFail' keyword
|
|
@@ -16157,7 +16925,7 @@ module.exports = {
|
|
|
16157
16925
|
]
|
|
16158
16926
|
};
|
|
16159
16927
|
|
|
16160
|
-
},{}],
|
|
16928
|
+
},{}],129:[function(require,module,exports){
|
|
16161
16929
|
"use strict";
|
|
16162
16930
|
|
|
16163
16931
|
module.exports = {
|
|
@@ -16185,7 +16953,7 @@ module.exports = {
|
|
|
16185
16953
|
]
|
|
16186
16954
|
};
|
|
16187
16955
|
|
|
16188
|
-
},{}],
|
|
16956
|
+
},{}],130:[function(require,module,exports){
|
|
16189
16957
|
"use strict";
|
|
16190
16958
|
|
|
16191
16959
|
module.exports = {
|
|
@@ -16210,7 +16978,7 @@ module.exports = {
|
|
|
16210
16978
|
]
|
|
16211
16979
|
};
|
|
16212
16980
|
|
|
16213
|
-
},{}],
|
|
16981
|
+
},{}],131:[function(require,module,exports){
|
|
16214
16982
|
"use strict";
|
|
16215
16983
|
|
|
16216
16984
|
module.exports = {
|
|
@@ -16283,7 +17051,7 @@ module.exports = {
|
|
|
16283
17051
|
]
|
|
16284
17052
|
};
|
|
16285
17053
|
|
|
16286
|
-
},{}],
|
|
17054
|
+
},{}],132:[function(require,module,exports){
|
|
16287
17055
|
"use strict";
|
|
16288
17056
|
|
|
16289
17057
|
module.exports = {
|
|
@@ -16311,7 +17079,7 @@ module.exports = {
|
|
|
16311
17079
|
]
|
|
16312
17080
|
};
|
|
16313
17081
|
|
|
16314
|
-
},{}],
|
|
17082
|
+
},{}],133:[function(require,module,exports){
|
|
16315
17083
|
"use strict";
|
|
16316
17084
|
|
|
16317
17085
|
module.exports = {
|
|
@@ -16339,7 +17107,7 @@ module.exports = {
|
|
|
16339
17107
|
]
|
|
16340
17108
|
};
|
|
16341
17109
|
|
|
16342
|
-
},{}],
|
|
17110
|
+
},{}],134:[function(require,module,exports){
|
|
16343
17111
|
"use strict";
|
|
16344
17112
|
|
|
16345
17113
|
module.exports = {
|
|
@@ -16367,7 +17135,7 @@ module.exports = {
|
|
|
16367
17135
|
]
|
|
16368
17136
|
};
|
|
16369
17137
|
|
|
16370
|
-
},{}],
|
|
17138
|
+
},{}],135:[function(require,module,exports){
|
|
16371
17139
|
"use strict";
|
|
16372
17140
|
|
|
16373
17141
|
module.exports = {
|
|
@@ -16395,7 +17163,7 @@ module.exports = {
|
|
|
16395
17163
|
]
|
|
16396
17164
|
};
|
|
16397
17165
|
|
|
16398
|
-
},{}],
|
|
17166
|
+
},{}],136:[function(require,module,exports){
|
|
16399
17167
|
"use strict";
|
|
16400
17168
|
|
|
16401
17169
|
module.exports = {
|
|
@@ -16423,7 +17191,7 @@ module.exports = {
|
|
|
16423
17191
|
]
|
|
16424
17192
|
};
|
|
16425
17193
|
|
|
16426
|
-
},{}],
|
|
17194
|
+
},{}],137:[function(require,module,exports){
|
|
16427
17195
|
"use strict";
|
|
16428
17196
|
|
|
16429
17197
|
module.exports = {
|
|
@@ -16479,7 +17247,7 @@ module.exports = {
|
|
|
16479
17247
|
]
|
|
16480
17248
|
};
|
|
16481
17249
|
|
|
16482
|
-
},{}],
|
|
17250
|
+
},{}],138:[function(require,module,exports){
|
|
16483
17251
|
"use strict";
|
|
16484
17252
|
|
|
16485
17253
|
module.exports = {
|
|
@@ -16523,7 +17291,7 @@ module.exports = {
|
|
|
16523
17291
|
]
|
|
16524
17292
|
};
|
|
16525
17293
|
|
|
16526
|
-
},{}],
|
|
17294
|
+
},{}],139:[function(require,module,exports){
|
|
16527
17295
|
"use strict";
|
|
16528
17296
|
|
|
16529
17297
|
module.exports = {
|
|
@@ -16540,7 +17308,7 @@ module.exports = {
|
|
|
16540
17308
|
]
|
|
16541
17309
|
};
|
|
16542
17310
|
|
|
16543
|
-
},{}],
|
|
17311
|
+
},{}],140:[function(require,module,exports){
|
|
16544
17312
|
"use strict";
|
|
16545
17313
|
|
|
16546
17314
|
module.exports = {
|
|
@@ -16562,7 +17330,7 @@ module.exports = {
|
|
|
16562
17330
|
]
|
|
16563
17331
|
};
|
|
16564
17332
|
|
|
16565
|
-
},{}],
|
|
17333
|
+
},{}],141:[function(require,module,exports){
|
|
16566
17334
|
"use strict";
|
|
16567
17335
|
|
|
16568
17336
|
module.exports = {
|
|
@@ -16580,7 +17348,7 @@ module.exports = {
|
|
|
16580
17348
|
]
|
|
16581
17349
|
};
|
|
16582
17350
|
|
|
16583
|
-
},{}],
|
|
17351
|
+
},{}],142:[function(require,module,exports){
|
|
16584
17352
|
"use strict";
|
|
16585
17353
|
|
|
16586
17354
|
module.exports = {
|
|
@@ -16649,7 +17417,7 @@ module.exports = {
|
|
|
16649
17417
|
]
|
|
16650
17418
|
};
|
|
16651
17419
|
|
|
16652
|
-
},{}],
|
|
17420
|
+
},{}],143:[function(require,module,exports){
|
|
16653
17421
|
"use strict";
|
|
16654
17422
|
|
|
16655
17423
|
module.exports = {
|
|
@@ -16664,7 +17432,7 @@ module.exports = {
|
|
|
16664
17432
|
]
|
|
16665
17433
|
};
|
|
16666
17434
|
|
|
16667
|
-
},{}],
|
|
17435
|
+
},{}],144:[function(require,module,exports){
|
|
16668
17436
|
"use strict";
|
|
16669
17437
|
|
|
16670
17438
|
module.exports = {
|
|
@@ -16688,7 +17456,7 @@ module.exports = {
|
|
|
16688
17456
|
]
|
|
16689
17457
|
};
|
|
16690
17458
|
|
|
16691
|
-
},{}],
|
|
17459
|
+
},{}],145:[function(require,module,exports){
|
|
16692
17460
|
"use strict";
|
|
16693
17461
|
|
|
16694
17462
|
module.exports = {
|
|
@@ -16763,7 +17531,7 @@ module.exports = {
|
|
|
16763
17531
|
]
|
|
16764
17532
|
};
|
|
16765
17533
|
|
|
16766
|
-
},{}],
|
|
17534
|
+
},{}],146:[function(require,module,exports){
|
|
16767
17535
|
"use strict";
|
|
16768
17536
|
|
|
16769
17537
|
module.exports = {
|
|
@@ -16784,7 +17552,7 @@ module.exports = {
|
|
|
16784
17552
|
]
|
|
16785
17553
|
};
|
|
16786
17554
|
|
|
16787
|
-
},{}],
|
|
17555
|
+
},{}],147:[function(require,module,exports){
|
|
16788
17556
|
"use strict";
|
|
16789
17557
|
|
|
16790
17558
|
module.exports = {
|
|
@@ -16811,7 +17579,7 @@ module.exports = {
|
|
|
16811
17579
|
]
|
|
16812
17580
|
};
|
|
16813
17581
|
|
|
16814
|
-
},{}],
|
|
17582
|
+
},{}],148:[function(require,module,exports){
|
|
16815
17583
|
"use strict";
|
|
16816
17584
|
|
|
16817
17585
|
var REF_NAME = "int.json";
|
|
@@ -16858,7 +17626,7 @@ module.exports = {
|
|
|
16858
17626
|
]
|
|
16859
17627
|
};
|
|
16860
17628
|
|
|
16861
|
-
},{}],
|
|
17629
|
+
},{}],149:[function(require,module,exports){
|
|
16862
17630
|
"use strict";
|
|
16863
17631
|
|
|
16864
17632
|
module.exports = {
|
|
@@ -17031,7 +17799,7 @@ module.exports = {
|
|
|
17031
17799
|
]
|
|
17032
17800
|
};
|
|
17033
17801
|
|
|
17034
|
-
},{}],
|
|
17802
|
+
},{}],150:[function(require,module,exports){
|
|
17035
17803
|
"use strict";
|
|
17036
17804
|
|
|
17037
17805
|
module.exports = {
|
|
@@ -17076,7 +17844,7 @@ module.exports = {
|
|
|
17076
17844
|
]
|
|
17077
17845
|
};
|
|
17078
17846
|
|
|
17079
|
-
},{}],
|
|
17847
|
+
},{}],151:[function(require,module,exports){
|
|
17080
17848
|
"use strict";
|
|
17081
17849
|
|
|
17082
17850
|
module.exports = {
|
|
@@ -17119,7 +17887,7 @@ module.exports = {
|
|
|
17119
17887
|
]
|
|
17120
17888
|
};
|
|
17121
17889
|
|
|
17122
|
-
},{}],
|
|
17890
|
+
},{}],152:[function(require,module,exports){
|
|
17123
17891
|
"use strict";
|
|
17124
17892
|
|
|
17125
17893
|
var schema1 = {
|
|
@@ -17203,7 +17971,7 @@ module.exports = {
|
|
|
17203
17971
|
]
|
|
17204
17972
|
};
|
|
17205
17973
|
|
|
17206
|
-
},{}],
|
|
17974
|
+
},{}],153:[function(require,module,exports){
|
|
17207
17975
|
module.exports = {
|
|
17208
17976
|
description: "Issue #139 - add schema id if present to erro message via addError method",
|
|
17209
17977
|
tests: [
|
|
@@ -17262,7 +18030,7 @@ module.exports = {
|
|
|
17262
18030
|
]
|
|
17263
18031
|
};
|
|
17264
18032
|
|
|
17265
|
-
},{}],
|
|
18033
|
+
},{}],154:[function(require,module,exports){
|
|
17266
18034
|
"use strict";
|
|
17267
18035
|
|
|
17268
18036
|
module.exports = {
|
|
@@ -17280,7 +18048,7 @@ module.exports = {
|
|
|
17280
18048
|
]
|
|
17281
18049
|
};
|
|
17282
18050
|
|
|
17283
|
-
},{}],
|
|
18051
|
+
},{}],155:[function(require,module,exports){
|
|
17284
18052
|
"use strict";
|
|
17285
18053
|
|
|
17286
18054
|
module.exports = {
|
|
@@ -17310,7 +18078,7 @@ module.exports = {
|
|
|
17310
18078
|
]
|
|
17311
18079
|
};
|
|
17312
18080
|
|
|
17313
|
-
},{}],
|
|
18081
|
+
},{}],156:[function(require,module,exports){
|
|
17314
18082
|
"use strict";
|
|
17315
18083
|
|
|
17316
18084
|
module.exports = {
|
|
@@ -17338,7 +18106,7 @@ module.exports = {
|
|
|
17338
18106
|
]
|
|
17339
18107
|
};
|
|
17340
18108
|
|
|
17341
|
-
},{}],
|
|
18109
|
+
},{}],157:[function(require,module,exports){
|
|
17342
18110
|
"use strict";
|
|
17343
18111
|
|
|
17344
18112
|
module.exports = {
|
|
@@ -17365,7 +18133,7 @@ module.exports = {
|
|
|
17365
18133
|
]
|
|
17366
18134
|
};
|
|
17367
18135
|
|
|
17368
|
-
},{}],
|
|
18136
|
+
},{}],158:[function(require,module,exports){
|
|
17369
18137
|
"use strict";
|
|
17370
18138
|
|
|
17371
18139
|
module.exports = {
|
|
@@ -17441,7 +18209,7 @@ module.exports = {
|
|
|
17441
18209
|
]
|
|
17442
18210
|
};
|
|
17443
18211
|
|
|
17444
|
-
},{}],
|
|
18212
|
+
},{}],159:[function(require,module,exports){
|
|
17445
18213
|
"use strict";
|
|
17446
18214
|
|
|
17447
18215
|
module.exports = {
|
|
@@ -17477,7 +18245,7 @@ module.exports = {
|
|
|
17477
18245
|
]
|
|
17478
18246
|
};
|
|
17479
18247
|
|
|
17480
|
-
},{}],
|
|
18248
|
+
},{}],160:[function(require,module,exports){
|
|
17481
18249
|
"use strict";
|
|
17482
18250
|
|
|
17483
18251
|
module.exports = {
|
|
@@ -17567,7 +18335,7 @@ module.exports = {
|
|
|
17567
18335
|
]
|
|
17568
18336
|
};
|
|
17569
18337
|
|
|
17570
|
-
},{}],
|
|
18338
|
+
},{}],161:[function(require,module,exports){
|
|
17571
18339
|
"use strict";
|
|
17572
18340
|
|
|
17573
18341
|
module.exports = {
|
|
@@ -17592,7 +18360,7 @@ module.exports = {
|
|
|
17592
18360
|
]
|
|
17593
18361
|
};
|
|
17594
18362
|
|
|
17595
|
-
},{}],
|
|
18363
|
+
},{}],162:[function(require,module,exports){
|
|
17596
18364
|
"use strict";
|
|
17597
18365
|
|
|
17598
18366
|
module.exports = {
|
|
@@ -17668,7 +18436,7 @@ module.exports = {
|
|
|
17668
18436
|
]
|
|
17669
18437
|
};
|
|
17670
18438
|
|
|
17671
|
-
},{}],
|
|
18439
|
+
},{}],163:[function(require,module,exports){
|
|
17672
18440
|
"use strict";
|
|
17673
18441
|
|
|
17674
18442
|
module.exports = {
|
|
@@ -17781,7 +18549,7 @@ module.exports = {
|
|
|
17781
18549
|
]
|
|
17782
18550
|
};
|
|
17783
18551
|
|
|
17784
|
-
},{}],
|
|
18552
|
+
},{}],164:[function(require,module,exports){
|
|
17785
18553
|
"use strict";
|
|
17786
18554
|
|
|
17787
18555
|
module.exports = {
|
|
@@ -17961,7 +18729,7 @@ module.exports = {
|
|
|
17961
18729
|
]
|
|
17962
18730
|
};
|
|
17963
18731
|
|
|
17964
|
-
},{}],
|
|
18732
|
+
},{}],165:[function(require,module,exports){
|
|
17965
18733
|
"use strict";
|
|
17966
18734
|
|
|
17967
18735
|
module.exports = {
|
|
@@ -18008,7 +18776,7 @@ module.exports = {
|
|
|
18008
18776
|
]
|
|
18009
18777
|
};
|
|
18010
18778
|
|
|
18011
|
-
},{}],
|
|
18779
|
+
},{}],166:[function(require,module,exports){
|
|
18012
18780
|
"use strict";
|
|
18013
18781
|
|
|
18014
18782
|
var resourceObject = {
|
|
@@ -18304,7 +19072,7 @@ module.exports = {
|
|
|
18304
19072
|
]
|
|
18305
19073
|
};
|
|
18306
19074
|
|
|
18307
|
-
},{}],
|
|
19075
|
+
},{}],167:[function(require,module,exports){
|
|
18308
19076
|
"use strict";
|
|
18309
19077
|
|
|
18310
19078
|
var draft4 = require("./files/Issue47/draft4.json");
|
|
@@ -18333,7 +19101,7 @@ module.exports = {
|
|
|
18333
19101
|
]
|
|
18334
19102
|
};
|
|
18335
19103
|
|
|
18336
|
-
},{"./files/Issue47/draft4.json":
|
|
19104
|
+
},{"./files/Issue47/draft4.json":191,"./files/Issue47/sample.json":192,"./files/Issue47/swagger_draft.json":193,"./files/Issue47/swagger_draft_modified.json":194}],168:[function(require,module,exports){
|
|
18337
19105
|
"use strict";
|
|
18338
19106
|
|
|
18339
19107
|
module.exports = {
|
|
@@ -18366,7 +19134,7 @@ module.exports = {
|
|
|
18366
19134
|
]
|
|
18367
19135
|
};
|
|
18368
19136
|
|
|
18369
|
-
},{}],
|
|
19137
|
+
},{}],169:[function(require,module,exports){
|
|
18370
19138
|
"use strict";
|
|
18371
19139
|
|
|
18372
19140
|
module.exports = {
|
|
@@ -18384,7 +19152,7 @@ module.exports = {
|
|
|
18384
19152
|
]
|
|
18385
19153
|
};
|
|
18386
19154
|
|
|
18387
|
-
},{}],
|
|
19155
|
+
},{}],170:[function(require,module,exports){
|
|
18388
19156
|
"use strict";
|
|
18389
19157
|
|
|
18390
19158
|
module.exports = {
|
|
@@ -18406,7 +19174,7 @@ module.exports = {
|
|
|
18406
19174
|
]
|
|
18407
19175
|
};
|
|
18408
19176
|
|
|
18409
|
-
},{}],
|
|
19177
|
+
},{}],171:[function(require,module,exports){
|
|
18410
19178
|
"use strict";
|
|
18411
19179
|
|
|
18412
19180
|
module.exports = {
|
|
@@ -18477,7 +19245,7 @@ module.exports = {
|
|
|
18477
19245
|
]
|
|
18478
19246
|
};
|
|
18479
19247
|
|
|
18480
|
-
},{}],
|
|
19248
|
+
},{}],172:[function(require,module,exports){
|
|
18481
19249
|
"use strict";
|
|
18482
19250
|
|
|
18483
19251
|
var dataTypeBaseJson = {
|
|
@@ -19162,7 +19930,7 @@ module.exports = {
|
|
|
19162
19930
|
]
|
|
19163
19931
|
};
|
|
19164
19932
|
|
|
19165
|
-
},{}],
|
|
19933
|
+
},{}],173:[function(require,module,exports){
|
|
19166
19934
|
"use strict";
|
|
19167
19935
|
|
|
19168
19936
|
module.exports = {
|
|
@@ -19225,7 +19993,7 @@ module.exports = {
|
|
|
19225
19993
|
]
|
|
19226
19994
|
};
|
|
19227
19995
|
|
|
19228
|
-
},{}],
|
|
19996
|
+
},{}],174:[function(require,module,exports){
|
|
19229
19997
|
/*jshint -W101*/
|
|
19230
19998
|
|
|
19231
19999
|
"use strict";
|
|
@@ -19802,7 +20570,7 @@ module.exports = {
|
|
|
19802
20570
|
]
|
|
19803
20571
|
};
|
|
19804
20572
|
|
|
19805
|
-
},{}],
|
|
20573
|
+
},{}],175:[function(require,module,exports){
|
|
19806
20574
|
"use strict";
|
|
19807
20575
|
|
|
19808
20576
|
module.exports = {
|
|
@@ -19833,7 +20601,7 @@ module.exports = {
|
|
|
19833
20601
|
]
|
|
19834
20602
|
};
|
|
19835
20603
|
|
|
19836
|
-
},{}],
|
|
20604
|
+
},{}],176:[function(require,module,exports){
|
|
19837
20605
|
"use strict";
|
|
19838
20606
|
|
|
19839
20607
|
module.exports = {
|
|
@@ -19884,7 +20652,7 @@ module.exports = {
|
|
|
19884
20652
|
]
|
|
19885
20653
|
};
|
|
19886
20654
|
|
|
19887
|
-
},{}],
|
|
20655
|
+
},{}],177:[function(require,module,exports){
|
|
19888
20656
|
"use strict";
|
|
19889
20657
|
|
|
19890
20658
|
module.exports = {
|
|
@@ -20004,7 +20772,7 @@ module.exports = {
|
|
|
20004
20772
|
]
|
|
20005
20773
|
};
|
|
20006
20774
|
|
|
20007
|
-
},{}],
|
|
20775
|
+
},{}],178:[function(require,module,exports){
|
|
20008
20776
|
"use strict";
|
|
20009
20777
|
|
|
20010
20778
|
module.exports = {
|
|
@@ -20062,7 +20830,7 @@ module.exports = {
|
|
|
20062
20830
|
]
|
|
20063
20831
|
};
|
|
20064
20832
|
|
|
20065
|
-
},{}],
|
|
20833
|
+
},{}],179:[function(require,module,exports){
|
|
20066
20834
|
"use strict";
|
|
20067
20835
|
|
|
20068
20836
|
module.exports = {
|
|
@@ -20135,7 +20903,7 @@ module.exports = {
|
|
|
20135
20903
|
]
|
|
20136
20904
|
};
|
|
20137
20905
|
|
|
20138
|
-
},{}],
|
|
20906
|
+
},{}],180:[function(require,module,exports){
|
|
20139
20907
|
"use strict";
|
|
20140
20908
|
|
|
20141
20909
|
var innerSchema = {
|
|
@@ -20180,7 +20948,7 @@ module.exports = {
|
|
|
20180
20948
|
]
|
|
20181
20949
|
};
|
|
20182
20950
|
|
|
20183
|
-
},{}],
|
|
20951
|
+
},{}],181:[function(require,module,exports){
|
|
20184
20952
|
"use strict";
|
|
20185
20953
|
|
|
20186
20954
|
var schema1 = {
|
|
@@ -20224,7 +20992,7 @@ module.exports = {
|
|
|
20224
20992
|
]
|
|
20225
20993
|
};
|
|
20226
20994
|
|
|
20227
|
-
},{}],
|
|
20995
|
+
},{}],182:[function(require,module,exports){
|
|
20228
20996
|
"use strict";
|
|
20229
20997
|
|
|
20230
20998
|
module.exports = {
|
|
@@ -20242,7 +21010,7 @@ module.exports = {
|
|
|
20242
21010
|
]
|
|
20243
21011
|
};
|
|
20244
21012
|
|
|
20245
|
-
},{}],
|
|
21013
|
+
},{}],183:[function(require,module,exports){
|
|
20246
21014
|
"use strict";
|
|
20247
21015
|
|
|
20248
21016
|
module.exports = {
|
|
@@ -20274,7 +21042,7 @@ module.exports = {
|
|
|
20274
21042
|
]
|
|
20275
21043
|
};
|
|
20276
21044
|
|
|
20277
|
-
},{}],
|
|
21045
|
+
},{}],184:[function(require,module,exports){
|
|
20278
21046
|
"use strict";
|
|
20279
21047
|
|
|
20280
21048
|
module.exports = {
|
|
@@ -20333,7 +21101,7 @@ module.exports = {
|
|
|
20333
21101
|
]
|
|
20334
21102
|
};
|
|
20335
21103
|
|
|
20336
|
-
},{}],
|
|
21104
|
+
},{}],185:[function(require,module,exports){
|
|
20337
21105
|
"use strict";
|
|
20338
21106
|
|
|
20339
21107
|
module.exports = {
|
|
@@ -20358,7 +21126,7 @@ module.exports = {
|
|
|
20358
21126
|
]
|
|
20359
21127
|
};
|
|
20360
21128
|
|
|
20361
|
-
},{}],
|
|
21129
|
+
},{}],186:[function(require,module,exports){
|
|
20362
21130
|
"use strict";
|
|
20363
21131
|
|
|
20364
21132
|
module.exports = {
|
|
@@ -20383,7 +21151,7 @@ module.exports = {
|
|
|
20383
21151
|
]
|
|
20384
21152
|
};
|
|
20385
21153
|
|
|
20386
|
-
},{}],
|
|
21154
|
+
},{}],187:[function(require,module,exports){
|
|
20387
21155
|
"use strict";
|
|
20388
21156
|
|
|
20389
21157
|
module.exports = {
|
|
@@ -20428,7 +21196,7 @@ module.exports = {
|
|
|
20428
21196
|
]
|
|
20429
21197
|
};
|
|
20430
21198
|
|
|
20431
|
-
},{}],
|
|
21199
|
+
},{}],188:[function(require,module,exports){
|
|
20432
21200
|
"use strict";
|
|
20433
21201
|
|
|
20434
21202
|
module.exports = {
|
|
@@ -20453,7 +21221,7 @@ module.exports = {
|
|
|
20453
21221
|
]
|
|
20454
21222
|
};
|
|
20455
21223
|
|
|
20456
|
-
},{}],
|
|
21224
|
+
},{}],189:[function(require,module,exports){
|
|
20457
21225
|
"use strict";
|
|
20458
21226
|
|
|
20459
21227
|
module.exports = {
|
|
@@ -20492,7 +21260,7 @@ module.exports = {
|
|
|
20492
21260
|
]
|
|
20493
21261
|
};
|
|
20494
21262
|
|
|
20495
|
-
},{}],
|
|
21263
|
+
},{}],190:[function(require,module,exports){
|
|
20496
21264
|
"use strict";
|
|
20497
21265
|
|
|
20498
21266
|
module.exports = {
|
|
@@ -20522,7 +21290,7 @@ module.exports = {
|
|
|
20522
21290
|
]
|
|
20523
21291
|
};
|
|
20524
21292
|
|
|
20525
|
-
},{}],
|
|
21293
|
+
},{}],191:[function(require,module,exports){
|
|
20526
21294
|
module.exports={
|
|
20527
21295
|
"id": "http://json-schema.org/draft-04/schema#",
|
|
20528
21296
|
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
@@ -20674,7 +21442,7 @@ module.exports={
|
|
|
20674
21442
|
"default": {}
|
|
20675
21443
|
}
|
|
20676
21444
|
|
|
20677
|
-
},{}],
|
|
21445
|
+
},{}],192:[function(require,module,exports){
|
|
20678
21446
|
module.exports={
|
|
20679
21447
|
"swagger": 2,
|
|
20680
21448
|
"info": {
|
|
@@ -20765,7 +21533,7 @@ module.exports={
|
|
|
20765
21533
|
}
|
|
20766
21534
|
}
|
|
20767
21535
|
|
|
20768
|
-
},{}],
|
|
21536
|
+
},{}],193:[function(require,module,exports){
|
|
20769
21537
|
module.exports={
|
|
20770
21538
|
"title": "A JSON Schema for Swagger 2.0 API.",
|
|
20771
21539
|
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
@@ -21163,7 +21931,7 @@ module.exports={
|
|
|
21163
21931
|
}
|
|
21164
21932
|
}
|
|
21165
21933
|
|
|
21166
|
-
},{}],
|
|
21934
|
+
},{}],194:[function(require,module,exports){
|
|
21167
21935
|
module.exports={
|
|
21168
21936
|
"title": "A JSON Schema for Swagger 2.0 API.",
|
|
21169
21937
|
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
@@ -21561,7 +22329,7 @@ module.exports={
|
|
|
21561
22329
|
}
|
|
21562
22330
|
}
|
|
21563
22331
|
|
|
21564
|
-
},{}],
|
|
22332
|
+
},{}],195:[function(require,module,exports){
|
|
21565
22333
|
'use strict';
|
|
21566
22334
|
|
|
21567
22335
|
module.exports = {
|
|
@@ -21586,15 +22354,15 @@ module.exports = {
|
|
|
21586
22354
|
]
|
|
21587
22355
|
};
|
|
21588
22356
|
|
|
21589
|
-
},{}],
|
|
21590
|
-
arguments[4][
|
|
21591
|
-
},{"dup":
|
|
22357
|
+
},{}],196:[function(require,module,exports){
|
|
22358
|
+
arguments[4][191][0].apply(exports,arguments)
|
|
22359
|
+
},{"dup":191}],197:[function(require,module,exports){
|
|
21592
22360
|
module.exports={
|
|
21593
22361
|
"type": "integer"
|
|
21594
22362
|
}
|
|
21595
|
-
},{}],
|
|
21596
|
-
arguments[4][
|
|
21597
|
-
},{"dup":
|
|
22363
|
+
},{}],198:[function(require,module,exports){
|
|
22364
|
+
arguments[4][197][0].apply(exports,arguments)
|
|
22365
|
+
},{"dup":197}],199:[function(require,module,exports){
|
|
21598
22366
|
module.exports={
|
|
21599
22367
|
"integer": {
|
|
21600
22368
|
"type": "integer"
|
|
@@ -21603,7 +22371,7 @@ module.exports={
|
|
|
21603
22371
|
"$ref": "#/integer"
|
|
21604
22372
|
}
|
|
21605
22373
|
}
|
|
21606
|
-
},{}],
|
|
22374
|
+
},{}],200:[function(require,module,exports){
|
|
21607
22375
|
module.exports=[
|
|
21608
22376
|
{
|
|
21609
22377
|
"description": "additionalItems as schema",
|
|
@@ -21687,7 +22455,7 @@ module.exports=[
|
|
|
21687
22455
|
}
|
|
21688
22456
|
]
|
|
21689
22457
|
|
|
21690
|
-
},{}],
|
|
22458
|
+
},{}],201:[function(require,module,exports){
|
|
21691
22459
|
module.exports=[
|
|
21692
22460
|
{
|
|
21693
22461
|
"description":
|
|
@@ -21777,7 +22545,7 @@ module.exports=[
|
|
|
21777
22545
|
}
|
|
21778
22546
|
]
|
|
21779
22547
|
|
|
21780
|
-
},{}],
|
|
22548
|
+
},{}],202:[function(require,module,exports){
|
|
21781
22549
|
module.exports=[
|
|
21782
22550
|
{
|
|
21783
22551
|
"description": "allOf",
|
|
@@ -21891,7 +22659,7 @@ module.exports=[
|
|
|
21891
22659
|
}
|
|
21892
22660
|
]
|
|
21893
22661
|
|
|
21894
|
-
},{}],
|
|
22662
|
+
},{}],203:[function(require,module,exports){
|
|
21895
22663
|
module.exports=[
|
|
21896
22664
|
{
|
|
21897
22665
|
"description": "anyOf",
|
|
@@ -21961,7 +22729,7 @@ module.exports=[
|
|
|
21961
22729
|
}
|
|
21962
22730
|
]
|
|
21963
22731
|
|
|
21964
|
-
},{}],
|
|
22732
|
+
},{}],204:[function(require,module,exports){
|
|
21965
22733
|
module.exports=[
|
|
21966
22734
|
{
|
|
21967
22735
|
"description": "invalid type for default",
|
|
@@ -22012,7 +22780,7 @@ module.exports=[
|
|
|
22012
22780
|
}
|
|
22013
22781
|
]
|
|
22014
22782
|
|
|
22015
|
-
},{}],
|
|
22783
|
+
},{}],205:[function(require,module,exports){
|
|
22016
22784
|
module.exports=[
|
|
22017
22785
|
{
|
|
22018
22786
|
"description": "valid definition",
|
|
@@ -22046,7 +22814,7 @@ module.exports=[
|
|
|
22046
22814
|
}
|
|
22047
22815
|
]
|
|
22048
22816
|
|
|
22049
|
-
},{}],
|
|
22817
|
+
},{}],206:[function(require,module,exports){
|
|
22050
22818
|
module.exports=[
|
|
22051
22819
|
{
|
|
22052
22820
|
"description": "dependencies",
|
|
@@ -22161,7 +22929,7 @@ module.exports=[
|
|
|
22161
22929
|
}
|
|
22162
22930
|
]
|
|
22163
22931
|
|
|
22164
|
-
},{}],
|
|
22932
|
+
},{}],207:[function(require,module,exports){
|
|
22165
22933
|
module.exports=[
|
|
22166
22934
|
{
|
|
22167
22935
|
"description": "simple enum validation",
|
|
@@ -22235,7 +23003,7 @@ module.exports=[
|
|
|
22235
23003
|
}
|
|
22236
23004
|
]
|
|
22237
23005
|
|
|
22238
|
-
},{}],
|
|
23006
|
+
},{}],208:[function(require,module,exports){
|
|
22239
23007
|
module.exports=[
|
|
22240
23008
|
{
|
|
22241
23009
|
"description": "a schema given for items",
|
|
@@ -22283,7 +23051,7 @@ module.exports=[
|
|
|
22283
23051
|
}
|
|
22284
23052
|
]
|
|
22285
23053
|
|
|
22286
|
-
},{}],
|
|
23054
|
+
},{}],209:[function(require,module,exports){
|
|
22287
23055
|
module.exports=[
|
|
22288
23056
|
{
|
|
22289
23057
|
"description": "maxItems validation",
|
|
@@ -22313,7 +23081,7 @@ module.exports=[
|
|
|
22313
23081
|
}
|
|
22314
23082
|
]
|
|
22315
23083
|
|
|
22316
|
-
},{}],
|
|
23084
|
+
},{}],210:[function(require,module,exports){
|
|
22317
23085
|
module.exports=[
|
|
22318
23086
|
{
|
|
22319
23087
|
"description": "maxLength validation",
|
|
@@ -22348,7 +23116,7 @@ module.exports=[
|
|
|
22348
23116
|
}
|
|
22349
23117
|
]
|
|
22350
23118
|
|
|
22351
|
-
},{}],
|
|
23119
|
+
},{}],211:[function(require,module,exports){
|
|
22352
23120
|
module.exports=[
|
|
22353
23121
|
{
|
|
22354
23122
|
"description": "maxProperties validation",
|
|
@@ -22378,7 +23146,7 @@ module.exports=[
|
|
|
22378
23146
|
}
|
|
22379
23147
|
]
|
|
22380
23148
|
|
|
22381
|
-
},{}],
|
|
23149
|
+
},{}],212:[function(require,module,exports){
|
|
22382
23150
|
module.exports=[
|
|
22383
23151
|
{
|
|
22384
23152
|
"description": "maximum validation",
|
|
@@ -22422,7 +23190,7 @@ module.exports=[
|
|
|
22422
23190
|
}
|
|
22423
23191
|
]
|
|
22424
23192
|
|
|
22425
|
-
},{}],
|
|
23193
|
+
},{}],213:[function(require,module,exports){
|
|
22426
23194
|
module.exports=[
|
|
22427
23195
|
{
|
|
22428
23196
|
"description": "minItems validation",
|
|
@@ -22452,7 +23220,7 @@ module.exports=[
|
|
|
22452
23220
|
}
|
|
22453
23221
|
]
|
|
22454
23222
|
|
|
22455
|
-
},{}],
|
|
23223
|
+
},{}],214:[function(require,module,exports){
|
|
22456
23224
|
module.exports=[
|
|
22457
23225
|
{
|
|
22458
23226
|
"description": "minLength validation",
|
|
@@ -22487,7 +23255,7 @@ module.exports=[
|
|
|
22487
23255
|
}
|
|
22488
23256
|
]
|
|
22489
23257
|
|
|
22490
|
-
},{}],
|
|
23258
|
+
},{}],215:[function(require,module,exports){
|
|
22491
23259
|
module.exports=[
|
|
22492
23260
|
{
|
|
22493
23261
|
"description": "minProperties validation",
|
|
@@ -22517,7 +23285,7 @@ module.exports=[
|
|
|
22517
23285
|
}
|
|
22518
23286
|
]
|
|
22519
23287
|
|
|
22520
|
-
},{}],
|
|
23288
|
+
},{}],216:[function(require,module,exports){
|
|
22521
23289
|
module.exports=[
|
|
22522
23290
|
{
|
|
22523
23291
|
"description": "minimum validation",
|
|
@@ -22561,7 +23329,7 @@ module.exports=[
|
|
|
22561
23329
|
}
|
|
22562
23330
|
]
|
|
22563
23331
|
|
|
22564
|
-
},{}],
|
|
23332
|
+
},{}],217:[function(require,module,exports){
|
|
22565
23333
|
module.exports=[
|
|
22566
23334
|
{
|
|
22567
23335
|
"description": "by int",
|
|
@@ -22623,7 +23391,7 @@ module.exports=[
|
|
|
22623
23391
|
}
|
|
22624
23392
|
]
|
|
22625
23393
|
|
|
22626
|
-
},{}],
|
|
23394
|
+
},{}],218:[function(require,module,exports){
|
|
22627
23395
|
module.exports=[
|
|
22628
23396
|
{
|
|
22629
23397
|
"description": "not",
|
|
@@ -22721,7 +23489,7 @@ module.exports=[
|
|
|
22721
23489
|
|
|
22722
23490
|
]
|
|
22723
23491
|
|
|
22724
|
-
},{}],
|
|
23492
|
+
},{}],219:[function(require,module,exports){
|
|
22725
23493
|
module.exports=[
|
|
22726
23494
|
{
|
|
22727
23495
|
"description": "oneOf",
|
|
@@ -22791,7 +23559,7 @@ module.exports=[
|
|
|
22791
23559
|
}
|
|
22792
23560
|
]
|
|
22793
23561
|
|
|
22794
|
-
},{}],
|
|
23562
|
+
},{}],220:[function(require,module,exports){
|
|
22795
23563
|
module.exports=[
|
|
22796
23564
|
{
|
|
22797
23565
|
"description": "integer",
|
|
@@ -22900,7 +23668,7 @@ module.exports=[
|
|
|
22900
23668
|
}
|
|
22901
23669
|
]
|
|
22902
23670
|
|
|
22903
|
-
},{}],
|
|
23671
|
+
},{}],221:[function(require,module,exports){
|
|
22904
23672
|
module.exports=[
|
|
22905
23673
|
{
|
|
22906
23674
|
"description": "validation of date-time strings",
|
|
@@ -23045,7 +23813,7 @@ module.exports=[
|
|
|
23045
23813
|
}
|
|
23046
23814
|
]
|
|
23047
23815
|
|
|
23048
|
-
},{}],
|
|
23816
|
+
},{}],222:[function(require,module,exports){
|
|
23049
23817
|
module.exports=[
|
|
23050
23818
|
{
|
|
23051
23819
|
"description": "pattern validation",
|
|
@@ -23070,7 +23838,7 @@ module.exports=[
|
|
|
23070
23838
|
}
|
|
23071
23839
|
]
|
|
23072
23840
|
|
|
23073
|
-
},{}],
|
|
23841
|
+
},{}],223:[function(require,module,exports){
|
|
23074
23842
|
module.exports=[
|
|
23075
23843
|
{
|
|
23076
23844
|
"description":
|
|
@@ -23182,7 +23950,7 @@ module.exports=[
|
|
|
23182
23950
|
}
|
|
23183
23951
|
]
|
|
23184
23952
|
|
|
23185
|
-
},{}],
|
|
23953
|
+
},{}],224:[function(require,module,exports){
|
|
23186
23954
|
module.exports=[
|
|
23187
23955
|
{
|
|
23188
23956
|
"description": "object properties validation",
|
|
@@ -23276,7 +24044,7 @@ module.exports=[
|
|
|
23276
24044
|
}
|
|
23277
24045
|
]
|
|
23278
24046
|
|
|
23279
|
-
},{}],
|
|
24047
|
+
},{}],225:[function(require,module,exports){
|
|
23280
24048
|
module.exports=[
|
|
23281
24049
|
{
|
|
23282
24050
|
"description": "root pointer ref",
|
|
@@ -23422,7 +24190,7 @@ module.exports=[
|
|
|
23422
24190
|
}
|
|
23423
24191
|
]
|
|
23424
24192
|
|
|
23425
|
-
},{}],
|
|
24193
|
+
},{}],226:[function(require,module,exports){
|
|
23426
24194
|
module.exports=[
|
|
23427
24195
|
{
|
|
23428
24196
|
"description": "remote ref",
|
|
@@ -23498,7 +24266,7 @@ module.exports=[
|
|
|
23498
24266
|
}
|
|
23499
24267
|
]
|
|
23500
24268
|
|
|
23501
|
-
},{}],
|
|
24269
|
+
},{}],227:[function(require,module,exports){
|
|
23502
24270
|
module.exports=[
|
|
23503
24271
|
{
|
|
23504
24272
|
"description": "required validation",
|
|
@@ -23539,7 +24307,7 @@ module.exports=[
|
|
|
23539
24307
|
}
|
|
23540
24308
|
]
|
|
23541
24309
|
|
|
23542
|
-
},{}],
|
|
24310
|
+
},{}],228:[function(require,module,exports){
|
|
23543
24311
|
module.exports=[
|
|
23544
24312
|
{
|
|
23545
24313
|
"description": "integer type matches integers",
|
|
@@ -23871,7 +24639,7 @@ module.exports=[
|
|
|
23871
24639
|
}
|
|
23872
24640
|
]
|
|
23873
24641
|
|
|
23874
|
-
},{}],
|
|
24642
|
+
},{}],229:[function(require,module,exports){
|
|
23875
24643
|
module.exports=[
|
|
23876
24644
|
{
|
|
23877
24645
|
"description": "uniqueItems validation",
|
|
@@ -23952,7 +24720,7 @@ module.exports=[
|
|
|
23952
24720
|
}
|
|
23953
24721
|
]
|
|
23954
24722
|
|
|
23955
|
-
},{}],
|
|
24723
|
+
},{}],230:[function(require,module,exports){
|
|
23956
24724
|
"use strict";
|
|
23957
24725
|
|
|
23958
24726
|
var isBrowser = typeof window !== "undefined";
|
|
@@ -24045,7 +24813,7 @@ describe("Automatic schema loading", function () {
|
|
|
24045
24813
|
|
|
24046
24814
|
});
|
|
24047
24815
|
|
|
24048
|
-
},{"../../src/ZSchema":
|
|
24816
|
+
},{"../../src/ZSchema":122,"https":7}],231:[function(require,module,exports){
|
|
24049
24817
|
"use strict";
|
|
24050
24818
|
|
|
24051
24819
|
var ZSchema = require("../../src/ZSchema");
|
|
@@ -24117,7 +24885,7 @@ describe("Basic", function () {
|
|
|
24117
24885
|
|
|
24118
24886
|
});
|
|
24119
24887
|
|
|
24120
|
-
},{"../../src/ZSchema":
|
|
24888
|
+
},{"../../src/ZSchema":122,"../files/draft-04-schema.json":196,"../jsonSchemaTestSuite/remotes/folder/folderInteger.json":197,"../jsonSchemaTestSuite/remotes/integer.json":198,"../jsonSchemaTestSuite/remotes/subSchemas.json":199}],232:[function(require,module,exports){
|
|
24121
24889
|
"use strict";
|
|
24122
24890
|
|
|
24123
24891
|
var ZSchema = require("../../src/ZSchema");
|
|
@@ -24213,7 +24981,7 @@ describe("JsonSchemaTestSuite", function () {
|
|
|
24213
24981
|
|
|
24214
24982
|
});
|
|
24215
24983
|
|
|
24216
|
-
},{"../../src/ZSchema":
|
|
24984
|
+
},{"../../src/ZSchema":122,"../files/draft-04-schema.json":196,"../jsonSchemaTestSuite/remotes/folder/folderInteger.json":197,"../jsonSchemaTestSuite/remotes/integer.json":198,"../jsonSchemaTestSuite/remotes/subSchemas.json":199,"../jsonSchemaTestSuite/tests/draft4/additionalItems.json":200,"../jsonSchemaTestSuite/tests/draft4/additionalProperties.json":201,"../jsonSchemaTestSuite/tests/draft4/allOf.json":202,"../jsonSchemaTestSuite/tests/draft4/anyOf.json":203,"../jsonSchemaTestSuite/tests/draft4/default.json":204,"../jsonSchemaTestSuite/tests/draft4/definitions.json":205,"../jsonSchemaTestSuite/tests/draft4/dependencies.json":206,"../jsonSchemaTestSuite/tests/draft4/enum.json":207,"../jsonSchemaTestSuite/tests/draft4/items.json":208,"../jsonSchemaTestSuite/tests/draft4/maxItems.json":209,"../jsonSchemaTestSuite/tests/draft4/maxLength.json":210,"../jsonSchemaTestSuite/tests/draft4/maxProperties.json":211,"../jsonSchemaTestSuite/tests/draft4/maximum.json":212,"../jsonSchemaTestSuite/tests/draft4/minItems.json":213,"../jsonSchemaTestSuite/tests/draft4/minLength.json":214,"../jsonSchemaTestSuite/tests/draft4/minProperties.json":215,"../jsonSchemaTestSuite/tests/draft4/minimum.json":216,"../jsonSchemaTestSuite/tests/draft4/multipleOf.json":217,"../jsonSchemaTestSuite/tests/draft4/not.json":218,"../jsonSchemaTestSuite/tests/draft4/oneOf.json":219,"../jsonSchemaTestSuite/tests/draft4/optional/bignum.json":220,"../jsonSchemaTestSuite/tests/draft4/optional/format.json":221,"../jsonSchemaTestSuite/tests/draft4/pattern.json":222,"../jsonSchemaTestSuite/tests/draft4/patternProperties.json":223,"../jsonSchemaTestSuite/tests/draft4/properties.json":224,"../jsonSchemaTestSuite/tests/draft4/ref.json":225,"../jsonSchemaTestSuite/tests/draft4/refRemote.json":226,"../jsonSchemaTestSuite/tests/draft4/required.json":227,"../jsonSchemaTestSuite/tests/draft4/type.json":228,"../jsonSchemaTestSuite/tests/draft4/uniqueItems.json":229}],233:[function(require,module,exports){
|
|
24217
24985
|
"use strict";
|
|
24218
24986
|
|
|
24219
24987
|
var ZSchema = require("../../src/ZSchema");
|
|
@@ -24229,12 +24997,12 @@ describe("Using multiple instances of Z-Schema", function () {
|
|
|
24229
24997
|
"options": {
|
|
24230
24998
|
"enum": ["a", "b", "c"]
|
|
24231
24999
|
}
|
|
24232
|
-
}
|
|
24233
|
-
"additionalProperties": false
|
|
25000
|
+
}
|
|
24234
25001
|
};
|
|
24235
25002
|
|
|
24236
25003
|
var v;
|
|
24237
25004
|
v = new ZSchema({ strictMode: true });
|
|
25005
|
+
// Should fail because "additionalProperties" is missing
|
|
24238
25006
|
expect(v.validateSchema(schema)).toBe(false, "1st");
|
|
24239
25007
|
|
|
24240
25008
|
v = new ZSchema();
|
|
@@ -24247,7 +25015,7 @@ describe("Using multiple instances of Z-Schema", function () {
|
|
|
24247
25015
|
|
|
24248
25016
|
});
|
|
24249
25017
|
|
|
24250
|
-
},{"../../src/ZSchema":
|
|
25018
|
+
},{"../../src/ZSchema":122}],234:[function(require,module,exports){
|
|
24251
25019
|
/*jshint -W030 */
|
|
24252
25020
|
|
|
24253
25021
|
"use strict";
|
|
@@ -24445,7 +25213,7 @@ describe("ZSchemaTestSuite", function () {
|
|
|
24445
25213
|
|
|
24446
25214
|
});
|
|
24447
25215
|
|
|
24448
|
-
},{"../../src/ZSchema":
|
|
25216
|
+
},{"../../src/ZSchema":122,"../ZSchemaTestSuite/AssumeAdditional.js":125,"../ZSchemaTestSuite/CustomFormats.js":126,"../ZSchemaTestSuite/CustomFormatsAsync.js":127,"../ZSchemaTestSuite/CustomValidator.js":128,"../ZSchemaTestSuite/ErrorPathAsArray.js":129,"../ZSchemaTestSuite/ErrorPathAsJSONPointer.js":130,"../ZSchemaTestSuite/ForceAdditional.js":131,"../ZSchemaTestSuite/ForceItems.js":132,"../ZSchemaTestSuite/ForceMaxItems.js":133,"../ZSchemaTestSuite/ForceMaxLength.js":134,"../ZSchemaTestSuite/ForceMinItems.js":135,"../ZSchemaTestSuite/ForceMinLength.js":136,"../ZSchemaTestSuite/ForceProperties.js":137,"../ZSchemaTestSuite/IgnoreUnresolvableReferences.js":138,"../ZSchemaTestSuite/InvalidId.js":139,"../ZSchemaTestSuite/Issue101.js":140,"../ZSchemaTestSuite/Issue102.js":141,"../ZSchemaTestSuite/Issue103.js":142,"../ZSchemaTestSuite/Issue106.js":143,"../ZSchemaTestSuite/Issue107.js":144,"../ZSchemaTestSuite/Issue12.js":145,"../ZSchemaTestSuite/Issue121.js":146,"../ZSchemaTestSuite/Issue125.js":147,"../ZSchemaTestSuite/Issue126.js":148,"../ZSchemaTestSuite/Issue13.js":149,"../ZSchemaTestSuite/Issue130.js":150,"../ZSchemaTestSuite/Issue131.js":151,"../ZSchemaTestSuite/Issue137.js":152,"../ZSchemaTestSuite/Issue139.js":153,"../ZSchemaTestSuite/Issue142.js":154,"../ZSchemaTestSuite/Issue146.js":155,"../ZSchemaTestSuite/Issue151.js":156,"../ZSchemaTestSuite/Issue16.js":157,"../ZSchemaTestSuite/Issue22.js":158,"../ZSchemaTestSuite/Issue25.js":159,"../ZSchemaTestSuite/Issue26.js":160,"../ZSchemaTestSuite/Issue37.js":161,"../ZSchemaTestSuite/Issue40.js":162,"../ZSchemaTestSuite/Issue41.js":163,"../ZSchemaTestSuite/Issue43.js":164,"../ZSchemaTestSuite/Issue44.js":165,"../ZSchemaTestSuite/Issue45.js":166,"../ZSchemaTestSuite/Issue47.js":167,"../ZSchemaTestSuite/Issue48.js":168,"../ZSchemaTestSuite/Issue49.js":169,"../ZSchemaTestSuite/Issue53.js":170,"../ZSchemaTestSuite/Issue56.js":171,"../ZSchemaTestSuite/Issue57.js":172,"../ZSchemaTestSuite/Issue58.js":173,"../ZSchemaTestSuite/Issue63.js":174,"../ZSchemaTestSuite/Issue64.js":175,"../ZSchemaTestSuite/Issue67.js":176,"../ZSchemaTestSuite/Issue71.js":177,"../ZSchemaTestSuite/Issue73.js":178,"../ZSchemaTestSuite/Issue76.js":179,"../ZSchemaTestSuite/Issue85.js":180,"../ZSchemaTestSuite/Issue94.js":181,"../ZSchemaTestSuite/Issue96.js":182,"../ZSchemaTestSuite/Issue98.js":183,"../ZSchemaTestSuite/MultipleSchemas.js":184,"../ZSchemaTestSuite/NoEmptyArrays.js":185,"../ZSchemaTestSuite/NoEmptyStrings.js":186,"../ZSchemaTestSuite/NoExtraKeywords.js":187,"../ZSchemaTestSuite/NoTypeless.js":188,"../ZSchemaTestSuite/PedanticCheck.js":189,"../ZSchemaTestSuite/StrictUris.js":190,"../ZSchemaTestSuite/getRegisteredFormats.js":195}],235:[function(require,module,exports){
|
|
24449
25217
|
"use strict";
|
|
24450
25218
|
|
|
24451
25219
|
var ZSchema = require("../../src/ZSchema");
|
|
@@ -24544,4 +25312,4 @@ describe("Using path to schema as a third argument", function () {
|
|
|
24544
25312
|
|
|
24545
25313
|
});
|
|
24546
25314
|
|
|
24547
|
-
},{"../../src/ZSchema":
|
|
25315
|
+
},{"../../src/ZSchema":122}]},{},[230,231,232,233,235,234]);
|