@datapos/datapos-tool-csv-parse 0.0.60 → 0.0.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/datapos-tool-csv-parse.es.js +690 -677
- package/dist/types/src/index.d.ts +15 -11
- package/package.json +2 -2
|
@@ -1,165 +1,165 @@
|
|
|
1
|
-
var ie = typeof global < "u" ? global : typeof self < "u" ? self : typeof window < "u" ? window : {}, P = [], F = [],
|
|
2
|
-
function
|
|
3
|
-
|
|
1
|
+
var ie = typeof global < "u" ? global : typeof self < "u" ? self : typeof window < "u" ? window : {}, P = [], F = [], Gt = typeof Uint8Array < "u" ? Uint8Array : Array, je = !1;
|
|
2
|
+
function ht() {
|
|
3
|
+
je = !0;
|
|
4
4
|
for (var t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", e = 0, r = t.length; e < r; ++e)
|
|
5
5
|
P[e] = t[e], F[t.charCodeAt(e)] = e;
|
|
6
6
|
F[45] = 62, F[95] = 63;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
|
|
8
|
+
function Zt(t) {
|
|
9
|
+
je || ht();
|
|
10
10
|
var e, r, n, i, o, s, f = t.length;
|
|
11
11
|
if (f % 4 > 0)
|
|
12
12
|
throw new Error("Invalid string. Length must be a multiple of 4");
|
|
13
|
-
o = t[f - 2] === "=" ? 2 : t[f - 1] === "=" ? 1 : 0, s = new
|
|
14
|
-
var
|
|
13
|
+
o = t[f - 2] === "=" ? 2 : t[f - 1] === "=" ? 1 : 0, s = new Gt(f * 3 / 4 - o), n = o > 0 ? f - 4 : f;
|
|
14
|
+
var a = 0;
|
|
15
15
|
for (e = 0, r = 0; e < n; e += 4, r += 3)
|
|
16
|
-
i = F[t.charCodeAt(e)] << 18 | F[t.charCodeAt(e + 1)] << 12 | F[t.charCodeAt(e + 2)] << 6 | F[t.charCodeAt(e + 3)], s[
|
|
17
|
-
return o === 2 ? (i = F[t.charCodeAt(e)] << 2 | F[t.charCodeAt(e + 1)] >> 4, s[
|
|
16
|
+
i = F[t.charCodeAt(e)] << 18 | F[t.charCodeAt(e + 1)] << 12 | F[t.charCodeAt(e + 2)] << 6 | F[t.charCodeAt(e + 3)], s[a++] = i >> 16 & 255, s[a++] = i >> 8 & 255, s[a++] = i & 255;
|
|
17
|
+
return o === 2 ? (i = F[t.charCodeAt(e)] << 2 | F[t.charCodeAt(e + 1)] >> 4, s[a++] = i & 255) : o === 1 && (i = F[t.charCodeAt(e)] << 10 | F[t.charCodeAt(e + 1)] << 4 | F[t.charCodeAt(e + 2)] >> 2, s[a++] = i >> 8 & 255, s[a++] = i & 255), s;
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function Xt(t) {
|
|
20
20
|
return P[t >> 18 & 63] + P[t >> 12 & 63] + P[t >> 6 & 63] + P[t & 63];
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function Kt(t, e, r) {
|
|
23
23
|
for (var n, i = [], o = e; o < r; o += 3)
|
|
24
|
-
n = (t[o] << 16) + (t[o + 1] << 8) + t[o + 2], i.push(
|
|
24
|
+
n = (t[o] << 16) + (t[o + 1] << 8) + t[o + 2], i.push(Xt(n));
|
|
25
25
|
return i.join("");
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
|
|
29
|
-
for (var e, r = t.length, n = r % 3, i = "", o = [], s = 16383, f = 0,
|
|
30
|
-
o.push(
|
|
27
|
+
function Ge(t) {
|
|
28
|
+
je || ht();
|
|
29
|
+
for (var e, r = t.length, n = r % 3, i = "", o = [], s = 16383, f = 0, a = r - n; f < a; f += s)
|
|
30
|
+
o.push(Kt(t, f, f + s > a ? a : f + s));
|
|
31
31
|
return n === 1 ? (e = t[r - 1], i += P[e >> 2], i += P[e << 4 & 63], i += "==") : n === 2 && (e = (t[r - 2] << 8) + t[r - 1], i += P[e >> 10], i += P[e >> 4 & 63], i += P[e << 2 & 63], i += "="), o.push(i), o.join("");
|
|
32
32
|
}
|
|
33
33
|
function ve(t, e, r, n, i) {
|
|
34
|
-
var o, s, f = i * 8 - n - 1,
|
|
35
|
-
for (c +=
|
|
34
|
+
var o, s, f = i * 8 - n - 1, a = (1 << f) - 1, l = a >> 1, h = -7, c = r ? i - 1 : 0, m = r ? -1 : 1, y = t[e + c];
|
|
35
|
+
for (c += m, o = y & (1 << -h) - 1, y >>= -h, h += f; h > 0; o = o * 256 + t[e + c], c += m, h -= 8)
|
|
36
36
|
;
|
|
37
|
-
for (s = o & (1 << -h) - 1, o >>= -h, h += n; h > 0; s = s * 256 + t[e + c], c +=
|
|
37
|
+
for (s = o & (1 << -h) - 1, o >>= -h, h += n; h > 0; s = s * 256 + t[e + c], c += m, h -= 8)
|
|
38
38
|
;
|
|
39
39
|
if (o === 0)
|
|
40
40
|
o = 1 - l;
|
|
41
41
|
else {
|
|
42
|
-
if (o ===
|
|
42
|
+
if (o === a)
|
|
43
43
|
return s ? NaN : (y ? -1 : 1) * (1 / 0);
|
|
44
44
|
s = s + Math.pow(2, n), o = o - l;
|
|
45
45
|
}
|
|
46
46
|
return (y ? -1 : 1) * s * Math.pow(2, o - n);
|
|
47
47
|
}
|
|
48
|
-
function
|
|
49
|
-
var s, f,
|
|
50
|
-
for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (f = isNaN(e) ? 1 : 0, s = h) : (s = Math.floor(Math.log(e) / Math.LN2), e * (
|
|
48
|
+
function ct(t, e, r, n, i, o) {
|
|
49
|
+
var s, f, a, l = o * 8 - i - 1, h = (1 << l) - 1, c = h >> 1, m = i === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, y = n ? 0 : o - 1, C = n ? 1 : -1, E = e < 0 || e === 0 && 1 / e < 0 ? 1 : 0;
|
|
50
|
+
for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (f = isNaN(e) ? 1 : 0, s = h) : (s = Math.floor(Math.log(e) / Math.LN2), e * (a = Math.pow(2, -s)) < 1 && (s--, a *= 2), s + c >= 1 ? e += m / a : e += m * Math.pow(2, 1 - c), e * a >= 2 && (s++, a /= 2), s + c >= h ? (f = 0, s = h) : s + c >= 1 ? (f = (e * a - 1) * Math.pow(2, i), s = s + c) : (f = e * Math.pow(2, c - 1) * Math.pow(2, i), s = 0)); i >= 8; t[r + y] = f & 255, y += C, f /= 256, i -= 8)
|
|
51
51
|
;
|
|
52
52
|
for (s = s << i | f, l += i; l > 0; t[r + y] = s & 255, y += C, s /= 256, l -= 8)
|
|
53
53
|
;
|
|
54
54
|
t[r + y - C] |= E * 128;
|
|
55
55
|
}
|
|
56
|
-
var
|
|
57
|
-
return
|
|
58
|
-
},
|
|
59
|
-
|
|
56
|
+
var er = {}.toString, dt = Array.isArray || function(t) {
|
|
57
|
+
return er.call(t) == "[object Array]";
|
|
58
|
+
}, tr = 50;
|
|
59
|
+
u.TYPED_ARRAY_SUPPORT = ie.TYPED_ARRAY_SUPPORT !== void 0 ? ie.TYPED_ARRAY_SUPPORT : !0;
|
|
60
60
|
_e();
|
|
61
61
|
function _e() {
|
|
62
|
-
return
|
|
62
|
+
return u.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823;
|
|
63
63
|
}
|
|
64
64
|
function q(t, e) {
|
|
65
65
|
if (_e() < e)
|
|
66
66
|
throw new RangeError("Invalid typed array length");
|
|
67
|
-
return
|
|
67
|
+
return u.TYPED_ARRAY_SUPPORT ? (t = new Uint8Array(e), t.__proto__ = u.prototype) : (t === null && (t = new u(e)), t.length = e), t;
|
|
68
68
|
}
|
|
69
|
-
function
|
|
70
|
-
if (!
|
|
71
|
-
return new
|
|
69
|
+
function u(t, e, r) {
|
|
70
|
+
if (!u.TYPED_ARRAY_SUPPORT && !(this instanceof u))
|
|
71
|
+
return new u(t, e, r);
|
|
72
72
|
if (typeof t == "number") {
|
|
73
73
|
if (typeof e == "string")
|
|
74
74
|
throw new Error(
|
|
75
75
|
"If encoding is specified then the first argument must be a string"
|
|
76
76
|
);
|
|
77
|
-
return
|
|
77
|
+
return qe(this, t);
|
|
78
78
|
}
|
|
79
|
-
return
|
|
79
|
+
return pt(this, t, e, r);
|
|
80
80
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
return t.__proto__ =
|
|
81
|
+
u.poolSize = 8192;
|
|
82
|
+
u._augment = function(t) {
|
|
83
|
+
return t.__proto__ = u.prototype, t;
|
|
84
84
|
};
|
|
85
|
-
function
|
|
85
|
+
function pt(t, e, r, n) {
|
|
86
86
|
if (typeof e == "number")
|
|
87
87
|
throw new TypeError('"value" argument must not be a number');
|
|
88
|
-
return typeof ArrayBuffer < "u" && e instanceof ArrayBuffer ?
|
|
88
|
+
return typeof ArrayBuffer < "u" && e instanceof ArrayBuffer ? ir(t, e, r, n) : typeof e == "string" ? nr(t, e, r) : or(t, e);
|
|
89
89
|
}
|
|
90
|
-
|
|
91
|
-
return
|
|
90
|
+
u.from = function(t, e, r) {
|
|
91
|
+
return pt(null, t, e, r);
|
|
92
92
|
};
|
|
93
|
-
|
|
94
|
-
function
|
|
93
|
+
u.TYPED_ARRAY_SUPPORT && (u.prototype.__proto__ = Uint8Array.prototype, u.__proto__ = Uint8Array, typeof Symbol < "u" && Symbol.species && u[Symbol.species]);
|
|
94
|
+
function mt(t) {
|
|
95
95
|
if (typeof t != "number")
|
|
96
96
|
throw new TypeError('"size" argument must be a number');
|
|
97
97
|
if (t < 0)
|
|
98
98
|
throw new RangeError('"size" argument must not be negative');
|
|
99
99
|
}
|
|
100
|
-
function
|
|
101
|
-
return
|
|
100
|
+
function rr(t, e, r, n) {
|
|
101
|
+
return mt(e), e <= 0 ? q(t, e) : r !== void 0 ? typeof n == "string" ? q(t, e).fill(r, n) : q(t, e).fill(r) : q(t, e);
|
|
102
102
|
}
|
|
103
|
-
|
|
104
|
-
return
|
|
103
|
+
u.alloc = function(t, e, r) {
|
|
104
|
+
return rr(null, t, e, r);
|
|
105
105
|
};
|
|
106
|
-
function
|
|
107
|
-
if (
|
|
106
|
+
function qe(t, e) {
|
|
107
|
+
if (mt(e), t = q(t, e < 0 ? 0 : ze(e) | 0), !u.TYPED_ARRAY_SUPPORT)
|
|
108
108
|
for (var r = 0; r < e; ++r)
|
|
109
109
|
t[r] = 0;
|
|
110
110
|
return t;
|
|
111
111
|
}
|
|
112
|
-
|
|
113
|
-
return
|
|
112
|
+
u.allocUnsafe = function(t) {
|
|
113
|
+
return qe(null, t);
|
|
114
114
|
};
|
|
115
|
-
|
|
116
|
-
return
|
|
115
|
+
u.allocUnsafeSlow = function(t) {
|
|
116
|
+
return qe(null, t);
|
|
117
117
|
};
|
|
118
|
-
function
|
|
119
|
-
if ((typeof r != "string" || r === "") && (r = "utf8"), !
|
|
118
|
+
function nr(t, e, r) {
|
|
119
|
+
if ((typeof r != "string" || r === "") && (r = "utf8"), !u.isEncoding(r))
|
|
120
120
|
throw new TypeError('"encoding" must be a valid string encoding');
|
|
121
121
|
var n = gt(e, r) | 0;
|
|
122
122
|
t = q(t, n);
|
|
123
123
|
var i = t.write(e, r);
|
|
124
124
|
return i !== n && (t = t.slice(0, i)), t;
|
|
125
125
|
}
|
|
126
|
-
function
|
|
127
|
-
var r = e.length < 0 ? 0 :
|
|
126
|
+
function Ue(t, e) {
|
|
127
|
+
var r = e.length < 0 ? 0 : ze(e.length) | 0;
|
|
128
128
|
t = q(t, r);
|
|
129
129
|
for (var n = 0; n < r; n += 1)
|
|
130
130
|
t[n] = e[n] & 255;
|
|
131
131
|
return t;
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function ir(t, e, r, n) {
|
|
134
134
|
if (e.byteLength, r < 0 || e.byteLength < r)
|
|
135
135
|
throw new RangeError("'offset' is out of bounds");
|
|
136
136
|
if (e.byteLength < r + (n || 0))
|
|
137
137
|
throw new RangeError("'length' is out of bounds");
|
|
138
|
-
return r === void 0 && n === void 0 ? e = new Uint8Array(e) : n === void 0 ? e = new Uint8Array(e, r) : e = new Uint8Array(e, r, n),
|
|
138
|
+
return r === void 0 && n === void 0 ? e = new Uint8Array(e) : n === void 0 ? e = new Uint8Array(e, r) : e = new Uint8Array(e, r, n), u.TYPED_ARRAY_SUPPORT ? (t = e, t.__proto__ = u.prototype) : t = Ue(t, e), t;
|
|
139
139
|
}
|
|
140
|
-
function
|
|
140
|
+
function or(t, e) {
|
|
141
141
|
if ($(e)) {
|
|
142
|
-
var r =
|
|
142
|
+
var r = ze(e.length) | 0;
|
|
143
143
|
return t = q(t, r), t.length === 0 || e.copy(t, 0, 0, r), t;
|
|
144
144
|
}
|
|
145
145
|
if (e) {
|
|
146
146
|
if (typeof ArrayBuffer < "u" && e.buffer instanceof ArrayBuffer || "length" in e)
|
|
147
|
-
return typeof e.length != "number" ||
|
|
148
|
-
if (e.type === "Buffer" &&
|
|
149
|
-
return
|
|
147
|
+
return typeof e.length != "number" || Sr(e.length) ? q(t, 0) : Ue(t, e);
|
|
148
|
+
if (e.type === "Buffer" && dt(e.data))
|
|
149
|
+
return Ue(t, e.data);
|
|
150
150
|
}
|
|
151
151
|
throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.");
|
|
152
152
|
}
|
|
153
|
-
function
|
|
153
|
+
function ze(t) {
|
|
154
154
|
if (t >= _e())
|
|
155
155
|
throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + _e().toString(16) + " bytes");
|
|
156
156
|
return t | 0;
|
|
157
157
|
}
|
|
158
|
-
|
|
158
|
+
u.isBuffer = N;
|
|
159
159
|
function $(t) {
|
|
160
160
|
return !!(t != null && t._isBuffer);
|
|
161
161
|
}
|
|
162
|
-
|
|
162
|
+
u.compare = function(e, r) {
|
|
163
163
|
if (!$(e) || !$(r))
|
|
164
164
|
throw new TypeError("Arguments must be Buffers");
|
|
165
165
|
if (e === r) return 0;
|
|
@@ -170,7 +170,7 @@ a.compare = function(e, r) {
|
|
|
170
170
|
}
|
|
171
171
|
return n < i ? -1 : i < n ? 1 : 0;
|
|
172
172
|
};
|
|
173
|
-
|
|
173
|
+
u.isEncoding = function(e) {
|
|
174
174
|
switch (String(e).toLowerCase()) {
|
|
175
175
|
case "hex":
|
|
176
176
|
case "utf8":
|
|
@@ -188,16 +188,16 @@ a.isEncoding = function(e) {
|
|
|
188
188
|
return !1;
|
|
189
189
|
}
|
|
190
190
|
};
|
|
191
|
-
|
|
192
|
-
if (!
|
|
191
|
+
u.concat = function(e, r) {
|
|
192
|
+
if (!dt(e))
|
|
193
193
|
throw new TypeError('"list" argument must be an Array of Buffers');
|
|
194
194
|
if (e.length === 0)
|
|
195
|
-
return
|
|
195
|
+
return u.alloc(0);
|
|
196
196
|
var n;
|
|
197
197
|
if (r === void 0)
|
|
198
198
|
for (r = 0, n = 0; n < e.length; ++n)
|
|
199
199
|
r += e[n].length;
|
|
200
|
-
var i =
|
|
200
|
+
var i = u.allocUnsafe(r), o = 0;
|
|
201
201
|
for (n = 0; n < e.length; ++n) {
|
|
202
202
|
var s = e[n];
|
|
203
203
|
if (!$(s))
|
|
@@ -232,14 +232,14 @@ function gt(t, e) {
|
|
|
232
232
|
case "hex":
|
|
233
233
|
return r >>> 1;
|
|
234
234
|
case "base64":
|
|
235
|
-
return
|
|
235
|
+
return xt(t).length;
|
|
236
236
|
default:
|
|
237
237
|
if (n) return we(t).length;
|
|
238
238
|
e = ("" + e).toLowerCase(), n = !0;
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
|
-
|
|
242
|
-
function
|
|
241
|
+
u.byteLength = gt;
|
|
242
|
+
function sr(t, e, r) {
|
|
243
243
|
var n = !1;
|
|
244
244
|
if ((e === void 0 || e < 0) && (e = 0), e > this.length || ((r === void 0 || r > this.length) && (r = this.length), r <= 0) || (r >>>= 0, e >>>= 0, r <= e))
|
|
245
245
|
return "";
|
|
@@ -249,30 +249,30 @@ function or(t, e, r) {
|
|
|
249
249
|
return gr(this, e, r);
|
|
250
250
|
case "utf8":
|
|
251
251
|
case "utf-8":
|
|
252
|
-
return
|
|
252
|
+
return yt(this, e, r);
|
|
253
253
|
case "ascii":
|
|
254
|
-
return
|
|
254
|
+
return pr(this, e, r);
|
|
255
255
|
case "latin1":
|
|
256
256
|
case "binary":
|
|
257
|
-
return
|
|
257
|
+
return mr(this, e, r);
|
|
258
258
|
case "base64":
|
|
259
|
-
return
|
|
259
|
+
return cr(this, e, r);
|
|
260
260
|
case "ucs2":
|
|
261
261
|
case "ucs-2":
|
|
262
262
|
case "utf16le":
|
|
263
263
|
case "utf-16le":
|
|
264
|
-
return
|
|
264
|
+
return _r(this, e, r);
|
|
265
265
|
default:
|
|
266
266
|
if (n) throw new TypeError("Unknown encoding: " + t);
|
|
267
267
|
t = (t + "").toLowerCase(), n = !0;
|
|
268
268
|
}
|
|
269
269
|
}
|
|
270
|
-
|
|
270
|
+
u.prototype._isBuffer = !0;
|
|
271
271
|
function K(t, e, r) {
|
|
272
272
|
var n = t[e];
|
|
273
273
|
t[e] = t[r], t[r] = n;
|
|
274
274
|
}
|
|
275
|
-
|
|
275
|
+
u.prototype.swap16 = function() {
|
|
276
276
|
var e = this.length;
|
|
277
277
|
if (e % 2 !== 0)
|
|
278
278
|
throw new RangeError("Buffer size must be a multiple of 16-bits");
|
|
@@ -280,7 +280,7 @@ a.prototype.swap16 = function() {
|
|
|
280
280
|
K(this, r, r + 1);
|
|
281
281
|
return this;
|
|
282
282
|
};
|
|
283
|
-
|
|
283
|
+
u.prototype.swap32 = function() {
|
|
284
284
|
var e = this.length;
|
|
285
285
|
if (e % 4 !== 0)
|
|
286
286
|
throw new RangeError("Buffer size must be a multiple of 32-bits");
|
|
@@ -288,7 +288,7 @@ a.prototype.swap32 = function() {
|
|
|
288
288
|
K(this, r, r + 3), K(this, r + 1, r + 2);
|
|
289
289
|
return this;
|
|
290
290
|
};
|
|
291
|
-
|
|
291
|
+
u.prototype.swap64 = function() {
|
|
292
292
|
var e = this.length;
|
|
293
293
|
if (e % 8 !== 0)
|
|
294
294
|
throw new RangeError("Buffer size must be a multiple of 64-bits");
|
|
@@ -296,19 +296,19 @@ a.prototype.swap64 = function() {
|
|
|
296
296
|
K(this, r, r + 7), K(this, r + 1, r + 6), K(this, r + 2, r + 5), K(this, r + 3, r + 4);
|
|
297
297
|
return this;
|
|
298
298
|
};
|
|
299
|
-
|
|
299
|
+
u.prototype.toString = function() {
|
|
300
300
|
var e = this.length | 0;
|
|
301
|
-
return e === 0 ? "" : arguments.length === 0 ?
|
|
301
|
+
return e === 0 ? "" : arguments.length === 0 ? yt(this, 0, e) : sr.apply(this, arguments);
|
|
302
302
|
};
|
|
303
|
-
|
|
303
|
+
u.prototype.equals = function(e) {
|
|
304
304
|
if (!$(e)) throw new TypeError("Argument must be a Buffer");
|
|
305
|
-
return this === e ? !0 :
|
|
305
|
+
return this === e ? !0 : u.compare(this, e) === 0;
|
|
306
306
|
};
|
|
307
|
-
|
|
308
|
-
var e = "", r =
|
|
307
|
+
u.prototype.inspect = function() {
|
|
308
|
+
var e = "", r = tr;
|
|
309
309
|
return this.length > 0 && (e = this.toString("hex", 0, r).match(/.{2}/g).join(" "), this.length > r && (e += " ... ")), "<Buffer " + e + ">";
|
|
310
310
|
};
|
|
311
|
-
|
|
311
|
+
u.prototype.compare = function(e, r, n, i, o) {
|
|
312
312
|
if (!$(e))
|
|
313
313
|
throw new TypeError("Argument must be a Buffer");
|
|
314
314
|
if (r === void 0 && (r = 0), n === void 0 && (n = e ? e.length : 0), i === void 0 && (i = 0), o === void 0 && (o = this.length), r < 0 || n > e.length || i < 0 || o > this.length)
|
|
@@ -320,14 +320,14 @@ a.prototype.compare = function(e, r, n, i, o) {
|
|
|
320
320
|
if (r >= n)
|
|
321
321
|
return 1;
|
|
322
322
|
if (r >>>= 0, n >>>= 0, i >>>= 0, o >>>= 0, this === e) return 0;
|
|
323
|
-
for (var s = o - i, f = n - r,
|
|
323
|
+
for (var s = o - i, f = n - r, a = Math.min(s, f), l = this.slice(i, o), h = e.slice(r, n), c = 0; c < a; ++c)
|
|
324
324
|
if (l[c] !== h[c]) {
|
|
325
325
|
s = l[c], f = h[c];
|
|
326
326
|
break;
|
|
327
327
|
}
|
|
328
328
|
return s < f ? -1 : f < s ? 1 : 0;
|
|
329
329
|
};
|
|
330
|
-
function
|
|
330
|
+
function _t(t, e, r, n, i) {
|
|
331
331
|
if (t.length === 0) return -1;
|
|
332
332
|
if (typeof r == "string" ? (n = r, r = 0) : r > 2147483647 ? r = 2147483647 : r < -2147483648 && (r = -2147483648), r = +r, isNaN(r) && (r = i ? 0 : t.length - 1), r < 0 && (r = t.length + r), r >= t.length) {
|
|
333
333
|
if (i) return -1;
|
|
@@ -335,34 +335,34 @@ function mt(t, e, r, n, i) {
|
|
|
335
335
|
} else if (r < 0)
|
|
336
336
|
if (i) r = 0;
|
|
337
337
|
else return -1;
|
|
338
|
-
if (typeof e == "string" && (e =
|
|
339
|
-
return e.length === 0 ? -1 :
|
|
338
|
+
if (typeof e == "string" && (e = u.from(e, n)), $(e))
|
|
339
|
+
return e.length === 0 ? -1 : Ze(t, e, r, n, i);
|
|
340
340
|
if (typeof e == "number")
|
|
341
|
-
return e = e & 255,
|
|
341
|
+
return e = e & 255, u.TYPED_ARRAY_SUPPORT && typeof Uint8Array.prototype.indexOf == "function" ? i ? Uint8Array.prototype.indexOf.call(t, e, r) : Uint8Array.prototype.lastIndexOf.call(t, e, r) : Ze(t, [e], r, n, i);
|
|
342
342
|
throw new TypeError("val must be string, number or Buffer");
|
|
343
343
|
}
|
|
344
|
-
function
|
|
344
|
+
function Ze(t, e, r, n, i) {
|
|
345
345
|
var o = 1, s = t.length, f = e.length;
|
|
346
346
|
if (n !== void 0 && (n = String(n).toLowerCase(), n === "ucs2" || n === "ucs-2" || n === "utf16le" || n === "utf-16le")) {
|
|
347
347
|
if (t.length < 2 || e.length < 2)
|
|
348
348
|
return -1;
|
|
349
349
|
o = 2, s /= 2, f /= 2, r /= 2;
|
|
350
350
|
}
|
|
351
|
-
function
|
|
351
|
+
function a(y, C) {
|
|
352
352
|
return o === 1 ? y[C] : y.readUInt16BE(C * o);
|
|
353
353
|
}
|
|
354
354
|
var l;
|
|
355
355
|
if (i) {
|
|
356
356
|
var h = -1;
|
|
357
357
|
for (l = r; l < s; l++)
|
|
358
|
-
if (
|
|
358
|
+
if (a(t, l) === a(e, h === -1 ? 0 : l - h)) {
|
|
359
359
|
if (h === -1 && (h = l), l - h + 1 === f) return h * o;
|
|
360
360
|
} else
|
|
361
361
|
h !== -1 && (l -= l - h), h = -1;
|
|
362
362
|
} else
|
|
363
363
|
for (r + f > s && (r = s - f), l = r; l >= 0; l--) {
|
|
364
|
-
for (var c = !0,
|
|
365
|
-
if (
|
|
364
|
+
for (var c = !0, m = 0; m < f; m++)
|
|
365
|
+
if (a(t, l + m) !== a(e, m)) {
|
|
366
366
|
c = !1;
|
|
367
367
|
break;
|
|
368
368
|
}
|
|
@@ -370,16 +370,16 @@ function Ge(t, e, r, n, i) {
|
|
|
370
370
|
}
|
|
371
371
|
return -1;
|
|
372
372
|
}
|
|
373
|
-
|
|
373
|
+
u.prototype.includes = function(e, r, n) {
|
|
374
374
|
return this.indexOf(e, r, n) !== -1;
|
|
375
375
|
};
|
|
376
|
-
|
|
377
|
-
return
|
|
376
|
+
u.prototype.indexOf = function(e, r, n) {
|
|
377
|
+
return _t(this, e, r, n, !0);
|
|
378
378
|
};
|
|
379
|
-
|
|
380
|
-
return
|
|
379
|
+
u.prototype.lastIndexOf = function(e, r, n) {
|
|
380
|
+
return _t(this, e, r, n, !1);
|
|
381
381
|
};
|
|
382
|
-
function
|
|
382
|
+
function fr(t, e, r, n) {
|
|
383
383
|
r = Number(r) || 0;
|
|
384
384
|
var i = t.length - r;
|
|
385
385
|
n ? (n = Number(n), n > i && (n = i)) : n = i;
|
|
@@ -393,22 +393,22 @@ function sr(t, e, r, n) {
|
|
|
393
393
|
}
|
|
394
394
|
return s;
|
|
395
395
|
}
|
|
396
|
-
function
|
|
396
|
+
function ar(t, e, r, n) {
|
|
397
397
|
return xe(we(e, t.length - r), t, r, n);
|
|
398
398
|
}
|
|
399
|
-
function
|
|
400
|
-
return xe(
|
|
401
|
-
}
|
|
402
|
-
function ar(t, e, r, n) {
|
|
403
|
-
return _t(t, e, r, n);
|
|
399
|
+
function wt(t, e, r, n) {
|
|
400
|
+
return xe(Er(e), t, r, n);
|
|
404
401
|
}
|
|
405
402
|
function ur(t, e, r, n) {
|
|
406
|
-
return
|
|
403
|
+
return wt(t, e, r, n);
|
|
407
404
|
}
|
|
408
405
|
function lr(t, e, r, n) {
|
|
409
|
-
return xe(
|
|
406
|
+
return xe(xt(e), t, r, n);
|
|
407
|
+
}
|
|
408
|
+
function hr(t, e, r, n) {
|
|
409
|
+
return xe(xr(e, t.length - r), t, r, n);
|
|
410
410
|
}
|
|
411
|
-
|
|
411
|
+
u.prototype.write = function(e, r, n, i) {
|
|
412
412
|
if (r === void 0)
|
|
413
413
|
i = "utf8", n = this.length, r = 0;
|
|
414
414
|
else if (n === void 0 && typeof r == "string")
|
|
@@ -426,80 +426,80 @@ a.prototype.write = function(e, r, n, i) {
|
|
|
426
426
|
for (var s = !1; ; )
|
|
427
427
|
switch (i) {
|
|
428
428
|
case "hex":
|
|
429
|
-
return
|
|
429
|
+
return fr(this, e, r, n);
|
|
430
430
|
case "utf8":
|
|
431
431
|
case "utf-8":
|
|
432
|
-
return
|
|
432
|
+
return ar(this, e, r, n);
|
|
433
433
|
case "ascii":
|
|
434
|
-
return
|
|
434
|
+
return wt(this, e, r, n);
|
|
435
435
|
case "latin1":
|
|
436
436
|
case "binary":
|
|
437
|
-
return ar(this, e, r, n);
|
|
438
|
-
case "base64":
|
|
439
437
|
return ur(this, e, r, n);
|
|
438
|
+
case "base64":
|
|
439
|
+
return lr(this, e, r, n);
|
|
440
440
|
case "ucs2":
|
|
441
441
|
case "ucs-2":
|
|
442
442
|
case "utf16le":
|
|
443
443
|
case "utf-16le":
|
|
444
|
-
return
|
|
444
|
+
return hr(this, e, r, n);
|
|
445
445
|
default:
|
|
446
446
|
if (s) throw new TypeError("Unknown encoding: " + i);
|
|
447
447
|
i = ("" + i).toLowerCase(), s = !0;
|
|
448
448
|
}
|
|
449
449
|
};
|
|
450
|
-
|
|
450
|
+
u.prototype.toJSON = function() {
|
|
451
451
|
return {
|
|
452
452
|
type: "Buffer",
|
|
453
453
|
data: Array.prototype.slice.call(this._arr || this, 0)
|
|
454
454
|
};
|
|
455
455
|
};
|
|
456
|
-
function
|
|
457
|
-
return e === 0 && r === t.length ?
|
|
456
|
+
function cr(t, e, r) {
|
|
457
|
+
return e === 0 && r === t.length ? Ge(t) : Ge(t.slice(e, r));
|
|
458
458
|
}
|
|
459
|
-
function
|
|
459
|
+
function yt(t, e, r) {
|
|
460
460
|
r = Math.min(t.length, r);
|
|
461
461
|
for (var n = [], i = e; i < r; ) {
|
|
462
462
|
var o = t[i], s = null, f = o > 239 ? 4 : o > 223 ? 3 : o > 191 ? 2 : 1;
|
|
463
463
|
if (i + f <= r) {
|
|
464
|
-
var
|
|
464
|
+
var a, l, h, c;
|
|
465
465
|
switch (f) {
|
|
466
466
|
case 1:
|
|
467
467
|
o < 128 && (s = o);
|
|
468
468
|
break;
|
|
469
469
|
case 2:
|
|
470
|
-
|
|
470
|
+
a = t[i + 1], (a & 192) === 128 && (c = (o & 31) << 6 | a & 63, c > 127 && (s = c));
|
|
471
471
|
break;
|
|
472
472
|
case 3:
|
|
473
|
-
|
|
473
|
+
a = t[i + 1], l = t[i + 2], (a & 192) === 128 && (l & 192) === 128 && (c = (o & 15) << 12 | (a & 63) << 6 | l & 63, c > 2047 && (c < 55296 || c > 57343) && (s = c));
|
|
474
474
|
break;
|
|
475
475
|
case 4:
|
|
476
|
-
|
|
476
|
+
a = t[i + 1], l = t[i + 2], h = t[i + 3], (a & 192) === 128 && (l & 192) === 128 && (h & 192) === 128 && (c = (o & 15) << 18 | (a & 63) << 12 | (l & 63) << 6 | h & 63, c > 65535 && c < 1114112 && (s = c));
|
|
477
477
|
}
|
|
478
478
|
}
|
|
479
479
|
s === null ? (s = 65533, f = 1) : s > 65535 && (s -= 65536, n.push(s >>> 10 & 1023 | 55296), s = 56320 | s & 1023), n.push(s), i += f;
|
|
480
480
|
}
|
|
481
|
-
return
|
|
481
|
+
return dr(n);
|
|
482
482
|
}
|
|
483
|
-
var
|
|
484
|
-
function
|
|
483
|
+
var Xe = 4096;
|
|
484
|
+
function dr(t) {
|
|
485
485
|
var e = t.length;
|
|
486
|
-
if (e <=
|
|
486
|
+
if (e <= Xe)
|
|
487
487
|
return String.fromCharCode.apply(String, t);
|
|
488
488
|
for (var r = "", n = 0; n < e; )
|
|
489
489
|
r += String.fromCharCode.apply(
|
|
490
490
|
String,
|
|
491
|
-
t.slice(n, n +=
|
|
491
|
+
t.slice(n, n += Xe)
|
|
492
492
|
);
|
|
493
493
|
return r;
|
|
494
494
|
}
|
|
495
|
-
function
|
|
495
|
+
function pr(t, e, r) {
|
|
496
496
|
var n = "";
|
|
497
497
|
r = Math.min(t.length, r);
|
|
498
498
|
for (var i = e; i < r; ++i)
|
|
499
499
|
n += String.fromCharCode(t[i] & 127);
|
|
500
500
|
return n;
|
|
501
501
|
}
|
|
502
|
-
function
|
|
502
|
+
function mr(t, e, r) {
|
|
503
503
|
var n = "";
|
|
504
504
|
r = Math.min(t.length, r);
|
|
505
505
|
for (var i = e; i < r; ++i)
|
|
@@ -510,108 +510,108 @@ function gr(t, e, r) {
|
|
|
510
510
|
var n = t.length;
|
|
511
511
|
(!e || e < 0) && (e = 0), (!r || r < 0 || r > n) && (r = n);
|
|
512
512
|
for (var i = "", o = e; o < r; ++o)
|
|
513
|
-
i +=
|
|
513
|
+
i += br(t[o]);
|
|
514
514
|
return i;
|
|
515
515
|
}
|
|
516
|
-
function
|
|
516
|
+
function _r(t, e, r) {
|
|
517
517
|
for (var n = t.slice(e, r), i = "", o = 0; o < n.length; o += 2)
|
|
518
518
|
i += String.fromCharCode(n[o] + n[o + 1] * 256);
|
|
519
519
|
return i;
|
|
520
520
|
}
|
|
521
|
-
|
|
521
|
+
u.prototype.slice = function(e, r) {
|
|
522
522
|
var n = this.length;
|
|
523
523
|
e = ~~e, r = r === void 0 ? n : ~~r, e < 0 ? (e += n, e < 0 && (e = 0)) : e > n && (e = n), r < 0 ? (r += n, r < 0 && (r = 0)) : r > n && (r = n), r < e && (r = e);
|
|
524
524
|
var i;
|
|
525
|
-
if (
|
|
526
|
-
i = this.subarray(e, r), i.__proto__ =
|
|
525
|
+
if (u.TYPED_ARRAY_SUPPORT)
|
|
526
|
+
i = this.subarray(e, r), i.__proto__ = u.prototype;
|
|
527
527
|
else {
|
|
528
528
|
var o = r - e;
|
|
529
|
-
i = new
|
|
529
|
+
i = new u(o, void 0);
|
|
530
530
|
for (var s = 0; s < o; ++s)
|
|
531
531
|
i[s] = this[s + e];
|
|
532
532
|
}
|
|
533
533
|
return i;
|
|
534
534
|
};
|
|
535
|
-
function
|
|
535
|
+
function L(t, e, r) {
|
|
536
536
|
if (t % 1 !== 0 || t < 0) throw new RangeError("offset is not uint");
|
|
537
537
|
if (t + e > r) throw new RangeError("Trying to access beyond buffer length");
|
|
538
538
|
}
|
|
539
|
-
|
|
540
|
-
e = e | 0, r = r | 0, n ||
|
|
539
|
+
u.prototype.readUIntLE = function(e, r, n) {
|
|
540
|
+
e = e | 0, r = r | 0, n || L(e, r, this.length);
|
|
541
541
|
for (var i = this[e], o = 1, s = 0; ++s < r && (o *= 256); )
|
|
542
542
|
i += this[e + s] * o;
|
|
543
543
|
return i;
|
|
544
544
|
};
|
|
545
|
-
|
|
546
|
-
e = e | 0, r = r | 0, n ||
|
|
545
|
+
u.prototype.readUIntBE = function(e, r, n) {
|
|
546
|
+
e = e | 0, r = r | 0, n || L(e, r, this.length);
|
|
547
547
|
for (var i = this[e + --r], o = 1; r > 0 && (o *= 256); )
|
|
548
548
|
i += this[e + --r] * o;
|
|
549
549
|
return i;
|
|
550
550
|
};
|
|
551
|
-
|
|
552
|
-
return r ||
|
|
551
|
+
u.prototype.readUInt8 = function(e, r) {
|
|
552
|
+
return r || L(e, 1, this.length), this[e];
|
|
553
553
|
};
|
|
554
|
-
|
|
555
|
-
return r ||
|
|
554
|
+
u.prototype.readUInt16LE = function(e, r) {
|
|
555
|
+
return r || L(e, 2, this.length), this[e] | this[e + 1] << 8;
|
|
556
556
|
};
|
|
557
|
-
|
|
558
|
-
return r ||
|
|
557
|
+
u.prototype.readUInt16BE = function(e, r) {
|
|
558
|
+
return r || L(e, 2, this.length), this[e] << 8 | this[e + 1];
|
|
559
559
|
};
|
|
560
|
-
|
|
561
|
-
return r ||
|
|
560
|
+
u.prototype.readUInt32LE = function(e, r) {
|
|
561
|
+
return r || L(e, 4, this.length), (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + this[e + 3] * 16777216;
|
|
562
562
|
};
|
|
563
|
-
|
|
564
|
-
return r ||
|
|
563
|
+
u.prototype.readUInt32BE = function(e, r) {
|
|
564
|
+
return r || L(e, 4, this.length), this[e] * 16777216 + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]);
|
|
565
565
|
};
|
|
566
|
-
|
|
567
|
-
e = e | 0, r = r | 0, n ||
|
|
566
|
+
u.prototype.readIntLE = function(e, r, n) {
|
|
567
|
+
e = e | 0, r = r | 0, n || L(e, r, this.length);
|
|
568
568
|
for (var i = this[e], o = 1, s = 0; ++s < r && (o *= 256); )
|
|
569
569
|
i += this[e + s] * o;
|
|
570
570
|
return o *= 128, i >= o && (i -= Math.pow(2, 8 * r)), i;
|
|
571
571
|
};
|
|
572
|
-
|
|
573
|
-
e = e | 0, r = r | 0, n ||
|
|
572
|
+
u.prototype.readIntBE = function(e, r, n) {
|
|
573
|
+
e = e | 0, r = r | 0, n || L(e, r, this.length);
|
|
574
574
|
for (var i = r, o = 1, s = this[e + --i]; i > 0 && (o *= 256); )
|
|
575
575
|
s += this[e + --i] * o;
|
|
576
576
|
return o *= 128, s >= o && (s -= Math.pow(2, 8 * r)), s;
|
|
577
577
|
};
|
|
578
|
-
|
|
579
|
-
return r ||
|
|
578
|
+
u.prototype.readInt8 = function(e, r) {
|
|
579
|
+
return r || L(e, 1, this.length), this[e] & 128 ? (255 - this[e] + 1) * -1 : this[e];
|
|
580
580
|
};
|
|
581
|
-
|
|
582
|
-
r ||
|
|
581
|
+
u.prototype.readInt16LE = function(e, r) {
|
|
582
|
+
r || L(e, 2, this.length);
|
|
583
583
|
var n = this[e] | this[e + 1] << 8;
|
|
584
584
|
return n & 32768 ? n | 4294901760 : n;
|
|
585
585
|
};
|
|
586
|
-
|
|
587
|
-
r ||
|
|
586
|
+
u.prototype.readInt16BE = function(e, r) {
|
|
587
|
+
r || L(e, 2, this.length);
|
|
588
588
|
var n = this[e + 1] | this[e] << 8;
|
|
589
589
|
return n & 32768 ? n | 4294901760 : n;
|
|
590
590
|
};
|
|
591
|
-
|
|
592
|
-
return r ||
|
|
591
|
+
u.prototype.readInt32LE = function(e, r) {
|
|
592
|
+
return r || L(e, 4, this.length), this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24;
|
|
593
593
|
};
|
|
594
|
-
|
|
595
|
-
return r ||
|
|
594
|
+
u.prototype.readInt32BE = function(e, r) {
|
|
595
|
+
return r || L(e, 4, this.length), this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3];
|
|
596
596
|
};
|
|
597
|
-
|
|
598
|
-
return r ||
|
|
597
|
+
u.prototype.readFloatLE = function(e, r) {
|
|
598
|
+
return r || L(e, 4, this.length), ve(this, e, !0, 23, 4);
|
|
599
599
|
};
|
|
600
|
-
|
|
601
|
-
return r ||
|
|
600
|
+
u.prototype.readFloatBE = function(e, r) {
|
|
601
|
+
return r || L(e, 4, this.length), ve(this, e, !1, 23, 4);
|
|
602
602
|
};
|
|
603
|
-
|
|
604
|
-
return r ||
|
|
603
|
+
u.prototype.readDoubleLE = function(e, r) {
|
|
604
|
+
return r || L(e, 8, this.length), ve(this, e, !0, 52, 8);
|
|
605
605
|
};
|
|
606
|
-
|
|
607
|
-
return r ||
|
|
606
|
+
u.prototype.readDoubleBE = function(e, r) {
|
|
607
|
+
return r || L(e, 8, this.length), ve(this, e, !1, 52, 8);
|
|
608
608
|
};
|
|
609
609
|
function D(t, e, r, n, i, o) {
|
|
610
610
|
if (!$(t)) throw new TypeError('"buffer" argument must be a Buffer instance');
|
|
611
611
|
if (e > i || e < o) throw new RangeError('"value" argument is out of bounds');
|
|
612
612
|
if (r + n > t.length) throw new RangeError("Index out of range");
|
|
613
613
|
}
|
|
614
|
-
|
|
614
|
+
u.prototype.writeUIntLE = function(e, r, n, i) {
|
|
615
615
|
if (e = +e, r = r | 0, n = n | 0, !i) {
|
|
616
616
|
var o = Math.pow(2, 8 * n) - 1;
|
|
617
617
|
D(this, e, r, n, o, 0);
|
|
@@ -621,7 +621,7 @@ a.prototype.writeUIntLE = function(e, r, n, i) {
|
|
|
621
621
|
this[r + f] = e / s & 255;
|
|
622
622
|
return r + n;
|
|
623
623
|
};
|
|
624
|
-
|
|
624
|
+
u.prototype.writeUIntBE = function(e, r, n, i) {
|
|
625
625
|
if (e = +e, r = r | 0, n = n | 0, !i) {
|
|
626
626
|
var o = Math.pow(2, 8 * n) - 1;
|
|
627
627
|
D(this, e, r, n, o, 0);
|
|
@@ -631,89 +631,89 @@ a.prototype.writeUIntBE = function(e, r, n, i) {
|
|
|
631
631
|
this[r + s] = e / f & 255;
|
|
632
632
|
return r + n;
|
|
633
633
|
};
|
|
634
|
-
|
|
635
|
-
return e = +e, r = r | 0, n || D(this, e, r, 1, 255, 0),
|
|
634
|
+
u.prototype.writeUInt8 = function(e, r, n) {
|
|
635
|
+
return e = +e, r = r | 0, n || D(this, e, r, 1, 255, 0), u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)), this[r] = e & 255, r + 1;
|
|
636
636
|
};
|
|
637
637
|
function be(t, e, r, n) {
|
|
638
638
|
e < 0 && (e = 65535 + e + 1);
|
|
639
639
|
for (var i = 0, o = Math.min(t.length - r, 2); i < o; ++i)
|
|
640
640
|
t[r + i] = (e & 255 << 8 * (n ? i : 1 - i)) >>> (n ? i : 1 - i) * 8;
|
|
641
641
|
}
|
|
642
|
-
|
|
643
|
-
return e = +e, r = r | 0, n || D(this, e, r, 2, 65535, 0),
|
|
642
|
+
u.prototype.writeUInt16LE = function(e, r, n) {
|
|
643
|
+
return e = +e, r = r | 0, n || D(this, e, r, 2, 65535, 0), u.TYPED_ARRAY_SUPPORT ? (this[r] = e & 255, this[r + 1] = e >>> 8) : be(this, e, r, !0), r + 2;
|
|
644
644
|
};
|
|
645
|
-
|
|
646
|
-
return e = +e, r = r | 0, n || D(this, e, r, 2, 65535, 0),
|
|
645
|
+
u.prototype.writeUInt16BE = function(e, r, n) {
|
|
646
|
+
return e = +e, r = r | 0, n || D(this, e, r, 2, 65535, 0), u.TYPED_ARRAY_SUPPORT ? (this[r] = e >>> 8, this[r + 1] = e & 255) : be(this, e, r, !1), r + 2;
|
|
647
647
|
};
|
|
648
648
|
function Ee(t, e, r, n) {
|
|
649
649
|
e < 0 && (e = 4294967295 + e + 1);
|
|
650
650
|
for (var i = 0, o = Math.min(t.length - r, 4); i < o; ++i)
|
|
651
651
|
t[r + i] = e >>> (n ? i : 3 - i) * 8 & 255;
|
|
652
652
|
}
|
|
653
|
-
|
|
654
|
-
return e = +e, r = r | 0, n || D(this, e, r, 4, 4294967295, 0),
|
|
653
|
+
u.prototype.writeUInt32LE = function(e, r, n) {
|
|
654
|
+
return e = +e, r = r | 0, n || D(this, e, r, 4, 4294967295, 0), u.TYPED_ARRAY_SUPPORT ? (this[r + 3] = e >>> 24, this[r + 2] = e >>> 16, this[r + 1] = e >>> 8, this[r] = e & 255) : Ee(this, e, r, !0), r + 4;
|
|
655
655
|
};
|
|
656
|
-
|
|
657
|
-
return e = +e, r = r | 0, n || D(this, e, r, 4, 4294967295, 0),
|
|
656
|
+
u.prototype.writeUInt32BE = function(e, r, n) {
|
|
657
|
+
return e = +e, r = r | 0, n || D(this, e, r, 4, 4294967295, 0), u.TYPED_ARRAY_SUPPORT ? (this[r] = e >>> 24, this[r + 1] = e >>> 16, this[r + 2] = e >>> 8, this[r + 3] = e & 255) : Ee(this, e, r, !1), r + 4;
|
|
658
658
|
};
|
|
659
|
-
|
|
659
|
+
u.prototype.writeIntLE = function(e, r, n, i) {
|
|
660
660
|
if (e = +e, r = r | 0, !i) {
|
|
661
661
|
var o = Math.pow(2, 8 * n - 1);
|
|
662
662
|
D(this, e, r, n, o - 1, -o);
|
|
663
663
|
}
|
|
664
|
-
var s = 0, f = 1,
|
|
664
|
+
var s = 0, f = 1, a = 0;
|
|
665
665
|
for (this[r] = e & 255; ++s < n && (f *= 256); )
|
|
666
|
-
e < 0 &&
|
|
666
|
+
e < 0 && a === 0 && this[r + s - 1] !== 0 && (a = 1), this[r + s] = (e / f >> 0) - a & 255;
|
|
667
667
|
return r + n;
|
|
668
668
|
};
|
|
669
|
-
|
|
669
|
+
u.prototype.writeIntBE = function(e, r, n, i) {
|
|
670
670
|
if (e = +e, r = r | 0, !i) {
|
|
671
671
|
var o = Math.pow(2, 8 * n - 1);
|
|
672
672
|
D(this, e, r, n, o - 1, -o);
|
|
673
673
|
}
|
|
674
|
-
var s = n - 1, f = 1,
|
|
674
|
+
var s = n - 1, f = 1, a = 0;
|
|
675
675
|
for (this[r + s] = e & 255; --s >= 0 && (f *= 256); )
|
|
676
|
-
e < 0 &&
|
|
676
|
+
e < 0 && a === 0 && this[r + s + 1] !== 0 && (a = 1), this[r + s] = (e / f >> 0) - a & 255;
|
|
677
677
|
return r + n;
|
|
678
678
|
};
|
|
679
|
-
|
|
680
|
-
return e = +e, r = r | 0, n || D(this, e, r, 1, 127, -128),
|
|
679
|
+
u.prototype.writeInt8 = function(e, r, n) {
|
|
680
|
+
return e = +e, r = r | 0, n || D(this, e, r, 1, 127, -128), u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)), e < 0 && (e = 255 + e + 1), this[r] = e & 255, r + 1;
|
|
681
681
|
};
|
|
682
|
-
|
|
683
|
-
return e = +e, r = r | 0, n || D(this, e, r, 2, 32767, -32768),
|
|
682
|
+
u.prototype.writeInt16LE = function(e, r, n) {
|
|
683
|
+
return e = +e, r = r | 0, n || D(this, e, r, 2, 32767, -32768), u.TYPED_ARRAY_SUPPORT ? (this[r] = e & 255, this[r + 1] = e >>> 8) : be(this, e, r, !0), r + 2;
|
|
684
684
|
};
|
|
685
|
-
|
|
686
|
-
return e = +e, r = r | 0, n || D(this, e, r, 2, 32767, -32768),
|
|
685
|
+
u.prototype.writeInt16BE = function(e, r, n) {
|
|
686
|
+
return e = +e, r = r | 0, n || D(this, e, r, 2, 32767, -32768), u.TYPED_ARRAY_SUPPORT ? (this[r] = e >>> 8, this[r + 1] = e & 255) : be(this, e, r, !1), r + 2;
|
|
687
687
|
};
|
|
688
|
-
|
|
689
|
-
return e = +e, r = r | 0, n || D(this, e, r, 4, 2147483647, -2147483648),
|
|
688
|
+
u.prototype.writeInt32LE = function(e, r, n) {
|
|
689
|
+
return e = +e, r = r | 0, n || D(this, e, r, 4, 2147483647, -2147483648), u.TYPED_ARRAY_SUPPORT ? (this[r] = e & 255, this[r + 1] = e >>> 8, this[r + 2] = e >>> 16, this[r + 3] = e >>> 24) : Ee(this, e, r, !0), r + 4;
|
|
690
690
|
};
|
|
691
|
-
|
|
692
|
-
return e = +e, r = r | 0, n || D(this, e, r, 4, 2147483647, -2147483648), e < 0 && (e = 4294967295 + e + 1),
|
|
691
|
+
u.prototype.writeInt32BE = function(e, r, n) {
|
|
692
|
+
return e = +e, r = r | 0, n || D(this, e, r, 4, 2147483647, -2147483648), e < 0 && (e = 4294967295 + e + 1), u.TYPED_ARRAY_SUPPORT ? (this[r] = e >>> 24, this[r + 1] = e >>> 16, this[r + 2] = e >>> 8, this[r + 3] = e & 255) : Ee(this, e, r, !1), r + 4;
|
|
693
693
|
};
|
|
694
|
-
function
|
|
694
|
+
function vt(t, e, r, n, i, o) {
|
|
695
695
|
if (r + n > t.length) throw new RangeError("Index out of range");
|
|
696
696
|
if (r < 0) throw new RangeError("Index out of range");
|
|
697
697
|
}
|
|
698
|
-
function vt(t, e, r, n, i) {
|
|
699
|
-
return i || yt(t, e, r, 4), ht(t, e, r, n, 23, 4), r + 4;
|
|
700
|
-
}
|
|
701
|
-
a.prototype.writeFloatLE = function(e, r, n) {
|
|
702
|
-
return vt(this, e, r, !0, n);
|
|
703
|
-
};
|
|
704
|
-
a.prototype.writeFloatBE = function(e, r, n) {
|
|
705
|
-
return vt(this, e, r, !1, n);
|
|
706
|
-
};
|
|
707
698
|
function bt(t, e, r, n, i) {
|
|
708
|
-
return i ||
|
|
699
|
+
return i || vt(t, e, r, 4), ct(t, e, r, n, 23, 4), r + 4;
|
|
709
700
|
}
|
|
710
|
-
|
|
701
|
+
u.prototype.writeFloatLE = function(e, r, n) {
|
|
711
702
|
return bt(this, e, r, !0, n);
|
|
712
703
|
};
|
|
713
|
-
|
|
704
|
+
u.prototype.writeFloatBE = function(e, r, n) {
|
|
714
705
|
return bt(this, e, r, !1, n);
|
|
715
706
|
};
|
|
716
|
-
|
|
707
|
+
function Et(t, e, r, n, i) {
|
|
708
|
+
return i || vt(t, e, r, 8), ct(t, e, r, n, 52, 8), r + 8;
|
|
709
|
+
}
|
|
710
|
+
u.prototype.writeDoubleLE = function(e, r, n) {
|
|
711
|
+
return Et(this, e, r, !0, n);
|
|
712
|
+
};
|
|
713
|
+
u.prototype.writeDoubleBE = function(e, r, n) {
|
|
714
|
+
return Et(this, e, r, !1, n);
|
|
715
|
+
};
|
|
716
|
+
u.prototype.copy = function(e, r, n, i) {
|
|
717
717
|
if (n || (n = 0), !i && i !== 0 && (i = this.length), r >= e.length && (r = e.length), r || (r = 0), i > 0 && i < n && (i = n), i === n || e.length === 0 || this.length === 0) return 0;
|
|
718
718
|
if (r < 0)
|
|
719
719
|
throw new RangeError("targetStart out of bounds");
|
|
@@ -724,7 +724,7 @@ a.prototype.copy = function(e, r, n, i) {
|
|
|
724
724
|
if (this === e && n < r && r < i)
|
|
725
725
|
for (s = o - 1; s >= 0; --s)
|
|
726
726
|
e[s + r] = this[s + n];
|
|
727
|
-
else if (o < 1e3 || !
|
|
727
|
+
else if (o < 1e3 || !u.TYPED_ARRAY_SUPPORT)
|
|
728
728
|
for (s = 0; s < o; ++s)
|
|
729
729
|
e[s + r] = this[s + n];
|
|
730
730
|
else
|
|
@@ -735,7 +735,7 @@ a.prototype.copy = function(e, r, n, i) {
|
|
|
735
735
|
);
|
|
736
736
|
return o;
|
|
737
737
|
};
|
|
738
|
-
|
|
738
|
+
u.prototype.fill = function(e, r, n, i) {
|
|
739
739
|
if (typeof e == "string") {
|
|
740
740
|
if (typeof r == "string" ? (i = r, r = 0, n = this.length) : typeof n == "string" && (i = n, n = this.length), e.length === 1) {
|
|
741
741
|
var o = e.charCodeAt(0);
|
|
@@ -743,7 +743,7 @@ a.prototype.fill = function(e, r, n, i) {
|
|
|
743
743
|
}
|
|
744
744
|
if (i !== void 0 && typeof i != "string")
|
|
745
745
|
throw new TypeError("encoding must be a string");
|
|
746
|
-
if (typeof i == "string" && !
|
|
746
|
+
if (typeof i == "string" && !u.isEncoding(i))
|
|
747
747
|
throw new TypeError("Unknown encoding: " + i);
|
|
748
748
|
} else typeof e == "number" && (e = e & 255);
|
|
749
749
|
if (r < 0 || this.length < r || this.length < n)
|
|
@@ -756,23 +756,23 @@ a.prototype.fill = function(e, r, n, i) {
|
|
|
756
756
|
for (s = r; s < n; ++s)
|
|
757
757
|
this[s] = e;
|
|
758
758
|
else {
|
|
759
|
-
var f = $(e) ? e : we(new
|
|
759
|
+
var f = $(e) ? e : we(new u(e, i).toString()), a = f.length;
|
|
760
760
|
for (s = 0; s < n - r; ++s)
|
|
761
|
-
this[s + r] = f[s %
|
|
761
|
+
this[s + r] = f[s % a];
|
|
762
762
|
}
|
|
763
763
|
return this;
|
|
764
764
|
};
|
|
765
|
-
var
|
|
766
|
-
function
|
|
767
|
-
if (t =
|
|
765
|
+
var wr = /[^+\/0-9A-Za-z-_]/g;
|
|
766
|
+
function yr(t) {
|
|
767
|
+
if (t = vr(t).replace(wr, ""), t.length < 2) return "";
|
|
768
768
|
for (; t.length % 4 !== 0; )
|
|
769
769
|
t = t + "=";
|
|
770
770
|
return t;
|
|
771
771
|
}
|
|
772
|
-
function
|
|
772
|
+
function vr(t) {
|
|
773
773
|
return t.trim ? t.trim() : t.replace(/^\s+|\s+$/g, "");
|
|
774
774
|
}
|
|
775
|
-
function
|
|
775
|
+
function br(t) {
|
|
776
776
|
return t < 16 ? "0" + t.toString(16) : t.toString(16);
|
|
777
777
|
}
|
|
778
778
|
function we(t, e) {
|
|
@@ -825,35 +825,35 @@ function we(t, e) {
|
|
|
825
825
|
}
|
|
826
826
|
return o;
|
|
827
827
|
}
|
|
828
|
-
function
|
|
828
|
+
function Er(t) {
|
|
829
829
|
for (var e = [], r = 0; r < t.length; ++r)
|
|
830
830
|
e.push(t.charCodeAt(r) & 255);
|
|
831
831
|
return e;
|
|
832
832
|
}
|
|
833
|
-
function
|
|
833
|
+
function xr(t, e) {
|
|
834
834
|
for (var r, n, i, o = [], s = 0; s < t.length && !((e -= 2) < 0); ++s)
|
|
835
835
|
r = t.charCodeAt(s), n = r >> 8, i = r % 256, o.push(i), o.push(n);
|
|
836
836
|
return o;
|
|
837
837
|
}
|
|
838
|
-
function
|
|
839
|
-
return
|
|
838
|
+
function xt(t) {
|
|
839
|
+
return Zt(yr(t));
|
|
840
840
|
}
|
|
841
841
|
function xe(t, e, r, n) {
|
|
842
842
|
for (var i = 0; i < n && !(i + r >= e.length || i >= t.length); ++i)
|
|
843
843
|
e[i + r] = t[i];
|
|
844
844
|
return i;
|
|
845
845
|
}
|
|
846
|
-
function
|
|
846
|
+
function Sr(t) {
|
|
847
847
|
return t !== t;
|
|
848
848
|
}
|
|
849
849
|
function N(t) {
|
|
850
|
-
return t != null && (!!t._isBuffer ||
|
|
850
|
+
return t != null && (!!t._isBuffer || St(t) || Rr(t));
|
|
851
851
|
}
|
|
852
|
-
function
|
|
852
|
+
function St(t) {
|
|
853
853
|
return !!t.constructor && typeof t.constructor.isBuffer == "function" && t.constructor.isBuffer(t);
|
|
854
854
|
}
|
|
855
|
-
function
|
|
856
|
-
return typeof t.readFloatLE == "function" && typeof t.slice == "function" &&
|
|
855
|
+
function Rr(t) {
|
|
856
|
+
return typeof t.readFloatLE == "function" && typeof t.slice == "function" && St(t.slice(0, 0));
|
|
857
857
|
}
|
|
858
858
|
var Oe;
|
|
859
859
|
function H() {
|
|
@@ -876,41 +876,41 @@ p.prototype.setMaxListeners = function(e) {
|
|
|
876
876
|
throw new TypeError('"n" argument must be a positive number');
|
|
877
877
|
return this._maxListeners = e, this;
|
|
878
878
|
};
|
|
879
|
-
function
|
|
879
|
+
function Rt(t) {
|
|
880
880
|
return t._maxListeners === void 0 ? p.defaultMaxListeners : t._maxListeners;
|
|
881
881
|
}
|
|
882
882
|
p.prototype.getMaxListeners = function() {
|
|
883
|
-
return
|
|
883
|
+
return Rt(this);
|
|
884
884
|
};
|
|
885
|
-
function
|
|
885
|
+
function Ir(t, e, r) {
|
|
886
886
|
if (e)
|
|
887
887
|
t.call(r);
|
|
888
888
|
else
|
|
889
889
|
for (var n = t.length, i = ae(t, n), o = 0; o < n; ++o)
|
|
890
890
|
i[o].call(r);
|
|
891
891
|
}
|
|
892
|
-
function
|
|
892
|
+
function Or(t, e, r, n) {
|
|
893
893
|
if (e)
|
|
894
894
|
t.call(r, n);
|
|
895
895
|
else
|
|
896
896
|
for (var i = t.length, o = ae(t, i), s = 0; s < i; ++s)
|
|
897
897
|
o[s].call(r, n);
|
|
898
898
|
}
|
|
899
|
-
function
|
|
899
|
+
function Cr(t, e, r, n, i) {
|
|
900
900
|
if (e)
|
|
901
901
|
t.call(r, n, i);
|
|
902
902
|
else
|
|
903
903
|
for (var o = t.length, s = ae(t, o), f = 0; f < o; ++f)
|
|
904
904
|
s[f].call(r, n, i);
|
|
905
905
|
}
|
|
906
|
-
function
|
|
906
|
+
function Ar(t, e, r, n, i, o) {
|
|
907
907
|
if (e)
|
|
908
908
|
t.call(r, n, i, o);
|
|
909
909
|
else
|
|
910
|
-
for (var s = t.length, f = ae(t, s),
|
|
911
|
-
f[
|
|
910
|
+
for (var s = t.length, f = ae(t, s), a = 0; a < s; ++a)
|
|
911
|
+
f[a].call(r, n, i, o);
|
|
912
912
|
}
|
|
913
|
-
function
|
|
913
|
+
function Lr(t, e, r, n) {
|
|
914
914
|
if (e)
|
|
915
915
|
t.apply(r, n);
|
|
916
916
|
else
|
|
@@ -918,14 +918,14 @@ function Ar(t, e, r, n) {
|
|
|
918
918
|
o[s].apply(r, n);
|
|
919
919
|
}
|
|
920
920
|
p.prototype.emit = function(e) {
|
|
921
|
-
var r, n, i, o, s, f,
|
|
921
|
+
var r, n, i, o, s, f, a, l = e === "error";
|
|
922
922
|
if (f = this._events, f)
|
|
923
923
|
l = l && f.error == null;
|
|
924
924
|
else if (!l)
|
|
925
925
|
return !1;
|
|
926
|
-
if (
|
|
927
|
-
if (r = arguments[1],
|
|
928
|
-
r || (r = new Error('Uncaught, unspecified "error" event')), r.domainEmitter = this, r.domain =
|
|
926
|
+
if (a = this.domain, l) {
|
|
927
|
+
if (r = arguments[1], a)
|
|
928
|
+
r || (r = new Error('Uncaught, unspecified "error" event')), r.domainEmitter = this, r.domain = a, r.domainThrown = !1, a.emit("error", r);
|
|
929
929
|
else {
|
|
930
930
|
if (r instanceof Error)
|
|
931
931
|
throw r;
|
|
@@ -940,26 +940,26 @@ p.prototype.emit = function(e) {
|
|
|
940
940
|
switch (i = arguments.length, i) {
|
|
941
941
|
// fast cases
|
|
942
942
|
case 1:
|
|
943
|
-
|
|
943
|
+
Ir(n, c, this);
|
|
944
944
|
break;
|
|
945
945
|
case 2:
|
|
946
|
-
|
|
946
|
+
Or(n, c, this, arguments[1]);
|
|
947
947
|
break;
|
|
948
948
|
case 3:
|
|
949
|
-
|
|
949
|
+
Cr(n, c, this, arguments[1], arguments[2]);
|
|
950
950
|
break;
|
|
951
951
|
case 4:
|
|
952
|
-
|
|
952
|
+
Ar(n, c, this, arguments[1], arguments[2], arguments[3]);
|
|
953
953
|
break;
|
|
954
954
|
// slower
|
|
955
955
|
default:
|
|
956
956
|
for (o = new Array(i - 1), s = 1; s < i; s++)
|
|
957
957
|
o[s - 1] = arguments[s];
|
|
958
|
-
|
|
958
|
+
Lr(n, c, this, o);
|
|
959
959
|
}
|
|
960
960
|
return !0;
|
|
961
961
|
};
|
|
962
|
-
function
|
|
962
|
+
function It(t, e, r, n) {
|
|
963
963
|
var i, o, s;
|
|
964
964
|
if (typeof r != "function")
|
|
965
965
|
throw new TypeError('"listener" argument must be a function');
|
|
@@ -969,7 +969,7 @@ function Rt(t, e, r, n) {
|
|
|
969
969
|
r.listener ? r.listener : r
|
|
970
970
|
), o = t._events), s = o[e]) : (o = t._events = new H(), t._eventsCount = 0), !s)
|
|
971
971
|
s = o[e] = r, ++t._eventsCount;
|
|
972
|
-
else if (typeof s == "function" ? s = o[e] = n ? [r, s] : [s, r] : n ? s.unshift(r) : s.push(r), !s.warned && (i =
|
|
972
|
+
else if (typeof s == "function" ? s = o[e] = n ? [r, s] : [s, r] : n ? s.unshift(r) : s.push(r), !s.warned && (i = Rt(t), i && i > 0 && s.length > i)) {
|
|
973
973
|
s.warned = !0;
|
|
974
974
|
var f = new Error("Possible EventEmitter memory leak detected. " + s.length + " " + e + " listeners added. Use emitter.setMaxListeners() to increase limit");
|
|
975
975
|
f.name = "MaxListenersExceededWarning", f.emitter = t, f.type = e, f.count = s.length, Tr(f);
|
|
@@ -980,13 +980,13 @@ function Tr(t) {
|
|
|
980
980
|
typeof console.warn == "function" ? console.warn(t) : console.log(t);
|
|
981
981
|
}
|
|
982
982
|
p.prototype.addListener = function(e, r) {
|
|
983
|
-
return
|
|
983
|
+
return It(this, e, r, !1);
|
|
984
984
|
};
|
|
985
985
|
p.prototype.on = p.prototype.addListener;
|
|
986
986
|
p.prototype.prependListener = function(e, r) {
|
|
987
|
-
return
|
|
987
|
+
return It(this, e, r, !0);
|
|
988
988
|
};
|
|
989
|
-
function
|
|
989
|
+
function Ot(t, e, r) {
|
|
990
990
|
var n = !1;
|
|
991
991
|
function i() {
|
|
992
992
|
t.removeListener(e, i), n || (n = !0, r.apply(t, arguments));
|
|
@@ -996,12 +996,12 @@ function It(t, e, r) {
|
|
|
996
996
|
p.prototype.once = function(e, r) {
|
|
997
997
|
if (typeof r != "function")
|
|
998
998
|
throw new TypeError('"listener" argument must be a function');
|
|
999
|
-
return this.on(e,
|
|
999
|
+
return this.on(e, Ot(this, e, r)), this;
|
|
1000
1000
|
};
|
|
1001
1001
|
p.prototype.prependOnceListener = function(e, r) {
|
|
1002
1002
|
if (typeof r != "function")
|
|
1003
1003
|
throw new TypeError('"listener" argument must be a function');
|
|
1004
|
-
return this.prependListener(e,
|
|
1004
|
+
return this.prependListener(e, Ot(this, e, r)), this;
|
|
1005
1005
|
};
|
|
1006
1006
|
p.prototype.removeListener = function(e, r) {
|
|
1007
1007
|
var n, i, o, s, f;
|
|
@@ -1026,7 +1026,7 @@ p.prototype.removeListener = function(e, r) {
|
|
|
1026
1026
|
return this._events = new H(), this;
|
|
1027
1027
|
delete i[e];
|
|
1028
1028
|
} else
|
|
1029
|
-
|
|
1029
|
+
Nr(n, o);
|
|
1030
1030
|
i.removeListener && this.emit("removeListener", e, f || r);
|
|
1031
1031
|
}
|
|
1032
1032
|
return this;
|
|
@@ -1052,13 +1052,13 @@ p.prototype.removeAllListeners = function(e) {
|
|
|
1052
1052
|
};
|
|
1053
1053
|
p.prototype.listeners = function(e) {
|
|
1054
1054
|
var r, n, i = this._events;
|
|
1055
|
-
return i ? (r = i[e], r ? typeof r == "function" ? n = [r.listener || r] : n =
|
|
1055
|
+
return i ? (r = i[e], r ? typeof r == "function" ? n = [r.listener || r] : n = Dr(r) : n = []) : n = [], n;
|
|
1056
1056
|
};
|
|
1057
1057
|
p.listenerCount = function(t, e) {
|
|
1058
|
-
return typeof t.listenerCount == "function" ? t.listenerCount(e) :
|
|
1058
|
+
return typeof t.listenerCount == "function" ? t.listenerCount(e) : Ct.call(t, e);
|
|
1059
1059
|
};
|
|
1060
|
-
p.prototype.listenerCount =
|
|
1061
|
-
function
|
|
1060
|
+
p.prototype.listenerCount = Ct;
|
|
1061
|
+
function Ct(t) {
|
|
1062
1062
|
var e = this._events;
|
|
1063
1063
|
if (e) {
|
|
1064
1064
|
var r = e[t];
|
|
@@ -1072,7 +1072,7 @@ function Ot(t) {
|
|
|
1072
1072
|
p.prototype.eventNames = function() {
|
|
1073
1073
|
return this._eventsCount > 0 ? Reflect.ownKeys(this._events) : [];
|
|
1074
1074
|
};
|
|
1075
|
-
function
|
|
1075
|
+
function Nr(t, e) {
|
|
1076
1076
|
for (var r = e, n = r + 1, i = t.length; n < i; r += 1, n += 1)
|
|
1077
1077
|
t[r] = t[n];
|
|
1078
1078
|
t.pop();
|
|
@@ -1082,24 +1082,24 @@ function ae(t, e) {
|
|
|
1082
1082
|
r[e] = t[e];
|
|
1083
1083
|
return r;
|
|
1084
1084
|
}
|
|
1085
|
-
function
|
|
1085
|
+
function Dr(t) {
|
|
1086
1086
|
for (var e = new Array(t.length), r = 0; r < e.length; ++r)
|
|
1087
1087
|
e[r] = t[r].listener || t[r];
|
|
1088
1088
|
return e;
|
|
1089
1089
|
}
|
|
1090
|
-
function
|
|
1090
|
+
function At() {
|
|
1091
1091
|
throw new Error("setTimeout has not been defined");
|
|
1092
1092
|
}
|
|
1093
|
-
function
|
|
1093
|
+
function Lt() {
|
|
1094
1094
|
throw new Error("clearTimeout has not been defined");
|
|
1095
1095
|
}
|
|
1096
|
-
var Y =
|
|
1096
|
+
var Y = At, W = Lt;
|
|
1097
1097
|
typeof ie.setTimeout == "function" && (Y = setTimeout);
|
|
1098
1098
|
typeof ie.clearTimeout == "function" && (W = clearTimeout);
|
|
1099
1099
|
function Tt(t) {
|
|
1100
1100
|
if (Y === setTimeout)
|
|
1101
1101
|
return setTimeout(t, 0);
|
|
1102
|
-
if ((Y ===
|
|
1102
|
+
if ((Y === At || !Y) && setTimeout)
|
|
1103
1103
|
return Y = setTimeout, setTimeout(t, 0);
|
|
1104
1104
|
try {
|
|
1105
1105
|
return Y(t, 0);
|
|
@@ -1111,10 +1111,10 @@ function Tt(t) {
|
|
|
1111
1111
|
}
|
|
1112
1112
|
}
|
|
1113
1113
|
}
|
|
1114
|
-
function
|
|
1114
|
+
function Fr(t) {
|
|
1115
1115
|
if (W === clearTimeout)
|
|
1116
1116
|
return clearTimeout(t);
|
|
1117
|
-
if ((W ===
|
|
1117
|
+
if ((W === Lt || !W) && clearTimeout)
|
|
1118
1118
|
return W = clearTimeout, clearTimeout(t);
|
|
1119
1119
|
try {
|
|
1120
1120
|
return W(t);
|
|
@@ -1126,20 +1126,20 @@ function Dr(t) {
|
|
|
1126
1126
|
}
|
|
1127
1127
|
}
|
|
1128
1128
|
}
|
|
1129
|
-
var z = [], ne = !1, ee,
|
|
1130
|
-
function
|
|
1131
|
-
!ne || !ee || (ne = !1, ee.length ? z = ee.concat(z) :
|
|
1129
|
+
var z = [], ne = !1, ee, me = -1;
|
|
1130
|
+
function Mr() {
|
|
1131
|
+
!ne || !ee || (ne = !1, ee.length ? z = ee.concat(z) : me = -1, z.length && Nt());
|
|
1132
1132
|
}
|
|
1133
|
-
function
|
|
1133
|
+
function Nt() {
|
|
1134
1134
|
if (!ne) {
|
|
1135
|
-
var t = Tt(
|
|
1135
|
+
var t = Tt(Mr);
|
|
1136
1136
|
ne = !0;
|
|
1137
1137
|
for (var e = z.length; e; ) {
|
|
1138
|
-
for (ee = z, z = []; ++
|
|
1139
|
-
ee && ee[
|
|
1140
|
-
|
|
1138
|
+
for (ee = z, z = []; ++me < e; )
|
|
1139
|
+
ee && ee[me].run();
|
|
1140
|
+
me = -1, e = z.length;
|
|
1141
1141
|
}
|
|
1142
|
-
ee = null, ne = !1,
|
|
1142
|
+
ee = null, ne = !1, Fr(t);
|
|
1143
1143
|
}
|
|
1144
1144
|
}
|
|
1145
1145
|
function B(t) {
|
|
@@ -1147,20 +1147,20 @@ function B(t) {
|
|
|
1147
1147
|
if (arguments.length > 1)
|
|
1148
1148
|
for (var r = 1; r < arguments.length; r++)
|
|
1149
1149
|
e[r - 1] = arguments[r];
|
|
1150
|
-
z.push(new
|
|
1150
|
+
z.push(new Dt(t, e)), z.length === 1 && !ne && Tt(Nt);
|
|
1151
1151
|
}
|
|
1152
|
-
function
|
|
1152
|
+
function Dt(t, e) {
|
|
1153
1153
|
this.fun = t, this.array = e;
|
|
1154
1154
|
}
|
|
1155
|
-
|
|
1155
|
+
Dt.prototype.run = function() {
|
|
1156
1156
|
this.fun.apply(null, this.array);
|
|
1157
1157
|
};
|
|
1158
|
-
var
|
|
1158
|
+
var Br = {}, se = ie.performance || {};
|
|
1159
1159
|
se.now || se.mozNow || se.msNow || se.oNow || se.webkitNow;
|
|
1160
|
-
var
|
|
1161
|
-
env:
|
|
1162
|
-
},
|
|
1163
|
-
typeof Object.create == "function" ?
|
|
1160
|
+
var ge = {
|
|
1161
|
+
env: Br
|
|
1162
|
+
}, ke;
|
|
1163
|
+
typeof Object.create == "function" ? ke = function(e, r) {
|
|
1164
1164
|
e.super_ = r, e.prototype = Object.create(r.prototype, {
|
|
1165
1165
|
constructor: {
|
|
1166
1166
|
value: e,
|
|
@@ -1169,20 +1169,20 @@ typeof Object.create == "function" ? Ue = function(e, r) {
|
|
|
1169
1169
|
configurable: !0
|
|
1170
1170
|
}
|
|
1171
1171
|
});
|
|
1172
|
-
} :
|
|
1172
|
+
} : ke = function(e, r) {
|
|
1173
1173
|
e.super_ = r;
|
|
1174
1174
|
var n = function() {
|
|
1175
1175
|
};
|
|
1176
1176
|
n.prototype = r.prototype, e.prototype = new n(), e.prototype.constructor = e;
|
|
1177
1177
|
};
|
|
1178
|
-
var oe =
|
|
1179
|
-
function
|
|
1180
|
-
if (!
|
|
1178
|
+
var oe = ke, Ur = /%[sdj%]/g;
|
|
1179
|
+
function kr(t) {
|
|
1180
|
+
if (!Je(t)) {
|
|
1181
1181
|
for (var e = [], r = 0; r < arguments.length; r++)
|
|
1182
1182
|
e.push(G(arguments[r]));
|
|
1183
1183
|
return e.join(" ");
|
|
1184
1184
|
}
|
|
1185
|
-
for (var r = 1, n = arguments, i = n.length, o = String(t).replace(
|
|
1185
|
+
for (var r = 1, n = arguments, i = n.length, o = String(t).replace(Ur, function(f) {
|
|
1186
1186
|
if (f === "%%") return "%";
|
|
1187
1187
|
if (r >= i) return f;
|
|
1188
1188
|
switch (f) {
|
|
@@ -1200,34 +1200,34 @@ function Ur(t) {
|
|
|
1200
1200
|
return f;
|
|
1201
1201
|
}
|
|
1202
1202
|
}), s = n[r]; r < i; s = n[++r])
|
|
1203
|
-
|
|
1203
|
+
Ve(s) || !ue(s) ? o += " " + s : o += " " + G(s);
|
|
1204
1204
|
return o;
|
|
1205
1205
|
}
|
|
1206
|
-
function
|
|
1206
|
+
function Ft(t, e) {
|
|
1207
1207
|
if (Q(ie.process))
|
|
1208
1208
|
return function() {
|
|
1209
|
-
return
|
|
1209
|
+
return Ft(t, e).apply(this, arguments);
|
|
1210
1210
|
};
|
|
1211
|
-
if (
|
|
1211
|
+
if (ge.noDeprecation === !0)
|
|
1212
1212
|
return t;
|
|
1213
1213
|
var r = !1;
|
|
1214
1214
|
function n() {
|
|
1215
1215
|
if (!r) {
|
|
1216
|
-
if (
|
|
1216
|
+
if (ge.throwDeprecation)
|
|
1217
1217
|
throw new Error(e);
|
|
1218
|
-
|
|
1218
|
+
ge.traceDeprecation ? console.trace(e) : console.error(e), r = !0;
|
|
1219
1219
|
}
|
|
1220
1220
|
return t.apply(this, arguments);
|
|
1221
1221
|
}
|
|
1222
1222
|
return n;
|
|
1223
1223
|
}
|
|
1224
1224
|
var pe = {}, Ce;
|
|
1225
|
-
function
|
|
1226
|
-
if (Q(Ce) && (Ce =
|
|
1225
|
+
function Pr(t) {
|
|
1226
|
+
if (Q(Ce) && (Ce = ge.env.NODE_DEBUG || ""), t = t.toUpperCase(), !pe[t])
|
|
1227
1227
|
if (new RegExp("\\b" + t + "\\b", "i").test(Ce)) {
|
|
1228
1228
|
var e = 0;
|
|
1229
1229
|
pe[t] = function() {
|
|
1230
|
-
var r =
|
|
1230
|
+
var r = kr.apply(null, arguments);
|
|
1231
1231
|
console.error("%s %d: %s", t, e, r);
|
|
1232
1232
|
};
|
|
1233
1233
|
} else
|
|
@@ -1238,9 +1238,9 @@ function kr(t) {
|
|
|
1238
1238
|
function G(t, e) {
|
|
1239
1239
|
var r = {
|
|
1240
1240
|
seen: [],
|
|
1241
|
-
stylize:
|
|
1241
|
+
stylize: jr
|
|
1242
1242
|
};
|
|
1243
|
-
return arguments.length >= 3 && (r.depth = arguments[2]), arguments.length >= 4 && (r.colors = arguments[3]),
|
|
1243
|
+
return arguments.length >= 3 && (r.depth = arguments[2]), arguments.length >= 4 && (r.colors = arguments[3]), Mt(e) ? r.showHidden = e : e && Qr(r, e), Q(r.showHidden) && (r.showHidden = !1), Q(r.depth) && (r.depth = 2), Q(r.colors) && (r.colors = !1), Q(r.customInspect) && (r.customInspect = !0), r.colors && (r.stylize = $r), ye(r, t, r.depth);
|
|
1244
1244
|
}
|
|
1245
1245
|
G.colors = {
|
|
1246
1246
|
bold: [1, 22],
|
|
@@ -1268,14 +1268,14 @@ G.styles = {
|
|
|
1268
1268
|
// "name": intentionally not styling
|
|
1269
1269
|
regexp: "red"
|
|
1270
1270
|
};
|
|
1271
|
-
function
|
|
1271
|
+
function $r(t, e) {
|
|
1272
1272
|
var r = G.styles[e];
|
|
1273
1273
|
return r ? "\x1B[" + G.colors[r][0] + "m" + t + "\x1B[" + G.colors[r][1] + "m" : t;
|
|
1274
1274
|
}
|
|
1275
|
-
function
|
|
1275
|
+
function jr(t, e) {
|
|
1276
1276
|
return t;
|
|
1277
1277
|
}
|
|
1278
|
-
function
|
|
1278
|
+
function qr(t) {
|
|
1279
1279
|
var e = {};
|
|
1280
1280
|
return t.forEach(function(r, n) {
|
|
1281
1281
|
e[r] = !0;
|
|
@@ -1286,61 +1286,61 @@ function ye(t, e, r) {
|
|
|
1286
1286
|
e.inspect !== G && // Also filter out any prototype objects using the circular check.
|
|
1287
1287
|
!(e.constructor && e.constructor.prototype === e)) {
|
|
1288
1288
|
var n = e.inspect(r, t);
|
|
1289
|
-
return
|
|
1289
|
+
return Je(n) || (n = ye(t, n, r)), n;
|
|
1290
1290
|
}
|
|
1291
|
-
var i =
|
|
1291
|
+
var i = zr(t, e);
|
|
1292
1292
|
if (i)
|
|
1293
1293
|
return i;
|
|
1294
|
-
var o = Object.keys(e), s =
|
|
1295
|
-
if (t.showHidden && (o = Object.getOwnPropertyNames(e)),
|
|
1294
|
+
var o = Object.keys(e), s = qr(o);
|
|
1295
|
+
if (t.showHidden && (o = Object.getOwnPropertyNames(e)), Te(e) && (o.indexOf("message") >= 0 || o.indexOf("description") >= 0))
|
|
1296
1296
|
return Ae(e);
|
|
1297
1297
|
if (o.length === 0) {
|
|
1298
1298
|
if (Ne(e)) {
|
|
1299
1299
|
var f = e.name ? ": " + e.name : "";
|
|
1300
1300
|
return t.stylize("[Function" + f + "]", "special");
|
|
1301
1301
|
}
|
|
1302
|
-
if (
|
|
1302
|
+
if (Le(e))
|
|
1303
1303
|
return t.stylize(RegExp.prototype.toString.call(e), "regexp");
|
|
1304
|
-
if (
|
|
1304
|
+
if (Ke(e))
|
|
1305
1305
|
return t.stylize(Date.prototype.toString.call(e), "date");
|
|
1306
|
-
if (
|
|
1306
|
+
if (Te(e))
|
|
1307
1307
|
return Ae(e);
|
|
1308
1308
|
}
|
|
1309
|
-
var
|
|
1310
|
-
if (
|
|
1309
|
+
var a = "", l = !1, h = ["{", "}"];
|
|
1310
|
+
if (Yr(e) && (l = !0, h = ["[", "]"]), Ne(e)) {
|
|
1311
1311
|
var c = e.name ? ": " + e.name : "";
|
|
1312
|
-
|
|
1312
|
+
a = " [Function" + c + "]";
|
|
1313
1313
|
}
|
|
1314
|
-
if (
|
|
1315
|
-
return h[0] +
|
|
1314
|
+
if (Le(e) && (a = " " + RegExp.prototype.toString.call(e)), Ke(e) && (a = " " + Date.prototype.toUTCString.call(e)), Te(e) && (a = " " + Ae(e)), o.length === 0 && (!l || e.length == 0))
|
|
1315
|
+
return h[0] + a + h[1];
|
|
1316
1316
|
if (r < 0)
|
|
1317
|
-
return
|
|
1317
|
+
return Le(e) ? t.stylize(RegExp.prototype.toString.call(e), "regexp") : t.stylize("[Object]", "special");
|
|
1318
1318
|
t.seen.push(e);
|
|
1319
|
-
var
|
|
1320
|
-
return l ?
|
|
1321
|
-
return
|
|
1322
|
-
}), t.seen.pop(),
|
|
1319
|
+
var m;
|
|
1320
|
+
return l ? m = Vr(t, e, r, s, o) : m = o.map(function(y) {
|
|
1321
|
+
return Pe(t, e, r, s, y, l);
|
|
1322
|
+
}), t.seen.pop(), Jr(m, a, h);
|
|
1323
1323
|
}
|
|
1324
|
-
function
|
|
1324
|
+
function zr(t, e) {
|
|
1325
1325
|
if (Q(e))
|
|
1326
1326
|
return t.stylize("undefined", "undefined");
|
|
1327
|
-
if (
|
|
1327
|
+
if (Je(e)) {
|
|
1328
1328
|
var r = "'" + JSON.stringify(e).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'";
|
|
1329
1329
|
return t.stylize(r, "string");
|
|
1330
1330
|
}
|
|
1331
|
-
if (
|
|
1331
|
+
if (Wr(e))
|
|
1332
1332
|
return t.stylize("" + e, "number");
|
|
1333
|
-
if (
|
|
1333
|
+
if (Mt(e))
|
|
1334
1334
|
return t.stylize("" + e, "boolean");
|
|
1335
|
-
if (
|
|
1335
|
+
if (Ve(e))
|
|
1336
1336
|
return t.stylize("null", "null");
|
|
1337
1337
|
}
|
|
1338
1338
|
function Ae(t) {
|
|
1339
1339
|
return "[" + Error.prototype.toString.call(t) + "]";
|
|
1340
1340
|
}
|
|
1341
|
-
function
|
|
1341
|
+
function Vr(t, e, r, n, i) {
|
|
1342
1342
|
for (var o = [], s = 0, f = e.length; s < f; ++s)
|
|
1343
|
-
|
|
1343
|
+
Bt(e, String(s)) ? o.push(Pe(
|
|
1344
1344
|
t,
|
|
1345
1345
|
e,
|
|
1346
1346
|
r,
|
|
@@ -1348,20 +1348,20 @@ function zr(t, e, r, n, i) {
|
|
|
1348
1348
|
String(s),
|
|
1349
1349
|
!0
|
|
1350
1350
|
)) : o.push("");
|
|
1351
|
-
return i.forEach(function(
|
|
1352
|
-
|
|
1351
|
+
return i.forEach(function(a) {
|
|
1352
|
+
a.match(/^\d+$/) || o.push(Pe(
|
|
1353
1353
|
t,
|
|
1354
1354
|
e,
|
|
1355
1355
|
r,
|
|
1356
1356
|
n,
|
|
1357
|
-
|
|
1357
|
+
a,
|
|
1358
1358
|
!0
|
|
1359
1359
|
));
|
|
1360
1360
|
}), o;
|
|
1361
1361
|
}
|
|
1362
|
-
function
|
|
1363
|
-
var s, f,
|
|
1364
|
-
if (
|
|
1362
|
+
function Pe(t, e, r, n, i, o) {
|
|
1363
|
+
var s, f, a;
|
|
1364
|
+
if (a = Object.getOwnPropertyDescriptor(e, i) || { value: e[i] }, a.get ? a.set ? f = t.stylize("[Getter/Setter]", "special") : f = t.stylize("[Getter]", "special") : a.set && (f = t.stylize("[Setter]", "special")), Bt(n, i) || (s = "[" + i + "]"), f || (t.seen.indexOf(a.value) < 0 ? (Ve(r) ? f = ye(t, a.value, null) : f = ye(t, a.value, r - 1), f.indexOf(`
|
|
1365
1365
|
`) > -1 && (o ? f = f.split(`
|
|
1366
1366
|
`).map(function(l) {
|
|
1367
1367
|
return " " + l;
|
|
@@ -1378,7 +1378,7 @@ function ke(t, e, r, n, i, o) {
|
|
|
1378
1378
|
}
|
|
1379
1379
|
return s + ": " + f;
|
|
1380
1380
|
}
|
|
1381
|
-
function
|
|
1381
|
+
function Jr(t, e, r) {
|
|
1382
1382
|
var n = t.reduce(function(i, o) {
|
|
1383
1383
|
return o.indexOf(`
|
|
1384
1384
|
`) >= 0, i + o.replace(/\u001b\[\d\d?m/g, "").length + 1;
|
|
@@ -1387,49 +1387,49 @@ function Vr(t, e, r) {
|
|
|
1387
1387
|
`) + " " + t.join(`,
|
|
1388
1388
|
`) + " " + r[1] : r[0] + e + " " + t.join(", ") + " " + r[1];
|
|
1389
1389
|
}
|
|
1390
|
-
function
|
|
1390
|
+
function Yr(t) {
|
|
1391
1391
|
return Array.isArray(t);
|
|
1392
1392
|
}
|
|
1393
|
-
function
|
|
1393
|
+
function Mt(t) {
|
|
1394
1394
|
return typeof t == "boolean";
|
|
1395
1395
|
}
|
|
1396
|
-
function
|
|
1396
|
+
function Ve(t) {
|
|
1397
1397
|
return t === null;
|
|
1398
1398
|
}
|
|
1399
|
-
function
|
|
1399
|
+
function Wr(t) {
|
|
1400
1400
|
return typeof t == "number";
|
|
1401
1401
|
}
|
|
1402
|
-
function
|
|
1402
|
+
function Je(t) {
|
|
1403
1403
|
return typeof t == "string";
|
|
1404
1404
|
}
|
|
1405
1405
|
function Q(t) {
|
|
1406
1406
|
return t === void 0;
|
|
1407
1407
|
}
|
|
1408
|
-
function
|
|
1409
|
-
return ue(t) &&
|
|
1408
|
+
function Le(t) {
|
|
1409
|
+
return ue(t) && Ye(t) === "[object RegExp]";
|
|
1410
1410
|
}
|
|
1411
1411
|
function ue(t) {
|
|
1412
1412
|
return typeof t == "object" && t !== null;
|
|
1413
1413
|
}
|
|
1414
|
-
function
|
|
1415
|
-
return ue(t) &&
|
|
1414
|
+
function Ke(t) {
|
|
1415
|
+
return ue(t) && Ye(t) === "[object Date]";
|
|
1416
1416
|
}
|
|
1417
|
-
function
|
|
1418
|
-
return ue(t) && (
|
|
1417
|
+
function Te(t) {
|
|
1418
|
+
return ue(t) && (Ye(t) === "[object Error]" || t instanceof Error);
|
|
1419
1419
|
}
|
|
1420
1420
|
function Ne(t) {
|
|
1421
1421
|
return typeof t == "function";
|
|
1422
1422
|
}
|
|
1423
|
-
function
|
|
1423
|
+
function Ye(t) {
|
|
1424
1424
|
return Object.prototype.toString.call(t);
|
|
1425
1425
|
}
|
|
1426
|
-
function
|
|
1426
|
+
function Qr(t, e) {
|
|
1427
1427
|
if (!e || !ue(e)) return t;
|
|
1428
1428
|
for (var r = Object.keys(e), n = r.length; n--; )
|
|
1429
1429
|
t[r[n]] = e[r[n]];
|
|
1430
1430
|
return t;
|
|
1431
1431
|
}
|
|
1432
|
-
function
|
|
1432
|
+
function Bt(t, e) {
|
|
1433
1433
|
return Object.prototype.hasOwnProperty.call(t, e);
|
|
1434
1434
|
}
|
|
1435
1435
|
function te() {
|
|
@@ -1459,13 +1459,13 @@ te.prototype.join = function(t) {
|
|
|
1459
1459
|
return r;
|
|
1460
1460
|
};
|
|
1461
1461
|
te.prototype.concat = function(t) {
|
|
1462
|
-
if (this.length === 0) return
|
|
1462
|
+
if (this.length === 0) return u.alloc(0);
|
|
1463
1463
|
if (this.length === 1) return this.head.data;
|
|
1464
|
-
for (var e =
|
|
1464
|
+
for (var e = u.allocUnsafe(t >>> 0), r = this.head, n = 0; r; )
|
|
1465
1465
|
r.data.copy(e, n), n += r.data.length, r = r.next;
|
|
1466
1466
|
return e;
|
|
1467
1467
|
};
|
|
1468
|
-
var
|
|
1468
|
+
var Hr = u.isEncoding || function(t) {
|
|
1469
1469
|
switch (t && t.toLowerCase()) {
|
|
1470
1470
|
case "hex":
|
|
1471
1471
|
case "utf8":
|
|
@@ -1483,27 +1483,27 @@ var Qr = a.isEncoding || function(t) {
|
|
|
1483
1483
|
return !1;
|
|
1484
1484
|
}
|
|
1485
1485
|
};
|
|
1486
|
-
function
|
|
1487
|
-
if (t && !
|
|
1486
|
+
function Gr(t) {
|
|
1487
|
+
if (t && !Hr(t))
|
|
1488
1488
|
throw new Error("Unknown encoding: " + t);
|
|
1489
1489
|
}
|
|
1490
1490
|
function le(t) {
|
|
1491
|
-
switch (this.encoding = (t || "utf8").toLowerCase().replace(/[-_]/, ""),
|
|
1491
|
+
switch (this.encoding = (t || "utf8").toLowerCase().replace(/[-_]/, ""), Gr(t), this.encoding) {
|
|
1492
1492
|
case "utf8":
|
|
1493
1493
|
this.surrogateSize = 3;
|
|
1494
1494
|
break;
|
|
1495
1495
|
case "ucs2":
|
|
1496
1496
|
case "utf16le":
|
|
1497
|
-
this.surrogateSize = 2, this.detectIncompleteChar =
|
|
1497
|
+
this.surrogateSize = 2, this.detectIncompleteChar = Xr;
|
|
1498
1498
|
break;
|
|
1499
1499
|
case "base64":
|
|
1500
|
-
this.surrogateSize = 3, this.detectIncompleteChar =
|
|
1500
|
+
this.surrogateSize = 3, this.detectIncompleteChar = Kr;
|
|
1501
1501
|
break;
|
|
1502
1502
|
default:
|
|
1503
|
-
this.write =
|
|
1503
|
+
this.write = Zr;
|
|
1504
1504
|
return;
|
|
1505
1505
|
}
|
|
1506
|
-
this.charBuffer = new
|
|
1506
|
+
this.charBuffer = new u(6), this.charReceived = 0, this.charLength = 0;
|
|
1507
1507
|
}
|
|
1508
1508
|
le.prototype.write = function(t) {
|
|
1509
1509
|
for (var e = ""; this.charLength; ) {
|
|
@@ -1556,52 +1556,52 @@ le.prototype.end = function(t) {
|
|
|
1556
1556
|
}
|
|
1557
1557
|
return e;
|
|
1558
1558
|
};
|
|
1559
|
-
function
|
|
1559
|
+
function Zr(t) {
|
|
1560
1560
|
return t.toString(this.encoding);
|
|
1561
1561
|
}
|
|
1562
|
-
function
|
|
1562
|
+
function Xr(t) {
|
|
1563
1563
|
this.charReceived = t.length % 2, this.charLength = this.charReceived ? 2 : 0;
|
|
1564
1564
|
}
|
|
1565
|
-
function
|
|
1565
|
+
function Kr(t) {
|
|
1566
1566
|
this.charReceived = t.length % 3, this.charLength = this.charReceived ? 3 : 0;
|
|
1567
1567
|
}
|
|
1568
|
-
I.ReadableState =
|
|
1569
|
-
var b =
|
|
1568
|
+
I.ReadableState = Ut;
|
|
1569
|
+
var b = Pr("stream");
|
|
1570
1570
|
oe(I, p);
|
|
1571
|
-
function
|
|
1571
|
+
function en(t, e, r) {
|
|
1572
1572
|
if (typeof t.prependListener == "function")
|
|
1573
1573
|
return t.prependListener(e, r);
|
|
1574
1574
|
!t._events || !t._events[e] ? t.on(e, r) : Array.isArray(t._events[e]) ? t._events[e].unshift(r) : t._events[e] = [r, t._events[e]];
|
|
1575
1575
|
}
|
|
1576
|
-
function
|
|
1576
|
+
function tn(t, e) {
|
|
1577
1577
|
return t.listeners(e).length;
|
|
1578
1578
|
}
|
|
1579
|
-
function
|
|
1579
|
+
function Ut(t, e) {
|
|
1580
1580
|
t = t || {}, this.objectMode = !!t.objectMode, e instanceof M && (this.objectMode = this.objectMode || !!t.readableObjectMode);
|
|
1581
1581
|
var r = t.highWaterMark, n = this.objectMode ? 16 : 16 * 1024;
|
|
1582
1582
|
this.highWaterMark = r || r === 0 ? r : n, this.highWaterMark = ~~this.highWaterMark, this.buffer = new te(), this.length = 0, this.pipes = null, this.pipesCount = 0, this.flowing = null, this.ended = !1, this.endEmitted = !1, this.reading = !1, this.sync = !0, this.needReadable = !1, this.emittedReadable = !1, this.readableListening = !1, this.resumeScheduled = !1, this.defaultEncoding = t.defaultEncoding || "utf8", this.ranOut = !1, this.awaitDrain = 0, this.readingMore = !1, this.decoder = null, this.encoding = null, t.encoding && (this.decoder = new le(t.encoding), this.encoding = t.encoding);
|
|
1583
1583
|
}
|
|
1584
1584
|
function I(t) {
|
|
1585
1585
|
if (!(this instanceof I)) return new I(t);
|
|
1586
|
-
this._readableState = new
|
|
1586
|
+
this._readableState = new Ut(t, this), this.readable = !0, t && typeof t.read == "function" && (this._read = t.read), p.call(this);
|
|
1587
1587
|
}
|
|
1588
1588
|
I.prototype.push = function(t, e) {
|
|
1589
1589
|
var r = this._readableState;
|
|
1590
|
-
return !r.objectMode && typeof t == "string" && (e = e || r.defaultEncoding, e !== r.encoding && (t =
|
|
1590
|
+
return !r.objectMode && typeof t == "string" && (e = e || r.defaultEncoding, e !== r.encoding && (t = u.from(t, e), e = "")), kt(this, r, t, e, !1);
|
|
1591
1591
|
};
|
|
1592
1592
|
I.prototype.unshift = function(t) {
|
|
1593
1593
|
var e = this._readableState;
|
|
1594
|
-
return
|
|
1594
|
+
return kt(this, e, t, "", !0);
|
|
1595
1595
|
};
|
|
1596
1596
|
I.prototype.isPaused = function() {
|
|
1597
1597
|
return this._readableState.flowing === !1;
|
|
1598
1598
|
};
|
|
1599
|
-
function
|
|
1600
|
-
var o =
|
|
1599
|
+
function kt(t, e, r, n, i) {
|
|
1600
|
+
var o = on(e, r);
|
|
1601
1601
|
if (o)
|
|
1602
1602
|
t.emit("error", o);
|
|
1603
1603
|
else if (r === null)
|
|
1604
|
-
e.reading = !1,
|
|
1604
|
+
e.reading = !1, sn(t, e);
|
|
1605
1605
|
else if (e.objectMode || r && r.length > 0)
|
|
1606
1606
|
if (e.ended && !i) {
|
|
1607
1607
|
var s = new Error("stream.push() after EOF");
|
|
@@ -1610,42 +1610,42 @@ function Ut(t, e, r, n, i) {
|
|
|
1610
1610
|
var f = new Error("stream.unshift() after end event");
|
|
1611
1611
|
t.emit("error", f);
|
|
1612
1612
|
} else {
|
|
1613
|
-
var
|
|
1614
|
-
e.decoder && !i && !n && (r = e.decoder.write(r),
|
|
1613
|
+
var a;
|
|
1614
|
+
e.decoder && !i && !n && (r = e.decoder.write(r), a = !e.objectMode && r.length === 0), i || (e.reading = !1), a || (e.flowing && e.length === 0 && !e.sync ? (t.emit("data", r), t.read(0)) : (e.length += e.objectMode ? 1 : r.length, i ? e.buffer.unshift(r) : e.buffer.push(r), e.needReadable && Se(t))), fn(t, e);
|
|
1615
1615
|
}
|
|
1616
1616
|
else i || (e.reading = !1);
|
|
1617
|
-
return
|
|
1617
|
+
return rn(e);
|
|
1618
1618
|
}
|
|
1619
|
-
function
|
|
1619
|
+
function rn(t) {
|
|
1620
1620
|
return !t.ended && (t.needReadable || t.length < t.highWaterMark || t.length === 0);
|
|
1621
1621
|
}
|
|
1622
1622
|
I.prototype.setEncoding = function(t) {
|
|
1623
1623
|
return this._readableState.decoder = new le(t), this._readableState.encoding = t, this;
|
|
1624
1624
|
};
|
|
1625
|
-
var
|
|
1626
|
-
function
|
|
1627
|
-
return t >=
|
|
1625
|
+
var et = 8388608;
|
|
1626
|
+
function nn(t) {
|
|
1627
|
+
return t >= et ? t = et : (t--, t |= t >>> 1, t |= t >>> 2, t |= t >>> 4, t |= t >>> 8, t |= t >>> 16, t++), t;
|
|
1628
1628
|
}
|
|
1629
|
-
function
|
|
1630
|
-
return t <= 0 || e.length === 0 && e.ended ? 0 : e.objectMode ? 1 : t !== t ? e.flowing && e.length ? e.buffer.head.data.length : e.length : (t > e.highWaterMark && (e.highWaterMark =
|
|
1629
|
+
function tt(t, e) {
|
|
1630
|
+
return t <= 0 || e.length === 0 && e.ended ? 0 : e.objectMode ? 1 : t !== t ? e.flowing && e.length ? e.buffer.head.data.length : e.length : (t > e.highWaterMark && (e.highWaterMark = nn(t)), t <= e.length ? t : e.ended ? e.length : (e.needReadable = !0, 0));
|
|
1631
1631
|
}
|
|
1632
1632
|
I.prototype.read = function(t) {
|
|
1633
1633
|
b("read", t), t = parseInt(t, 10);
|
|
1634
1634
|
var e = this._readableState, r = t;
|
|
1635
1635
|
if (t !== 0 && (e.emittedReadable = !1), t === 0 && e.needReadable && (e.length >= e.highWaterMark || e.ended))
|
|
1636
1636
|
return b("read: emitReadable", e.length, e.ended), e.length === 0 && e.ended ? De(this) : Se(this), null;
|
|
1637
|
-
if (t =
|
|
1637
|
+
if (t = tt(t, e), t === 0 && e.ended)
|
|
1638
1638
|
return e.length === 0 && De(this), null;
|
|
1639
1639
|
var n = e.needReadable;
|
|
1640
|
-
b("need readable", n), (e.length === 0 || e.length - t < e.highWaterMark) && (n = !0, b("length less than watermark", n)), e.ended || e.reading ? (n = !1, b("reading or ended", n)) : n && (b("do read"), e.reading = !0, e.sync = !0, e.length === 0 && (e.needReadable = !0), this._read(e.highWaterMark), e.sync = !1, e.reading || (t =
|
|
1640
|
+
b("need readable", n), (e.length === 0 || e.length - t < e.highWaterMark) && (n = !0, b("length less than watermark", n)), e.ended || e.reading ? (n = !1, b("reading or ended", n)) : n && (b("do read"), e.reading = !0, e.sync = !0, e.length === 0 && (e.needReadable = !0), this._read(e.highWaterMark), e.sync = !1, e.reading || (t = tt(r, e)));
|
|
1641
1641
|
var i;
|
|
1642
|
-
return t > 0 ? i =
|
|
1642
|
+
return t > 0 ? i = Pt(t, e) : i = null, i === null ? (e.needReadable = !0, t = 0) : e.length -= t, e.length === 0 && (e.ended || (e.needReadable = !0), r !== t && e.ended && De(this)), i !== null && this.emit("data", i), i;
|
|
1643
1643
|
};
|
|
1644
|
-
function
|
|
1644
|
+
function on(t, e) {
|
|
1645
1645
|
var r = null;
|
|
1646
1646
|
return !N(e) && typeof e != "string" && e !== null && e !== void 0 && !t.objectMode && (r = new TypeError("Invalid non-string/buffer chunk")), r;
|
|
1647
1647
|
}
|
|
1648
|
-
function
|
|
1648
|
+
function sn(t, e) {
|
|
1649
1649
|
if (!e.ended) {
|
|
1650
1650
|
if (e.decoder) {
|
|
1651
1651
|
var r = e.decoder.end();
|
|
@@ -1656,15 +1656,15 @@ function on(t, e) {
|
|
|
1656
1656
|
}
|
|
1657
1657
|
function Se(t) {
|
|
1658
1658
|
var e = t._readableState;
|
|
1659
|
-
e.needReadable = !1, e.emittedReadable || (b("emitReadable", e.flowing), e.emittedReadable = !0, e.sync ? B(
|
|
1660
|
-
}
|
|
1661
|
-
function tt(t) {
|
|
1662
|
-
b("emit readable"), t.emit("readable"), Ye(t);
|
|
1659
|
+
e.needReadable = !1, e.emittedReadable || (b("emitReadable", e.flowing), e.emittedReadable = !0, e.sync ? B(rt, t) : rt(t));
|
|
1663
1660
|
}
|
|
1664
|
-
function
|
|
1665
|
-
|
|
1661
|
+
function rt(t) {
|
|
1662
|
+
b("emit readable"), t.emit("readable"), We(t);
|
|
1666
1663
|
}
|
|
1667
1664
|
function fn(t, e) {
|
|
1665
|
+
e.readingMore || (e.readingMore = !0, B(an, t, e));
|
|
1666
|
+
}
|
|
1667
|
+
function an(t, e) {
|
|
1668
1668
|
for (var r = e.length; !e.reading && !e.flowing && !e.ended && e.length < e.highWaterMark && (b("maybeReadMore read 0"), t.read(0), r !== e.length); )
|
|
1669
1669
|
r = e.length;
|
|
1670
1670
|
e.readingMore = !1;
|
|
@@ -1694,23 +1694,23 @@ I.prototype.pipe = function(t, e) {
|
|
|
1694
1694
|
function f() {
|
|
1695
1695
|
b("onend"), t.end();
|
|
1696
1696
|
}
|
|
1697
|
-
var
|
|
1698
|
-
t.on("drain",
|
|
1697
|
+
var a = un(r);
|
|
1698
|
+
t.on("drain", a);
|
|
1699
1699
|
var l = !1;
|
|
1700
1700
|
function h() {
|
|
1701
|
-
b("cleanup"), t.removeListener("close", C), t.removeListener("finish", E), t.removeListener("drain",
|
|
1701
|
+
b("cleanup"), t.removeListener("close", C), t.removeListener("finish", E), t.removeListener("drain", a), t.removeListener("error", y), t.removeListener("unpipe", s), r.removeListener("end", f), r.removeListener("end", h), r.removeListener("data", m), l = !0, n.awaitDrain && (!t._writableState || t._writableState.needDrain) && a();
|
|
1702
1702
|
}
|
|
1703
1703
|
var c = !1;
|
|
1704
|
-
r.on("data",
|
|
1705
|
-
function
|
|
1704
|
+
r.on("data", m);
|
|
1705
|
+
function m(S) {
|
|
1706
1706
|
b("ondata"), c = !1;
|
|
1707
1707
|
var w = t.write(S);
|
|
1708
|
-
w === !1 && !c && ((n.pipesCount === 1 && n.pipes === t || n.pipesCount > 1 &&
|
|
1708
|
+
w === !1 && !c && ((n.pipesCount === 1 && n.pipes === t || n.pipesCount > 1 && $t(n.pipes, t) !== -1) && !l && (b("false write response, pause", r._readableState.awaitDrain), r._readableState.awaitDrain++, c = !0), r.pause());
|
|
1709
1709
|
}
|
|
1710
1710
|
function y(S) {
|
|
1711
|
-
b("onerror", S), x(), t.removeListener("error", y),
|
|
1711
|
+
b("onerror", S), x(), t.removeListener("error", y), tn(t, "error") === 0 && t.emit("error", S);
|
|
1712
1712
|
}
|
|
1713
|
-
|
|
1713
|
+
en(t, "error", y);
|
|
1714
1714
|
function C() {
|
|
1715
1715
|
t.removeListener("finish", E), x();
|
|
1716
1716
|
}
|
|
@@ -1724,10 +1724,10 @@ I.prototype.pipe = function(t, e) {
|
|
|
1724
1724
|
}
|
|
1725
1725
|
return t.emit("pipe", r), n.flowing || (b("pipe resume"), r.resume()), t;
|
|
1726
1726
|
};
|
|
1727
|
-
function
|
|
1727
|
+
function un(t) {
|
|
1728
1728
|
return function() {
|
|
1729
1729
|
var e = t._readableState;
|
|
1730
|
-
b("pipeOnDrain", e.awaitDrain), e.awaitDrain && e.awaitDrain--, e.awaitDrain === 0 && t.listeners("data").length && (e.flowing = !0,
|
|
1730
|
+
b("pipeOnDrain", e.awaitDrain), e.awaitDrain && e.awaitDrain--, e.awaitDrain === 0 && t.listeners("data").length && (e.flowing = !0, We(t));
|
|
1731
1731
|
};
|
|
1732
1732
|
}
|
|
1733
1733
|
I.prototype.unpipe = function(t) {
|
|
@@ -1742,7 +1742,7 @@ I.prototype.unpipe = function(t) {
|
|
|
1742
1742
|
r[i].emit("unpipe", this);
|
|
1743
1743
|
return this;
|
|
1744
1744
|
}
|
|
1745
|
-
var o =
|
|
1745
|
+
var o = $t(e.pipes, t);
|
|
1746
1746
|
return o === -1 ? this : (e.pipes.splice(o, 1), e.pipesCount -= 1, e.pipesCount === 1 && (e.pipes = e.pipes[0]), t.emit("unpipe", this), this);
|
|
1747
1747
|
};
|
|
1748
1748
|
I.prototype.on = function(t, e) {
|
|
@@ -1751,28 +1751,28 @@ I.prototype.on = function(t, e) {
|
|
|
1751
1751
|
this._readableState.flowing !== !1 && this.resume();
|
|
1752
1752
|
else if (t === "readable") {
|
|
1753
1753
|
var n = this._readableState;
|
|
1754
|
-
!n.endEmitted && !n.readableListening && (n.readableListening = n.needReadable = !0, n.emittedReadable = !1, n.reading ? n.length && Se(this) : B(
|
|
1754
|
+
!n.endEmitted && !n.readableListening && (n.readableListening = n.needReadable = !0, n.emittedReadable = !1, n.reading ? n.length && Se(this) : B(ln, this));
|
|
1755
1755
|
}
|
|
1756
1756
|
return r;
|
|
1757
1757
|
};
|
|
1758
1758
|
I.prototype.addListener = I.prototype.on;
|
|
1759
|
-
function
|
|
1759
|
+
function ln(t) {
|
|
1760
1760
|
b("readable nexttick read 0"), t.read(0);
|
|
1761
1761
|
}
|
|
1762
1762
|
I.prototype.resume = function() {
|
|
1763
1763
|
var t = this._readableState;
|
|
1764
|
-
return t.flowing || (b("resume"), t.flowing = !0,
|
|
1764
|
+
return t.flowing || (b("resume"), t.flowing = !0, hn(this, t)), this;
|
|
1765
1765
|
};
|
|
1766
|
-
function ln(t, e) {
|
|
1767
|
-
e.resumeScheduled || (e.resumeScheduled = !0, B(hn, t, e));
|
|
1768
|
-
}
|
|
1769
1766
|
function hn(t, e) {
|
|
1770
|
-
e.
|
|
1767
|
+
e.resumeScheduled || (e.resumeScheduled = !0, B(cn, t, e));
|
|
1768
|
+
}
|
|
1769
|
+
function cn(t, e) {
|
|
1770
|
+
e.reading || (b("resume read 0"), t.read(0)), e.resumeScheduled = !1, e.awaitDrain = 0, t.emit("resume"), We(t), e.flowing && !e.reading && t.read(0);
|
|
1771
1771
|
}
|
|
1772
1772
|
I.prototype.pause = function() {
|
|
1773
1773
|
return b("call pause flowing=%j", this._readableState.flowing), this._readableState.flowing !== !1 && (b("pause"), this._readableState.flowing = !1, this.emit("pause")), this;
|
|
1774
1774
|
};
|
|
1775
|
-
function
|
|
1775
|
+
function We(t) {
|
|
1776
1776
|
var e = t._readableState;
|
|
1777
1777
|
for (b("flow", e.flowing); e.flowing && t.read() !== null; )
|
|
1778
1778
|
;
|
|
@@ -1798,23 +1798,23 @@ I.prototype.wrap = function(t) {
|
|
|
1798
1798
|
};
|
|
1799
1799
|
})(i));
|
|
1800
1800
|
var o = ["error", "close", "destroy", "pause", "resume"];
|
|
1801
|
-
return
|
|
1801
|
+
return _n(o, function(s) {
|
|
1802
1802
|
t.on(s, n.emit.bind(n, s));
|
|
1803
1803
|
}), n._read = function(s) {
|
|
1804
1804
|
b("wrapped _read", s), r && (r = !1, t.resume());
|
|
1805
1805
|
}, n;
|
|
1806
1806
|
};
|
|
1807
|
-
I._fromList =
|
|
1808
|
-
function
|
|
1807
|
+
I._fromList = Pt;
|
|
1808
|
+
function Pt(t, e) {
|
|
1809
1809
|
if (e.length === 0) return null;
|
|
1810
1810
|
var r;
|
|
1811
|
-
return e.objectMode ? r = e.buffer.shift() : !t || t >= e.length ? (e.decoder ? r = e.buffer.join("") : e.buffer.length === 1 ? r = e.buffer.head.data : r = e.buffer.concat(e.length), e.buffer.clear()) : r =
|
|
1811
|
+
return e.objectMode ? r = e.buffer.shift() : !t || t >= e.length ? (e.decoder ? r = e.buffer.join("") : e.buffer.length === 1 ? r = e.buffer.head.data : r = e.buffer.concat(e.length), e.buffer.clear()) : r = dn(t, e.buffer, e.decoder), r;
|
|
1812
1812
|
}
|
|
1813
|
-
function
|
|
1813
|
+
function dn(t, e, r) {
|
|
1814
1814
|
var n;
|
|
1815
|
-
return t < e.head.data.length ? (n = e.head.data.slice(0, t), e.head.data = e.head.data.slice(t)) : t === e.head.data.length ? n = e.shift() : n = r ?
|
|
1815
|
+
return t < e.head.data.length ? (n = e.head.data.slice(0, t), e.head.data = e.head.data.slice(t)) : t === e.head.data.length ? n = e.shift() : n = r ? pn(t, e) : mn(t, e), n;
|
|
1816
1816
|
}
|
|
1817
|
-
function
|
|
1817
|
+
function pn(t, e) {
|
|
1818
1818
|
var r = e.head, n = 1, i = r.data;
|
|
1819
1819
|
for (t -= i.length; r = r.next; ) {
|
|
1820
1820
|
var o = r.data, s = t > o.length ? o.length : t;
|
|
@@ -1826,8 +1826,8 @@ function dn(t, e) {
|
|
|
1826
1826
|
}
|
|
1827
1827
|
return e.length -= n, i;
|
|
1828
1828
|
}
|
|
1829
|
-
function
|
|
1830
|
-
var r =
|
|
1829
|
+
function mn(t, e) {
|
|
1830
|
+
var r = u.allocUnsafe(t), n = e.head, i = 1;
|
|
1831
1831
|
for (n.data.copy(r), t -= n.data.length; n = n.next; ) {
|
|
1832
1832
|
var o = n.data, s = t > o.length ? o.length : t;
|
|
1833
1833
|
if (o.copy(r, r.length - t, 0, s), t -= s, t === 0) {
|
|
@@ -1846,25 +1846,25 @@ function De(t) {
|
|
|
1846
1846
|
function gn(t, e) {
|
|
1847
1847
|
!t.endEmitted && t.length === 0 && (t.endEmitted = !0, e.readable = !1, e.emit("end"));
|
|
1848
1848
|
}
|
|
1849
|
-
function
|
|
1849
|
+
function _n(t, e) {
|
|
1850
1850
|
for (var r = 0, n = t.length; r < n; r++)
|
|
1851
1851
|
e(t[r], r);
|
|
1852
1852
|
}
|
|
1853
|
-
function
|
|
1853
|
+
function $t(t, e) {
|
|
1854
1854
|
for (var r = 0, n = t.length; r < n; r++)
|
|
1855
1855
|
if (t[r] === e) return r;
|
|
1856
1856
|
return -1;
|
|
1857
1857
|
}
|
|
1858
|
-
|
|
1859
|
-
oe(
|
|
1860
|
-
function
|
|
1858
|
+
T.WritableState = Qe;
|
|
1859
|
+
oe(T, p);
|
|
1860
|
+
function wn() {
|
|
1861
1861
|
}
|
|
1862
|
-
function
|
|
1862
|
+
function yn(t, e, r) {
|
|
1863
1863
|
this.chunk = t, this.encoding = e, this.callback = r, this.next = null;
|
|
1864
1864
|
}
|
|
1865
|
-
function
|
|
1865
|
+
function Qe(t, e) {
|
|
1866
1866
|
Object.defineProperty(this, "buffer", {
|
|
1867
|
-
get:
|
|
1867
|
+
get: Ft(function() {
|
|
1868
1868
|
return this.getBuffer();
|
|
1869
1869
|
}, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")
|
|
1870
1870
|
}), t = t || {}, this.objectMode = !!t.objectMode, e instanceof M && (this.objectMode = this.objectMode || !!t.writableObjectMode);
|
|
@@ -1872,84 +1872,84 @@ function We(t, e) {
|
|
|
1872
1872
|
this.highWaterMark = r || r === 0 ? r : n, this.highWaterMark = ~~this.highWaterMark, this.needDrain = !1, this.ending = !1, this.ended = !1, this.finished = !1;
|
|
1873
1873
|
var i = t.decodeStrings === !1;
|
|
1874
1874
|
this.decodeStrings = !i, this.defaultEncoding = t.defaultEncoding || "utf8", this.length = 0, this.writing = !1, this.corked = 0, this.sync = !0, this.bufferProcessing = !1, this.onwrite = function(o) {
|
|
1875
|
-
|
|
1876
|
-
}, this.writecb = null, this.writelen = 0, this.bufferedRequest = null, this.lastBufferedRequest = null, this.pendingcb = 0, this.prefinished = !1, this.errorEmitted = !1, this.bufferedRequestCount = 0, this.corkedRequestsFree = new
|
|
1875
|
+
In(e, o);
|
|
1876
|
+
}, this.writecb = null, this.writelen = 0, this.bufferedRequest = null, this.lastBufferedRequest = null, this.pendingcb = 0, this.prefinished = !1, this.errorEmitted = !1, this.bufferedRequestCount = 0, this.corkedRequestsFree = new Vt(this);
|
|
1877
1877
|
}
|
|
1878
|
-
|
|
1878
|
+
Qe.prototype.getBuffer = function() {
|
|
1879
1879
|
for (var e = this.bufferedRequest, r = []; e; )
|
|
1880
1880
|
r.push(e), e = e.next;
|
|
1881
1881
|
return r;
|
|
1882
1882
|
};
|
|
1883
|
-
function
|
|
1884
|
-
if (!(this instanceof
|
|
1885
|
-
this._writableState = new
|
|
1883
|
+
function T(t) {
|
|
1884
|
+
if (!(this instanceof T) && !(this instanceof M)) return new T(t);
|
|
1885
|
+
this._writableState = new Qe(t, this), this.writable = !0, t && (typeof t.write == "function" && (this._write = t.write), typeof t.writev == "function" && (this._writev = t.writev)), p.call(this);
|
|
1886
1886
|
}
|
|
1887
|
-
|
|
1887
|
+
T.prototype.pipe = function() {
|
|
1888
1888
|
this.emit("error", new Error("Cannot pipe, not readable"));
|
|
1889
1889
|
};
|
|
1890
|
-
function
|
|
1890
|
+
function vn(t, e) {
|
|
1891
1891
|
var r = new Error("write after end");
|
|
1892
1892
|
t.emit("error", r), B(e, r);
|
|
1893
1893
|
}
|
|
1894
|
-
function
|
|
1894
|
+
function bn(t, e, r, n) {
|
|
1895
1895
|
var i = !0, o = !1;
|
|
1896
|
-
return r === null ? o = new TypeError("May not write null values to stream") : !
|
|
1896
|
+
return r === null ? o = new TypeError("May not write null values to stream") : !u.isBuffer(r) && typeof r != "string" && r !== void 0 && !e.objectMode && (o = new TypeError("Invalid non-string/buffer chunk")), o && (t.emit("error", o), B(n, o), i = !1), i;
|
|
1897
1897
|
}
|
|
1898
|
-
|
|
1898
|
+
T.prototype.write = function(t, e, r) {
|
|
1899
1899
|
var n = this._writableState, i = !1;
|
|
1900
|
-
return typeof e == "function" && (r = e, e = null),
|
|
1900
|
+
return typeof e == "function" && (r = e, e = null), u.isBuffer(t) ? e = "buffer" : e || (e = n.defaultEncoding), typeof r != "function" && (r = wn), n.ended ? vn(this, r) : bn(this, n, t, r) && (n.pendingcb++, i = xn(this, n, t, e, r)), i;
|
|
1901
1901
|
};
|
|
1902
|
-
|
|
1902
|
+
T.prototype.cork = function() {
|
|
1903
1903
|
var t = this._writableState;
|
|
1904
1904
|
t.corked++;
|
|
1905
1905
|
};
|
|
1906
|
-
|
|
1906
|
+
T.prototype.uncork = function() {
|
|
1907
1907
|
var t = this._writableState;
|
|
1908
|
-
t.corked && (t.corked--, !t.writing && !t.corked && !t.finished && !t.bufferProcessing && t.bufferedRequest &&
|
|
1908
|
+
t.corked && (t.corked--, !t.writing && !t.corked && !t.finished && !t.bufferProcessing && t.bufferedRequest && jt(this, t));
|
|
1909
1909
|
};
|
|
1910
|
-
|
|
1910
|
+
T.prototype.setDefaultEncoding = function(e) {
|
|
1911
1911
|
if (typeof e == "string" && (e = e.toLowerCase()), !(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((e + "").toLowerCase()) > -1)) throw new TypeError("Unknown encoding: " + e);
|
|
1912
1912
|
return this._writableState.defaultEncoding = e, this;
|
|
1913
1913
|
};
|
|
1914
|
-
function
|
|
1915
|
-
return !t.objectMode && t.decodeStrings !== !1 && typeof e == "string" && (e =
|
|
1914
|
+
function En(t, e, r) {
|
|
1915
|
+
return !t.objectMode && t.decodeStrings !== !1 && typeof e == "string" && (e = u.from(e, r)), e;
|
|
1916
1916
|
}
|
|
1917
|
-
function
|
|
1918
|
-
r =
|
|
1917
|
+
function xn(t, e, r, n, i) {
|
|
1918
|
+
r = En(e, r, n), u.isBuffer(r) && (n = "buffer");
|
|
1919
1919
|
var o = e.objectMode ? 1 : r.length;
|
|
1920
1920
|
e.length += o;
|
|
1921
1921
|
var s = e.length < e.highWaterMark;
|
|
1922
1922
|
if (s || (e.needDrain = !0), e.writing || e.corked) {
|
|
1923
1923
|
var f = e.lastBufferedRequest;
|
|
1924
|
-
e.lastBufferedRequest = new
|
|
1924
|
+
e.lastBufferedRequest = new yn(r, n, i), f ? f.next = e.lastBufferedRequest : e.bufferedRequest = e.lastBufferedRequest, e.bufferedRequestCount += 1;
|
|
1925
1925
|
} else
|
|
1926
|
-
|
|
1926
|
+
$e(t, e, !1, o, r, n, i);
|
|
1927
1927
|
return s;
|
|
1928
1928
|
}
|
|
1929
|
-
function
|
|
1929
|
+
function $e(t, e, r, n, i, o, s) {
|
|
1930
1930
|
e.writelen = n, e.writecb = s, e.writing = !0, e.sync = !0, r ? t._writev(i, e.onwrite) : t._write(i, o, e.onwrite), e.sync = !1;
|
|
1931
1931
|
}
|
|
1932
|
-
function
|
|
1932
|
+
function Sn(t, e, r, n, i) {
|
|
1933
1933
|
--e.pendingcb, r ? B(i, n) : i(n), t._writableState.errorEmitted = !0, t.emit("error", n);
|
|
1934
1934
|
}
|
|
1935
|
-
function
|
|
1935
|
+
function Rn(t) {
|
|
1936
1936
|
t.writing = !1, t.writecb = null, t.length -= t.writelen, t.writelen = 0;
|
|
1937
1937
|
}
|
|
1938
|
-
function
|
|
1938
|
+
function In(t, e) {
|
|
1939
1939
|
var r = t._writableState, n = r.sync, i = r.writecb;
|
|
1940
|
-
if (
|
|
1940
|
+
if (Rn(r), e) Sn(t, r, n, e, i);
|
|
1941
1941
|
else {
|
|
1942
|
-
var o =
|
|
1943
|
-
!o && !r.corked && !r.bufferProcessing && r.bufferedRequest &&
|
|
1942
|
+
var o = qt(r);
|
|
1943
|
+
!o && !r.corked && !r.bufferProcessing && r.bufferedRequest && jt(t, r), n ? B(nt, t, r, o, i) : nt(t, r, o, i);
|
|
1944
1944
|
}
|
|
1945
1945
|
}
|
|
1946
|
-
function
|
|
1947
|
-
r ||
|
|
1946
|
+
function nt(t, e, r, n) {
|
|
1947
|
+
r || On(t, e), e.pendingcb--, n(), zt(t, e);
|
|
1948
1948
|
}
|
|
1949
|
-
function
|
|
1949
|
+
function On(t, e) {
|
|
1950
1950
|
e.length === 0 && e.needDrain && (e.needDrain = !1, t.emit("drain"));
|
|
1951
1951
|
}
|
|
1952
|
-
function
|
|
1952
|
+
function jt(t, e) {
|
|
1953
1953
|
e.bufferProcessing = !0;
|
|
1954
1954
|
var r = e.bufferedRequest;
|
|
1955
1955
|
if (t._writev && r && r.next) {
|
|
@@ -1957,39 +1957,39 @@ function $t(t, e) {
|
|
|
1957
1957
|
o.entry = r;
|
|
1958
1958
|
for (var s = 0; r; )
|
|
1959
1959
|
i[s] = r, r = r.next, s += 1;
|
|
1960
|
-
|
|
1960
|
+
$e(t, e, !0, e.length, i, "", o.finish), e.pendingcb++, e.lastBufferedRequest = null, o.next ? (e.corkedRequestsFree = o.next, o.next = null) : e.corkedRequestsFree = new Vt(e);
|
|
1961
1961
|
} else {
|
|
1962
1962
|
for (; r; ) {
|
|
1963
|
-
var f = r.chunk,
|
|
1964
|
-
if (
|
|
1963
|
+
var f = r.chunk, a = r.encoding, l = r.callback, h = e.objectMode ? 1 : f.length;
|
|
1964
|
+
if ($e(t, e, !1, h, f, a, l), r = r.next, e.writing)
|
|
1965
1965
|
break;
|
|
1966
1966
|
}
|
|
1967
1967
|
r === null && (e.lastBufferedRequest = null);
|
|
1968
1968
|
}
|
|
1969
1969
|
e.bufferedRequestCount = 0, e.bufferedRequest = r, e.bufferProcessing = !1;
|
|
1970
1970
|
}
|
|
1971
|
-
|
|
1971
|
+
T.prototype._write = function(t, e, r) {
|
|
1972
1972
|
r(new Error("not implemented"));
|
|
1973
1973
|
};
|
|
1974
|
-
|
|
1975
|
-
|
|
1974
|
+
T.prototype._writev = null;
|
|
1975
|
+
T.prototype.end = function(t, e, r) {
|
|
1976
1976
|
var n = this._writableState;
|
|
1977
|
-
typeof t == "function" ? (r = t, t = null, e = null) : typeof e == "function" && (r = e, e = null), t != null && this.write(t, e), n.corked && (n.corked = 1, this.uncork()), !n.ending && !n.finished &&
|
|
1977
|
+
typeof t == "function" ? (r = t, t = null, e = null) : typeof e == "function" && (r = e, e = null), t != null && this.write(t, e), n.corked && (n.corked = 1, this.uncork()), !n.ending && !n.finished && Cn(this, n, r);
|
|
1978
1978
|
};
|
|
1979
|
-
function
|
|
1979
|
+
function qt(t) {
|
|
1980
1980
|
return t.ending && t.length === 0 && t.bufferedRequest === null && !t.finished && !t.writing;
|
|
1981
1981
|
}
|
|
1982
|
-
function
|
|
1982
|
+
function it(t, e) {
|
|
1983
1983
|
e.prefinished || (e.prefinished = !0, t.emit("prefinish"));
|
|
1984
1984
|
}
|
|
1985
|
-
function
|
|
1986
|
-
var r =
|
|
1987
|
-
return r && (e.pendingcb === 0 ? (
|
|
1985
|
+
function zt(t, e) {
|
|
1986
|
+
var r = qt(e);
|
|
1987
|
+
return r && (e.pendingcb === 0 ? (it(t, e), e.finished = !0, t.emit("finish")) : it(t, e)), r;
|
|
1988
1988
|
}
|
|
1989
|
-
function
|
|
1990
|
-
e.ending = !0,
|
|
1989
|
+
function Cn(t, e, r) {
|
|
1990
|
+
e.ending = !0, zt(t, e), r && (e.finished ? B(r) : t.once("finish", r)), e.ended = !0, t.writable = !1;
|
|
1991
1991
|
}
|
|
1992
|
-
function
|
|
1992
|
+
function Vt(t) {
|
|
1993
1993
|
var e = this;
|
|
1994
1994
|
this.next = null, this.entry = null, this.finish = function(r) {
|
|
1995
1995
|
var n = e.entry;
|
|
@@ -2001,28 +2001,28 @@ function zt(t) {
|
|
|
2001
2001
|
};
|
|
2002
2002
|
}
|
|
2003
2003
|
oe(M, I);
|
|
2004
|
-
var
|
|
2005
|
-
for (var Fe = 0; Fe <
|
|
2006
|
-
var Me =
|
|
2007
|
-
M.prototype[Me] || (M.prototype[Me] =
|
|
2004
|
+
var ot = Object.keys(T.prototype);
|
|
2005
|
+
for (var Fe = 0; Fe < ot.length; Fe++) {
|
|
2006
|
+
var Me = ot[Fe];
|
|
2007
|
+
M.prototype[Me] || (M.prototype[Me] = T.prototype[Me]);
|
|
2008
2008
|
}
|
|
2009
2009
|
function M(t) {
|
|
2010
2010
|
if (!(this instanceof M)) return new M(t);
|
|
2011
|
-
I.call(this, t),
|
|
2011
|
+
I.call(this, t), T.call(this, t), t && t.readable === !1 && (this.readable = !1), t && t.writable === !1 && (this.writable = !1), this.allowHalfOpen = !0, t && t.allowHalfOpen === !1 && (this.allowHalfOpen = !1), this.once("end", An);
|
|
2012
2012
|
}
|
|
2013
|
-
function
|
|
2014
|
-
this.allowHalfOpen || this._writableState.ended || B(
|
|
2013
|
+
function An() {
|
|
2014
|
+
this.allowHalfOpen || this._writableState.ended || B(Ln, this);
|
|
2015
2015
|
}
|
|
2016
|
-
function
|
|
2016
|
+
function Ln(t) {
|
|
2017
2017
|
t.end();
|
|
2018
2018
|
}
|
|
2019
2019
|
oe(k, M);
|
|
2020
2020
|
function Tn(t) {
|
|
2021
2021
|
this.afterTransform = function(e, r) {
|
|
2022
|
-
return
|
|
2022
|
+
return Nn(t, e, r);
|
|
2023
2023
|
}, this.needTransform = !1, this.transforming = !1, this.writecb = null, this.writechunk = null, this.writeencoding = null;
|
|
2024
2024
|
}
|
|
2025
|
-
function
|
|
2025
|
+
function Nn(t, e, r) {
|
|
2026
2026
|
var n = t._transformState;
|
|
2027
2027
|
n.transforming = !1;
|
|
2028
2028
|
var i = n.writecb;
|
|
@@ -2037,8 +2037,8 @@ function k(t) {
|
|
|
2037
2037
|
var e = this;
|
|
2038
2038
|
this._readableState.needReadable = !0, this._readableState.sync = !1, t && (typeof t.transform == "function" && (this._transform = t.transform), typeof t.flush == "function" && (this._flush = t.flush)), this.once("prefinish", function() {
|
|
2039
2039
|
typeof this._flush == "function" ? this._flush(function(r) {
|
|
2040
|
-
|
|
2041
|
-
}) :
|
|
2040
|
+
st(e, r);
|
|
2041
|
+
}) : st(e);
|
|
2042
2042
|
});
|
|
2043
2043
|
}
|
|
2044
2044
|
k.prototype.push = function(t, e) {
|
|
@@ -2058,7 +2058,7 @@ k.prototype._read = function(t) {
|
|
|
2058
2058
|
var e = this._transformState;
|
|
2059
2059
|
e.writechunk !== null && e.writecb && !e.transforming ? (e.transforming = !0, this._transform(e.writechunk, e.writeencoding, e.afterTransform)) : e.needTransform = !0;
|
|
2060
2060
|
};
|
|
2061
|
-
function
|
|
2061
|
+
function st(t, e) {
|
|
2062
2062
|
if (e) return t.emit("error", e);
|
|
2063
2063
|
var r = t._writableState, n = t._transformState;
|
|
2064
2064
|
if (r.length) throw new Error("Calling transform done when ws.length != 0");
|
|
@@ -2075,7 +2075,7 @@ fe.prototype._transform = function(t, e, r) {
|
|
|
2075
2075
|
};
|
|
2076
2076
|
oe(V, p);
|
|
2077
2077
|
V.Readable = I;
|
|
2078
|
-
V.Writable =
|
|
2078
|
+
V.Writable = T;
|
|
2079
2079
|
V.Duplex = M;
|
|
2080
2080
|
V.Transform = k;
|
|
2081
2081
|
V.PassThrough = fe;
|
|
@@ -2100,17 +2100,17 @@ V.prototype.pipe = function(t, e) {
|
|
|
2100
2100
|
function f() {
|
|
2101
2101
|
o || (o = !0, typeof t.destroy == "function" && t.destroy());
|
|
2102
2102
|
}
|
|
2103
|
-
function
|
|
2103
|
+
function a(h) {
|
|
2104
2104
|
if (l(), p.listenerCount(this, "error") === 0)
|
|
2105
2105
|
throw h;
|
|
2106
2106
|
}
|
|
2107
|
-
r.on("error",
|
|
2107
|
+
r.on("error", a), t.on("error", a);
|
|
2108
2108
|
function l() {
|
|
2109
|
-
r.removeListener("data", n), t.removeListener("drain", i), r.removeListener("end", s), r.removeListener("close", f), r.removeListener("error",
|
|
2109
|
+
r.removeListener("data", n), t.removeListener("drain", i), r.removeListener("end", s), r.removeListener("close", f), r.removeListener("error", a), t.removeListener("error", a), r.removeListener("end", l), r.removeListener("close", l), t.removeListener("close", l);
|
|
2110
2110
|
}
|
|
2111
2111
|
return r.on("end", l), r.on("close", l), t.on("close", l), t.emit("pipe", r), t;
|
|
2112
2112
|
};
|
|
2113
|
-
const
|
|
2113
|
+
const Jt = function(t) {
|
|
2114
2114
|
return typeof t == "object" && t !== null && !Array.isArray(t);
|
|
2115
2115
|
};
|
|
2116
2116
|
class _ extends Error {
|
|
@@ -2123,7 +2123,7 @@ class _ extends Error {
|
|
|
2123
2123
|
}
|
|
2124
2124
|
}
|
|
2125
2125
|
}
|
|
2126
|
-
const
|
|
2126
|
+
const Yt = function(t) {
|
|
2127
2127
|
const e = [];
|
|
2128
2128
|
for (let r = 0, n = t.length; r < n; r++) {
|
|
2129
2129
|
const i = t[r];
|
|
@@ -2131,7 +2131,7 @@ const Jt = function(t) {
|
|
|
2131
2131
|
e[r] = { disabled: !0 };
|
|
2132
2132
|
else if (typeof i == "string")
|
|
2133
2133
|
e[r] = { name: i };
|
|
2134
|
-
else if (
|
|
2134
|
+
else if (Jt(i)) {
|
|
2135
2135
|
if (typeof i.name != "string")
|
|
2136
2136
|
throw new _("CSV_OPTION_COLUMNS_MISSING_NAME", [
|
|
2137
2137
|
"Option columns missing name:",
|
|
@@ -2148,9 +2148,9 @@ const Jt = function(t) {
|
|
|
2148
2148
|
}
|
|
2149
2149
|
return e;
|
|
2150
2150
|
};
|
|
2151
|
-
class
|
|
2151
|
+
class ft {
|
|
2152
2152
|
constructor(e = 100) {
|
|
2153
|
-
this.size = e, this.length = 0, this.buf =
|
|
2153
|
+
this.size = e, this.length = 0, this.buf = u.allocUnsafe(e);
|
|
2154
2154
|
}
|
|
2155
2155
|
prepend(e) {
|
|
2156
2156
|
if (N(e)) {
|
|
@@ -2158,7 +2158,7 @@ class st {
|
|
|
2158
2158
|
if (r >= this.size && (this.resize(), r >= this.size))
|
|
2159
2159
|
throw Error("INVALID_BUFFER_STATE");
|
|
2160
2160
|
const n = this.buf;
|
|
2161
|
-
this.buf =
|
|
2161
|
+
this.buf = u.allocUnsafe(this.size), e.copy(this.buf, 0), n.copy(this.buf, e.length), this.length += e.length;
|
|
2162
2162
|
} else {
|
|
2163
2163
|
const r = this.length++;
|
|
2164
2164
|
r === this.size && this.resize();
|
|
@@ -2171,12 +2171,12 @@ class st {
|
|
|
2171
2171
|
r === this.size && this.resize(), this.buf[r] = e;
|
|
2172
2172
|
}
|
|
2173
2173
|
clone() {
|
|
2174
|
-
return
|
|
2174
|
+
return u.from(this.buf.slice(0, this.length));
|
|
2175
2175
|
}
|
|
2176
2176
|
resize() {
|
|
2177
2177
|
const e = this.length;
|
|
2178
2178
|
this.size = this.size * 2;
|
|
2179
|
-
const r =
|
|
2179
|
+
const r = u.allocUnsafe(this.size);
|
|
2180
2180
|
this.buf.copy(r, 0, 0, e), this.buf = r;
|
|
2181
2181
|
}
|
|
2182
2182
|
toString(e) {
|
|
@@ -2189,7 +2189,7 @@ class st {
|
|
|
2189
2189
|
this.length = 0;
|
|
2190
2190
|
}
|
|
2191
2191
|
}
|
|
2192
|
-
const
|
|
2192
|
+
const Dn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
2193
2193
|
return {
|
|
2194
2194
|
bomSkipped: !1,
|
|
2195
2195
|
bufBytesStart: 0,
|
|
@@ -2199,10 +2199,10 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2199
2199
|
error: void 0,
|
|
2200
2200
|
enabled: t.from_line === 1,
|
|
2201
2201
|
escaping: !1,
|
|
2202
|
-
escapeIsQuote: N(t.escape) && N(t.quote) &&
|
|
2202
|
+
escapeIsQuote: N(t.escape) && N(t.quote) && u.compare(t.escape, t.quote) === 0,
|
|
2203
2203
|
// columns can be `false`, `true`, `Array`
|
|
2204
2204
|
expectedRecordLength: Array.isArray(t.columns) ? t.columns.length : void 0,
|
|
2205
|
-
field: new
|
|
2205
|
+
field: new ft(20),
|
|
2206
2206
|
firstLineToHeaders: t.cast_first_line_to_header,
|
|
2207
2207
|
needMoreDataSize: Math.max(
|
|
2208
2208
|
// Skip if the remaining buffer smaller than comment
|
|
@@ -2214,33 +2214,33 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2214
2214
|
previousBuf: void 0,
|
|
2215
2215
|
quoting: !1,
|
|
2216
2216
|
stop: !1,
|
|
2217
|
-
rawBuffer: new
|
|
2217
|
+
rawBuffer: new ft(100),
|
|
2218
2218
|
record: [],
|
|
2219
2219
|
recordHasError: !1,
|
|
2220
2220
|
record_length: 0,
|
|
2221
2221
|
recordDelimiterMaxLength: t.record_delimiter.length === 0 ? 0 : Math.max(...t.record_delimiter.map((e) => e.length)),
|
|
2222
2222
|
trimChars: [
|
|
2223
|
-
|
|
2224
|
-
|
|
2223
|
+
u.from(" ", t.encoding)[0],
|
|
2224
|
+
u.from(" ", t.encoding)[0]
|
|
2225
2225
|
],
|
|
2226
2226
|
wasQuoting: !1,
|
|
2227
2227
|
wasRowDelimiter: !1,
|
|
2228
2228
|
timchars: [
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2229
|
+
u.from(u.from([Fn], "utf8").toString(), t.encoding),
|
|
2230
|
+
u.from(u.from([Mn], "utf8").toString(), t.encoding),
|
|
2231
|
+
u.from(u.from([Dn], "utf8").toString(), t.encoding),
|
|
2232
|
+
u.from(u.from([Bn], "utf8").toString(), t.encoding),
|
|
2233
|
+
u.from(u.from([Un], "utf8").toString(), t.encoding)
|
|
2234
2234
|
]
|
|
2235
2235
|
};
|
|
2236
|
-
},
|
|
2236
|
+
}, Pn = function(t) {
|
|
2237
2237
|
return t.replace(/([A-Z])/g, function(e, r) {
|
|
2238
2238
|
return "_" + r.toLowerCase();
|
|
2239
2239
|
});
|
|
2240
|
-
},
|
|
2240
|
+
}, at = function(t) {
|
|
2241
2241
|
const e = {};
|
|
2242
2242
|
for (const n in t)
|
|
2243
|
-
e[
|
|
2243
|
+
e[Pn(n)] = t[n];
|
|
2244
2244
|
if (e.encoding === void 0 || e.encoding === !0)
|
|
2245
2245
|
e.encoding = "utf8";
|
|
2246
2246
|
else if (e.encoding === null || e.encoding === !1)
|
|
@@ -2303,7 +2303,7 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2303
2303
|
else if (typeof e.columns == "function")
|
|
2304
2304
|
e.cast_first_line_to_header = e.columns, e.columns = !0;
|
|
2305
2305
|
else if (Array.isArray(e.columns))
|
|
2306
|
-
e.columns =
|
|
2306
|
+
e.columns = Yt(e.columns);
|
|
2307
2307
|
else if (e.columns === void 0 || e.columns === null || e.columns === !1)
|
|
2308
2308
|
e.columns = !1;
|
|
2309
2309
|
else
|
|
@@ -2341,7 +2341,7 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2341
2341
|
}
|
|
2342
2342
|
if (e.comment === void 0 || e.comment === null || e.comment === !1 || e.comment === "")
|
|
2343
2343
|
e.comment = null;
|
|
2344
|
-
else if (typeof e.comment == "string" && (e.comment =
|
|
2344
|
+
else if (typeof e.comment == "string" && (e.comment = u.from(e.comment, e.encoding)), !N(e.comment))
|
|
2345
2345
|
throw new _(
|
|
2346
2346
|
"CSV_INVALID_OPTION_COMMENT",
|
|
2347
2347
|
[
|
|
@@ -2376,8 +2376,8 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2376
2376
|
);
|
|
2377
2377
|
if (e.delimiter = e.delimiter.map(function(n) {
|
|
2378
2378
|
if (n == null || n === !1)
|
|
2379
|
-
return
|
|
2380
|
-
if (typeof n == "string" && (n =
|
|
2379
|
+
return u.from(",", e.encoding);
|
|
2380
|
+
if (typeof n == "string" && (n = u.from(n, e.encoding)), !N(n) || n.length === 0)
|
|
2381
2381
|
throw new _(
|
|
2382
2382
|
"CSV_INVALID_OPTION_DELIMITER",
|
|
2383
2383
|
[
|
|
@@ -2388,7 +2388,7 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2388
2388
|
e
|
|
2389
2389
|
);
|
|
2390
2390
|
return n;
|
|
2391
|
-
}), e.escape === void 0 || e.escape === !0 ? e.escape =
|
|
2391
|
+
}), e.escape === void 0 || e.escape === !0 ? e.escape = u.from('"', e.encoding) : typeof e.escape == "string" ? e.escape = u.from(e.escape, e.encoding) : (e.escape === null || e.escape === !1) && (e.escape = null), e.escape !== null && !N(e.escape))
|
|
2392
2392
|
throw new Error(
|
|
2393
2393
|
`Invalid Option: escape must be a buffer, a string or a boolean, got ${JSON.stringify(e.escape)}`
|
|
2394
2394
|
);
|
|
@@ -2492,7 +2492,7 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2492
2492
|
);
|
|
2493
2493
|
if (e.quote === null || e.quote === !1 || e.quote === "")
|
|
2494
2494
|
e.quote = null;
|
|
2495
|
-
else if (e.quote === void 0 || e.quote === !0 ? e.quote =
|
|
2495
|
+
else if (e.quote === void 0 || e.quote === !0 ? e.quote = u.from('"', e.encoding) : typeof e.quote == "string" && (e.quote = u.from(e.quote, e.encoding)), !N(e.quote))
|
|
2496
2496
|
throw new Error(
|
|
2497
2497
|
`Invalid Option: quote must be a buffer or a string, got ${JSON.stringify(e.quote)}`
|
|
2498
2498
|
);
|
|
@@ -2549,7 +2549,7 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2549
2549
|
],
|
|
2550
2550
|
e
|
|
2551
2551
|
);
|
|
2552
|
-
return typeof n == "string" && (n =
|
|
2552
|
+
return typeof n == "string" && (n = u.from(n, e.encoding)), n;
|
|
2553
2553
|
}), typeof e.relax_column_count != "boolean") if (e.relax_column_count === void 0 || e.relax_column_count === null)
|
|
2554
2554
|
e.relax_column_count = !1;
|
|
2555
2555
|
else
|
|
@@ -2635,21 +2635,21 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2635
2635
|
`Invalid Option: to_line must be an integer, got ${JSON.stringify(t.to_line)}`
|
|
2636
2636
|
);
|
|
2637
2637
|
return e;
|
|
2638
|
-
},
|
|
2638
|
+
}, ut = function(t) {
|
|
2639
2639
|
return t.every(
|
|
2640
2640
|
(e) => e == null || e.toString && e.toString().trim() === ""
|
|
2641
2641
|
);
|
|
2642
|
-
},
|
|
2642
|
+
}, $n = 13, jn = 10, re = {
|
|
2643
2643
|
// Note, the following are equals:
|
|
2644
2644
|
// Buffer.from("\ufeff")
|
|
2645
2645
|
// Buffer.from([239, 187, 191])
|
|
2646
2646
|
// Buffer.from('EFBBBF', 'hex')
|
|
2647
|
-
utf8:
|
|
2647
|
+
utf8: u.from([239, 187, 191]),
|
|
2648
2648
|
// Note, the following are equals:
|
|
2649
2649
|
// Buffer.from "\ufeff", 'utf16le
|
|
2650
2650
|
// Buffer.from([255, 254])
|
|
2651
|
-
utf16le:
|
|
2652
|
-
},
|
|
2651
|
+
utf16le: u.from([255, 254])
|
|
2652
|
+
}, qn = function(t = {}) {
|
|
2653
2653
|
const e = {
|
|
2654
2654
|
bytes: 0,
|
|
2655
2655
|
comment_lines: 0,
|
|
@@ -2657,15 +2657,15 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2657
2657
|
invalid_field_length: 0,
|
|
2658
2658
|
lines: 1,
|
|
2659
2659
|
records: 0
|
|
2660
|
-
}, r =
|
|
2660
|
+
}, r = at(t);
|
|
2661
2661
|
return {
|
|
2662
2662
|
info: e,
|
|
2663
2663
|
original_options: t,
|
|
2664
2664
|
options: r,
|
|
2665
|
-
state:
|
|
2665
|
+
state: kn(r),
|
|
2666
2666
|
__needMoreData: function(n, i, o) {
|
|
2667
2667
|
if (o) return !1;
|
|
2668
|
-
const { encoding: s, escape: f, quote:
|
|
2668
|
+
const { encoding: s, escape: f, quote: a } = this.options, { quoting: l, needMoreDataSize: h, recordDelimiterMaxLength: c } = this.state, m = i - n - 1, y = Math.max(
|
|
2669
2669
|
h,
|
|
2670
2670
|
// Skip if the remaining buffer smaller than record delimiter
|
|
2671
2671
|
// If "record_delimiter" is yet to be discovered:
|
|
@@ -2673,24 +2673,24 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2673
2673
|
// 2. We set the length to windows line ending in the current encoding
|
|
2674
2674
|
// Note, that encoding is known from user or bom discovery at that point
|
|
2675
2675
|
// recordDelimiterMaxLength,
|
|
2676
|
-
c === 0 ?
|
|
2676
|
+
c === 0 ? u.from(`\r
|
|
2677
2677
|
`, s).length : c,
|
|
2678
2678
|
// Skip if remaining buffer can be an escaped quote
|
|
2679
|
-
l ? (f === null ? 0 : f.length) +
|
|
2679
|
+
l ? (f === null ? 0 : f.length) + a.length : 0,
|
|
2680
2680
|
// Skip if remaining buffer can be record delimiter following the closing quote
|
|
2681
|
-
l ?
|
|
2681
|
+
l ? a.length + c : 0
|
|
2682
2682
|
);
|
|
2683
|
-
return
|
|
2683
|
+
return m < y;
|
|
2684
2684
|
},
|
|
2685
2685
|
// Central parser implementation
|
|
2686
2686
|
parse: function(n, i, o, s) {
|
|
2687
2687
|
const {
|
|
2688
2688
|
bom: f,
|
|
2689
|
-
comment_no_infix:
|
|
2689
|
+
comment_no_infix: a,
|
|
2690
2690
|
encoding: l,
|
|
2691
2691
|
from_line: h,
|
|
2692
2692
|
ltrim: c,
|
|
2693
|
-
max_record_size:
|
|
2693
|
+
max_record_size: m,
|
|
2694
2694
|
raw: y,
|
|
2695
2695
|
relax_quotes: C,
|
|
2696
2696
|
rtrim: E,
|
|
@@ -2698,8 +2698,8 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2698
2698
|
to: S,
|
|
2699
2699
|
to_line: w
|
|
2700
2700
|
} = this.options;
|
|
2701
|
-
let { comment:
|
|
2702
|
-
const { bomSkipped:
|
|
2701
|
+
let { comment: g, escape: R, quote: U, record_delimiter: Re } = this.options;
|
|
2702
|
+
const { bomSkipped: Wt, previousBuf: he, rawBuffer: Qt, escapeIsQuote: Ht } = this.state;
|
|
2703
2703
|
let v;
|
|
2704
2704
|
if (he === void 0)
|
|
2705
2705
|
if (n === void 0) {
|
|
@@ -2707,8 +2707,8 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2707
2707
|
return;
|
|
2708
2708
|
} else
|
|
2709
2709
|
v = n;
|
|
2710
|
-
else he !== void 0 && n === void 0 ? v = he : v =
|
|
2711
|
-
if (
|
|
2710
|
+
else he !== void 0 && n === void 0 ? v = he : v = u.concat([he, n]);
|
|
2711
|
+
if (Wt === !1)
|
|
2712
2712
|
if (f === !1)
|
|
2713
2713
|
this.state.bomSkipped = !0;
|
|
2714
2714
|
else if (v.length < 3) {
|
|
@@ -2721,13 +2721,13 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2721
2721
|
if (re[O].compare(v, 0, re[O].length) === 0) {
|
|
2722
2722
|
const J = re[O].length;
|
|
2723
2723
|
this.state.bufBytesStart += J, v = v.slice(J);
|
|
2724
|
-
const ce =
|
|
2724
|
+
const ce = at({
|
|
2725
2725
|
...this.original_options,
|
|
2726
2726
|
encoding: O
|
|
2727
2727
|
});
|
|
2728
2728
|
for (const A in ce)
|
|
2729
2729
|
this.options[A] = ce[A];
|
|
2730
|
-
({ comment:
|
|
2730
|
+
({ comment: g, escape: R, quote: U } = this.options);
|
|
2731
2731
|
break;
|
|
2732
2732
|
}
|
|
2733
2733
|
this.state.bomSkipped = !0;
|
|
@@ -2744,11 +2744,11 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2744
2744
|
d
|
|
2745
2745
|
) && (Re = this.options.record_delimiter);
|
|
2746
2746
|
const O = v[d];
|
|
2747
|
-
if (y === !0 &&
|
|
2747
|
+
if (y === !0 && Qt.append(O), (O === $n || O === jn) && this.state.wasRowDelimiter === !1 && (this.state.wasRowDelimiter = !0), this.state.escaping === !0)
|
|
2748
2748
|
this.state.escaping = !1;
|
|
2749
2749
|
else {
|
|
2750
2750
|
if (R !== null && this.state.quoting === !0 && this.__isEscape(v, d, O) && d + R.length < Ie)
|
|
2751
|
-
if (
|
|
2751
|
+
if (Ht) {
|
|
2752
2752
|
if (this.__isQuote(v, d + R.length)) {
|
|
2753
2753
|
this.state.escaping = !0, d += R.length - 1;
|
|
2754
2754
|
continue;
|
|
@@ -2759,7 +2759,7 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2759
2759
|
}
|
|
2760
2760
|
if (this.state.commenting === !1 && this.__isQuote(v, d))
|
|
2761
2761
|
if (this.state.quoting === !0) {
|
|
2762
|
-
const A = v[d + U.length], Z = E && this.__isCharTrimable(v, d + U.length), j =
|
|
2762
|
+
const A = v[d + U.length], Z = E && this.__isCharTrimable(v, d + U.length), j = g !== null && this.__compareBytes(g, v, d + U.length, A), X = this.__isDelimiter(
|
|
2763
2763
|
v,
|
|
2764
2764
|
d + U.length,
|
|
2765
2765
|
A
|
|
@@ -2770,7 +2770,7 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2770
2770
|
this.state.quoting = !1, this.state.wasQuoting = !0, d += U.length - 1;
|
|
2771
2771
|
continue;
|
|
2772
2772
|
} else if (C === !1) {
|
|
2773
|
-
const
|
|
2773
|
+
const He = this.__error(
|
|
2774
2774
|
new _(
|
|
2775
2775
|
"CSV_INVALID_CLOSING_QUOTE",
|
|
2776
2776
|
[
|
|
@@ -2784,7 +2784,7 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2784
2784
|
this.__infoField()
|
|
2785
2785
|
)
|
|
2786
2786
|
);
|
|
2787
|
-
if (
|
|
2787
|
+
if (He !== void 0) return He;
|
|
2788
2788
|
} else
|
|
2789
2789
|
this.state.quoting = !1, this.state.wasQuoting = !0, this.state.field.prepend(U), d += U.length - 1;
|
|
2790
2790
|
} else if (this.state.field.length !== 0) {
|
|
@@ -2846,7 +2846,7 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2846
2846
|
}
|
|
2847
2847
|
if (this.state.commenting)
|
|
2848
2848
|
continue;
|
|
2849
|
-
if (
|
|
2849
|
+
if (g !== null && (a === !1 || this.state.record.length === 0 && this.state.field.length === 0) && this.__compareBytes(g, v, d, O) !== 0) {
|
|
2850
2850
|
this.state.commenting = !0;
|
|
2851
2851
|
continue;
|
|
2852
2852
|
}
|
|
@@ -2860,14 +2860,14 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2860
2860
|
}
|
|
2861
2861
|
}
|
|
2862
2862
|
}
|
|
2863
|
-
if (this.state.commenting === !1 &&
|
|
2863
|
+
if (this.state.commenting === !1 && m !== 0 && this.state.record_length + this.state.field.length > m)
|
|
2864
2864
|
return this.__error(
|
|
2865
2865
|
new _(
|
|
2866
2866
|
"CSV_MAX_RECORD_SIZE",
|
|
2867
2867
|
[
|
|
2868
2868
|
"Max Record Size:",
|
|
2869
2869
|
"record exceed the maximum number of tolerated bytes",
|
|
2870
|
-
`of ${
|
|
2870
|
+
`of ${m}`,
|
|
2871
2871
|
`at line ${this.info.lines}`
|
|
2872
2872
|
],
|
|
2873
2873
|
this.options,
|
|
@@ -2926,18 +2926,18 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2926
2926
|
group_columns_by_name: o,
|
|
2927
2927
|
encoding: s,
|
|
2928
2928
|
info: f,
|
|
2929
|
-
from:
|
|
2929
|
+
from: a,
|
|
2930
2930
|
relax_column_count: l,
|
|
2931
2931
|
relax_column_count_less: h,
|
|
2932
2932
|
relax_column_count_more: c,
|
|
2933
|
-
raw:
|
|
2933
|
+
raw: m,
|
|
2934
2934
|
skip_records_with_empty_values: y
|
|
2935
2935
|
} = this.options, { enabled: C, record: E } = this.state;
|
|
2936
2936
|
if (C === !1)
|
|
2937
2937
|
return this.__resetRecord();
|
|
2938
2938
|
const x = E.length;
|
|
2939
2939
|
if (i === !0) {
|
|
2940
|
-
if (y === !0 &&
|
|
2940
|
+
if (y === !0 && ut(E)) {
|
|
2941
2941
|
this.__resetRecord();
|
|
2942
2942
|
return;
|
|
2943
2943
|
}
|
|
@@ -2977,7 +2977,7 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2977
2977
|
if (w) return w;
|
|
2978
2978
|
}
|
|
2979
2979
|
}
|
|
2980
|
-
if (y === !0 &&
|
|
2980
|
+
if (y === !0 && ut(E)) {
|
|
2981
2981
|
this.__resetRecord();
|
|
2982
2982
|
return;
|
|
2983
2983
|
}
|
|
@@ -2985,42 +2985,42 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2985
2985
|
this.__resetRecord(), this.state.recordHasError = !1;
|
|
2986
2986
|
return;
|
|
2987
2987
|
}
|
|
2988
|
-
if (this.info.records++,
|
|
2988
|
+
if (this.info.records++, a === 1 || this.info.records >= a) {
|
|
2989
2989
|
const { objname: S } = this.options;
|
|
2990
2990
|
if (i !== !1) {
|
|
2991
2991
|
const w = {};
|
|
2992
|
-
for (let
|
|
2993
|
-
i[
|
|
2994
|
-
if (
|
|
2995
|
-
const
|
|
2992
|
+
for (let g = 0, R = E.length; g < R; g++)
|
|
2993
|
+
i[g] === void 0 || i[g].disabled || (o === !0 && w[i[g].name] !== void 0 ? Array.isArray(w[i[g].name]) ? w[i[g].name] = w[i[g].name].concat(E[g]) : w[i[g].name] = [w[i[g].name], E[g]] : w[i[g].name] = E[g]);
|
|
2994
|
+
if (m === !0 || f === !0) {
|
|
2995
|
+
const g = Object.assign(
|
|
2996
2996
|
{ record: w },
|
|
2997
|
-
|
|
2997
|
+
m === !0 ? { raw: this.state.rawBuffer.toString(s) } : {},
|
|
2998
2998
|
f === !0 ? { info: this.__infoRecord() } : {}
|
|
2999
2999
|
), R = this.__push(
|
|
3000
|
-
S === void 0 ?
|
|
3000
|
+
S === void 0 ? g : [w[S], g],
|
|
3001
3001
|
n
|
|
3002
3002
|
);
|
|
3003
3003
|
if (R)
|
|
3004
3004
|
return R;
|
|
3005
3005
|
} else {
|
|
3006
|
-
const
|
|
3006
|
+
const g = this.__push(
|
|
3007
3007
|
S === void 0 ? w : [w[S], w],
|
|
3008
3008
|
n
|
|
3009
3009
|
);
|
|
3010
|
-
if (
|
|
3011
|
-
return
|
|
3010
|
+
if (g)
|
|
3011
|
+
return g;
|
|
3012
3012
|
}
|
|
3013
|
-
} else if (
|
|
3013
|
+
} else if (m === !0 || f === !0) {
|
|
3014
3014
|
const w = Object.assign(
|
|
3015
3015
|
{ record: E },
|
|
3016
|
-
|
|
3016
|
+
m === !0 ? { raw: this.state.rawBuffer.toString(s) } : {},
|
|
3017
3017
|
f === !0 ? { info: this.__infoRecord() } : {}
|
|
3018
|
-
),
|
|
3018
|
+
), g = this.__push(
|
|
3019
3019
|
S === void 0 ? w : [E[S], w],
|
|
3020
3020
|
n
|
|
3021
3021
|
);
|
|
3022
|
-
if (
|
|
3023
|
-
return
|
|
3022
|
+
if (g)
|
|
3023
|
+
return g;
|
|
3024
3024
|
} else {
|
|
3025
3025
|
const w = this.__push(
|
|
3026
3026
|
S === void 0 ? E : [E[S], E],
|
|
@@ -3052,7 +3052,7 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
3052
3052
|
}
|
|
3053
3053
|
)
|
|
3054
3054
|
);
|
|
3055
|
-
const s =
|
|
3055
|
+
const s = Yt(o);
|
|
3056
3056
|
this.state.expectedRecordLength = s.length, this.options.columns = s, this.__resetRecord();
|
|
3057
3057
|
return;
|
|
3058
3058
|
} catch (o) {
|
|
@@ -3063,11 +3063,11 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
3063
3063
|
this.options.raw === !0 && this.state.rawBuffer.reset(), this.state.error = void 0, this.state.record = [], this.state.record_length = 0;
|
|
3064
3064
|
},
|
|
3065
3065
|
__onField: function() {
|
|
3066
|
-
const { cast: n, encoding: i, rtrim: o, max_record_size: s } = this.options, { enabled: f, wasQuoting:
|
|
3066
|
+
const { cast: n, encoding: i, rtrim: o, max_record_size: s } = this.options, { enabled: f, wasQuoting: a } = this.state;
|
|
3067
3067
|
if (f === !1)
|
|
3068
3068
|
return this.__resetField();
|
|
3069
3069
|
let l = this.state.field.toString(i);
|
|
3070
|
-
if (o === !0 &&
|
|
3070
|
+
if (o === !0 && a === !1 && (l = l.trimRight()), n === !0) {
|
|
3071
3071
|
const [h, c] = this.__cast(l);
|
|
3072
3072
|
if (h !== void 0) return h;
|
|
3073
3073
|
l = c;
|
|
@@ -3114,9 +3114,9 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
3114
3114
|
// Helper to test if a character is a space or a line delimiter
|
|
3115
3115
|
__isCharTrimable: function(n, i) {
|
|
3116
3116
|
return ((s, f) => {
|
|
3117
|
-
const { timchars:
|
|
3118
|
-
e: for (let l = 0; l <
|
|
3119
|
-
const h =
|
|
3117
|
+
const { timchars: a } = this.state;
|
|
3118
|
+
e: for (let l = 0; l < a.length; l++) {
|
|
3119
|
+
const h = a[l];
|
|
3120
3120
|
for (let c = 0; c < h.length; c++)
|
|
3121
3121
|
if (h[c] !== s[f + c]) continue e;
|
|
3122
3122
|
return h.length;
|
|
@@ -3136,8 +3136,8 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
3136
3136
|
__compareBytes: function(n, i, o, s) {
|
|
3137
3137
|
if (n[0] !== s) return 0;
|
|
3138
3138
|
const f = n.length;
|
|
3139
|
-
for (let
|
|
3140
|
-
if (n[
|
|
3139
|
+
for (let a = 1; a < f; a++)
|
|
3140
|
+
if (n[a] !== i[o + a]) return 0;
|
|
3141
3141
|
return f;
|
|
3142
3142
|
},
|
|
3143
3143
|
__isDelimiter: function(n, i, o) {
|
|
@@ -3146,8 +3146,8 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
3146
3146
|
return 0;
|
|
3147
3147
|
if (f !== !1 && typeof f == "number" && this.state.record.length === f - 1)
|
|
3148
3148
|
return 0;
|
|
3149
|
-
e: for (let
|
|
3150
|
-
const l = s[
|
|
3149
|
+
e: for (let a = 0; a < s.length; a++) {
|
|
3150
|
+
const l = s[a];
|
|
3151
3151
|
if (l[0] === o) {
|
|
3152
3152
|
for (let h = 1; h < l.length; h++)
|
|
3153
3153
|
if (l[h] !== n[i + h]) continue e;
|
|
@@ -3158,8 +3158,8 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
3158
3158
|
},
|
|
3159
3159
|
__isRecordDelimiter: function(n, i, o) {
|
|
3160
3160
|
const { record_delimiter: s } = this.options, f = s.length;
|
|
3161
|
-
e: for (let
|
|
3162
|
-
const l = s[
|
|
3161
|
+
e: for (let a = 0; a < f; a++) {
|
|
3162
|
+
const l = s[a], h = l.length;
|
|
3163
3163
|
if (l[0] === n) {
|
|
3164
3164
|
for (let c = 1; c < h; c++)
|
|
3165
3165
|
if (l[c] !== i[o + c])
|
|
@@ -3174,8 +3174,8 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
3174
3174
|
if (s === null) return !1;
|
|
3175
3175
|
const f = s.length;
|
|
3176
3176
|
if (s[0] === o) {
|
|
3177
|
-
for (let
|
|
3178
|
-
if (s[
|
|
3177
|
+
for (let a = 0; a < f; a++)
|
|
3178
|
+
if (s[a] !== n[i + a])
|
|
3179
3179
|
return !1;
|
|
3180
3180
|
return !0;
|
|
3181
3181
|
}
|
|
@@ -3193,15 +3193,15 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
3193
3193
|
__autoDiscoverRecordDelimiter: function(n, i) {
|
|
3194
3194
|
const { encoding: o } = this.options, s = [
|
|
3195
3195
|
// Important, the windows line ending must be before mac os 9
|
|
3196
|
-
|
|
3196
|
+
u.from(`\r
|
|
3197
3197
|
`, o),
|
|
3198
|
-
|
|
3198
|
+
u.from(`
|
|
3199
3199
|
`, o),
|
|
3200
|
-
|
|
3200
|
+
u.from("\r", o)
|
|
3201
3201
|
];
|
|
3202
3202
|
e: for (let f = 0; f < s.length; f++) {
|
|
3203
|
-
const
|
|
3204
|
-
for (let l = 0; l <
|
|
3203
|
+
const a = s[f].length;
|
|
3204
|
+
for (let l = 0; l < a; l++)
|
|
3205
3205
|
if (s[f][l] !== n[i + l])
|
|
3206
3206
|
continue e;
|
|
3207
3207
|
return this.options.record_delimiter.push(s[f]), this.state.recordDelimiterMaxLength = s[f].length, s[f].length;
|
|
@@ -3217,8 +3217,8 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
3217
3217
|
f,
|
|
3218
3218
|
o ? this.state.rawBuffer.toString(i) : void 0
|
|
3219
3219
|
);
|
|
3220
|
-
} catch (
|
|
3221
|
-
return
|
|
3220
|
+
} catch (a) {
|
|
3221
|
+
return a;
|
|
3222
3222
|
}
|
|
3223
3223
|
return;
|
|
3224
3224
|
} else
|
|
@@ -3250,9 +3250,9 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
3250
3250
|
}
|
|
3251
3251
|
};
|
|
3252
3252
|
};
|
|
3253
|
-
class
|
|
3253
|
+
class zn extends k {
|
|
3254
3254
|
constructor(e = {}) {
|
|
3255
|
-
super({ readableObjectMode: !0, ...e, encoding: null }), this.api =
|
|
3255
|
+
super({ readableObjectMode: !0, ...e, encoding: null }), this.api = qn({
|
|
3256
3256
|
on_skip: (r, n) => {
|
|
3257
3257
|
this.emit("skip", r, n);
|
|
3258
3258
|
},
|
|
@@ -3292,13 +3292,13 @@ class qn extends k {
|
|
|
3292
3292
|
e(r);
|
|
3293
3293
|
}
|
|
3294
3294
|
}
|
|
3295
|
-
const
|
|
3295
|
+
const lt = function() {
|
|
3296
3296
|
let t, e, r;
|
|
3297
3297
|
for (const i in arguments) {
|
|
3298
3298
|
const o = arguments[i], s = typeof o;
|
|
3299
3299
|
if (t === void 0 && (typeof o == "string" || N(o)))
|
|
3300
3300
|
t = o;
|
|
3301
|
-
else if (e === void 0 &&
|
|
3301
|
+
else if (e === void 0 && Jt(o))
|
|
3302
3302
|
e = o;
|
|
3303
3303
|
else if (r === void 0 && s === "function")
|
|
3304
3304
|
r = o;
|
|
@@ -3309,7 +3309,7 @@ const ut = function() {
|
|
|
3309
3309
|
e || {}
|
|
3310
3310
|
);
|
|
3311
3311
|
}
|
|
3312
|
-
const n = new
|
|
3312
|
+
const n = new zn(e);
|
|
3313
3313
|
if (r) {
|
|
3314
3314
|
const i = e === void 0 || e.objname === void 0 ? [] : {};
|
|
3315
3315
|
n.on("readable", function() {
|
|
@@ -3330,33 +3330,39 @@ const ut = function() {
|
|
|
3330
3330
|
}
|
|
3331
3331
|
return n;
|
|
3332
3332
|
};
|
|
3333
|
-
class
|
|
3333
|
+
class Vn extends Error {
|
|
3334
3334
|
locator;
|
|
3335
3335
|
/** Logical source of the error. */
|
|
3336
3336
|
constructor(e, r, n) {
|
|
3337
3337
|
super(e, n), this.name = new.target.name, this.locator = r;
|
|
3338
3338
|
}
|
|
3339
3339
|
}
|
|
3340
|
-
class Vn extends zn {
|
|
3341
|
-
}
|
|
3342
3340
|
class Jn extends Vn {
|
|
3341
|
+
}
|
|
3342
|
+
class Yn extends Jn {
|
|
3343
3343
|
body;
|
|
3344
3344
|
/** Sanitized HTTP response body. */
|
|
3345
3345
|
constructor(e, r, n, i) {
|
|
3346
|
-
super(e, r, i), this.name = new.target.name, this.body =
|
|
3346
|
+
super(e, r, i), this.name = new.target.name, this.body = Hn(n ?? void 0);
|
|
3347
3347
|
}
|
|
3348
3348
|
}
|
|
3349
|
-
async function
|
|
3349
|
+
async function Wn(t, e, r) {
|
|
3350
3350
|
const n = ` - ${t.statusText}`, i = `${e} Response status '${t.status}${t.statusText ? n : ""}' received.`;
|
|
3351
3351
|
let o;
|
|
3352
3352
|
try {
|
|
3353
3353
|
o = await t.text();
|
|
3354
3354
|
} catch (s) {
|
|
3355
|
-
o = `<body unavailable: ${
|
|
3355
|
+
o = `<body unavailable: ${Qn(s).message}>`;
|
|
3356
3356
|
}
|
|
3357
|
-
return new
|
|
3357
|
+
return new Yn(i, r, o);
|
|
3358
3358
|
}
|
|
3359
|
-
function
|
|
3359
|
+
function Be(t) {
|
|
3360
|
+
try {
|
|
3361
|
+
t();
|
|
3362
|
+
} catch {
|
|
3363
|
+
}
|
|
3364
|
+
}
|
|
3365
|
+
function Qn(t) {
|
|
3360
3366
|
if (t instanceof Error) return t;
|
|
3361
3367
|
if (typeof t == "string") return new Error(t);
|
|
3362
3368
|
if (typeof t == "number" || typeof t == "boolean" || typeof t == "bigint") return new Error(String(t));
|
|
@@ -3369,48 +3375,60 @@ function Wn(t) {
|
|
|
3369
3375
|
}
|
|
3370
3376
|
return new Error("Unknown error");
|
|
3371
3377
|
}
|
|
3372
|
-
function
|
|
3378
|
+
function Hn(t) {
|
|
3373
3379
|
if (!(t == null || t === ""))
|
|
3374
3380
|
return t.length > 2048 ? `${t.slice(0, 2048)}... [truncated]` : t;
|
|
3375
3381
|
}
|
|
3376
|
-
const
|
|
3377
|
-
class
|
|
3382
|
+
const Gn = 1e4, Zn = 4;
|
|
3383
|
+
class ti {
|
|
3378
3384
|
/** Build parser. */
|
|
3379
3385
|
buildParser(e) {
|
|
3380
|
-
return
|
|
3386
|
+
return lt(e);
|
|
3387
|
+
}
|
|
3388
|
+
/**
|
|
3389
|
+
* Determine schema configuration.
|
|
3390
|
+
*/
|
|
3391
|
+
determineSchemaConfig(e, r) {
|
|
3392
|
+
return {
|
|
3393
|
+
recordDelimiter: ei(e)
|
|
3394
|
+
};
|
|
3381
3395
|
}
|
|
3382
|
-
/**
|
|
3396
|
+
/**
|
|
3397
|
+
* Parse stream.
|
|
3398
|
+
*/
|
|
3383
3399
|
async parseStream(e, r, n, i, o) {
|
|
3384
3400
|
return new Promise((s, f) => {
|
|
3385
|
-
let
|
|
3401
|
+
let a, l, h, c = !1, m = !1;
|
|
3386
3402
|
const y = () => {
|
|
3387
|
-
if (
|
|
3388
|
-
|
|
3389
|
-
const x =
|
|
3390
|
-
|
|
3403
|
+
if (m) return;
|
|
3404
|
+
m = !0;
|
|
3405
|
+
const x = a;
|
|
3406
|
+
a = void 0, h = void 0, x != null && (Be(() => x.removeAllListeners()), Be(() => x.end())), Be(() => {
|
|
3391
3407
|
l?.cancel();
|
|
3392
3408
|
}), l = void 0;
|
|
3393
|
-
}
|
|
3409
|
+
};
|
|
3410
|
+
i.signal.addEventListener("abort", y, { once: !0 });
|
|
3411
|
+
const C = (x) => {
|
|
3394
3412
|
c || (c = !0, y(), i.signal.aborted || i.abort(x), f(x));
|
|
3395
3413
|
};
|
|
3396
|
-
|
|
3397
|
-
|
|
3414
|
+
(async () => {
|
|
3415
|
+
a = lt(r), h = Xn({ chunk: o, chunkSize: e.chunkSize ?? Gn }), a.on("readable", () => {
|
|
3398
3416
|
try {
|
|
3399
|
-
if (
|
|
3417
|
+
if (a == null || h == null) return;
|
|
3400
3418
|
let R;
|
|
3401
|
-
for (; (R =
|
|
3419
|
+
for (; (R = a.read()) != null; ) {
|
|
3402
3420
|
if (c) return;
|
|
3403
3421
|
i.signal.throwIfAborted(), h.push(R);
|
|
3404
3422
|
}
|
|
3405
3423
|
} catch (R) {
|
|
3406
3424
|
C(R);
|
|
3407
3425
|
}
|
|
3408
|
-
}),
|
|
3409
|
-
c || (h?.flush(), s(
|
|
3426
|
+
}), a.on("error", (R) => C(R)), a.on("end", () => {
|
|
3427
|
+
c || (h?.flush(), s(Kn(a)));
|
|
3410
3428
|
});
|
|
3411
3429
|
const x = await fetch(encodeURI(n), { signal: i.signal });
|
|
3412
3430
|
if (!x.ok || x.body == null)
|
|
3413
|
-
throw await
|
|
3431
|
+
throw await Wn(x, `Failed to fetch '${n}' file.`, "datapos-connector-file-store-emulator|Connector|retrieve");
|
|
3414
3432
|
l = x.body.getReader();
|
|
3415
3433
|
const S = new TextDecoder(e.encodingId);
|
|
3416
3434
|
let w = await l.read();
|
|
@@ -3418,56 +3436,51 @@ class Zn {
|
|
|
3418
3436
|
if (c) return;
|
|
3419
3437
|
i.signal.throwIfAborted();
|
|
3420
3438
|
const R = S.decode(w.value, { stream: !0 });
|
|
3421
|
-
R.length > 0 &&
|
|
3439
|
+
R.length > 0 && a.write(R), w = await l.read();
|
|
3422
3440
|
}
|
|
3423
3441
|
if (c) return;
|
|
3424
|
-
const
|
|
3425
|
-
|
|
3442
|
+
const g = S.decode();
|
|
3443
|
+
g.length > 0 && a.write(g), a.end();
|
|
3426
3444
|
})().catch((x) => C(x));
|
|
3427
3445
|
});
|
|
3428
3446
|
}
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
return l.length = 0, l;
|
|
3448
|
-
const h = Array.from({ length: r });
|
|
3449
|
-
return h.length = 0, h;
|
|
3450
|
-
}
|
|
3451
|
-
}
|
|
3452
|
-
/** Construct summary. */
|
|
3453
|
-
constructSummary(e) {
|
|
3454
|
-
return {
|
|
3455
|
-
byteCount: e?.info.bytes ?? -1,
|
|
3456
|
-
commentLineCount: e?.info.comment_lines ?? -1,
|
|
3457
|
-
emptyLineCount: e?.info.empty_lines ?? -1,
|
|
3458
|
-
invalidFieldLengthCount: e?.info.invalid_field_length ?? -1,
|
|
3459
|
-
lineCount: e?.info.lines ?? -1,
|
|
3460
|
-
recordCount: e?.info.records ?? -1
|
|
3461
|
-
};
|
|
3462
|
-
}
|
|
3463
|
-
/** Ignore best-effort cleanup errors to keep teardown noise-free. */
|
|
3464
|
-
ignoreErrors(e) {
|
|
3465
|
-
try {
|
|
3466
|
-
e();
|
|
3467
|
-
} catch {
|
|
3468
|
-
}
|
|
3447
|
+
}
|
|
3448
|
+
function Xn(t) {
|
|
3449
|
+
const e = Math.max(1, Math.floor(t.chunkSize)), r = [];
|
|
3450
|
+
let n = f(), i = 0;
|
|
3451
|
+
const o = () => {
|
|
3452
|
+
if (i === 0) return;
|
|
3453
|
+
const a = n;
|
|
3454
|
+
a.length = i, n = f(), i = 0, t.chunk(a), r.length < Zn && r.push(a);
|
|
3455
|
+
};
|
|
3456
|
+
return { flush: o, push: (a) => {
|
|
3457
|
+
n[i++] = a, i >= e && o();
|
|
3458
|
+
} };
|
|
3459
|
+
function f() {
|
|
3460
|
+
const a = r.pop();
|
|
3461
|
+
if (a != null)
|
|
3462
|
+
return a.length = 0, a;
|
|
3463
|
+
const l = Array.from({ length: e });
|
|
3464
|
+
return l.length = 0, l;
|
|
3469
3465
|
}
|
|
3470
3466
|
}
|
|
3467
|
+
function Kn(t) {
|
|
3468
|
+
return {
|
|
3469
|
+
byteCount: t?.info.bytes ?? -1,
|
|
3470
|
+
commentLineCount: t?.info.comment_lines ?? -1,
|
|
3471
|
+
emptyLineCount: t?.info.empty_lines ?? -1,
|
|
3472
|
+
invalidFieldLengthCount: t?.info.invalid_field_length ?? -1,
|
|
3473
|
+
lineCount: t?.info.lines ?? -1,
|
|
3474
|
+
recordCount: t?.info.records ?? -1
|
|
3475
|
+
};
|
|
3476
|
+
}
|
|
3477
|
+
function ei(t) {
|
|
3478
|
+
const e = (t.match(/\r\n/g) ?? []).length, r = (t.match(/(?<!\r)\n/g) ?? []).length, n = (t.match(/\r(?!\n)/g) ?? []).length;
|
|
3479
|
+
return e >= r && e >= n ? `\r
|
|
3480
|
+
` : r >= e && r >= n ? `
|
|
3481
|
+
` : n >= e && n >= r ? "\r" : `
|
|
3482
|
+
`;
|
|
3483
|
+
}
|
|
3471
3484
|
export {
|
|
3472
|
-
|
|
3485
|
+
ti as Tool
|
|
3473
3486
|
};
|