@datapos/datapos-tool-csv-parse 0.0.70 → 0.0.72
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 +542 -543
- package/dist/types/src/index.d.ts +8 -3
- package/package.json +1 -1
|
@@ -31,44 +31,44 @@ function Ze(t) {
|
|
|
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, a = (1 << f) - 1,
|
|
35
|
-
for (
|
|
34
|
+
var o, s, f = i * 8 - n - 1, a = (1 << f) - 1, l = a >> 1, h = -7, c = r ? i - 1 : 0, p = r ? -1 : 1, g = t[e + c];
|
|
35
|
+
for (c += p, o = g & (1 << -h) - 1, g >>= -h, h += f; h > 0; o = o * 256 + t[e + c], c += p, h -= 8)
|
|
36
36
|
;
|
|
37
|
-
for (s = o & (1 << -
|
|
37
|
+
for (s = o & (1 << -h) - 1, o >>= -h, h += n; h > 0; s = s * 256 + t[e + c], c += p, h -= 8)
|
|
38
38
|
;
|
|
39
39
|
if (o === 0)
|
|
40
|
-
o = 1 -
|
|
40
|
+
o = 1 - l;
|
|
41
41
|
else {
|
|
42
42
|
if (o === a)
|
|
43
|
-
return s ? NaN : (
|
|
44
|
-
s = s + Math.pow(2, n), o = o -
|
|
43
|
+
return s ? NaN : (g ? -1 : 1) * (1 / 0);
|
|
44
|
+
s = s + Math.pow(2, n), o = o - l;
|
|
45
45
|
}
|
|
46
|
-
return (
|
|
46
|
+
return (g ? -1 : 1) * s * Math.pow(2, o - n);
|
|
47
47
|
}
|
|
48
48
|
function ht(t, e, r, n, i, o) {
|
|
49
|
-
var s, f, a,
|
|
50
|
-
for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (f = isNaN(e) ? 1 : 0, s =
|
|
49
|
+
var s, f, a, l = o * 8 - i - 1, h = (1 << l) - 1, c = h >> 1, p = i === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, g = n ? 0 : o - 1, x = n ? 1 : -1, y = 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 += p / a : e += p * 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 + g] = f & 255, g += x, f /= 256, i -= 8)
|
|
51
51
|
;
|
|
52
|
-
for (s = s << i | f,
|
|
52
|
+
for (s = s << i | f, l += i; l > 0; t[r + g] = s & 255, g += x, s /= 256, l -= 8)
|
|
53
53
|
;
|
|
54
|
-
t[r +
|
|
54
|
+
t[r + g - x] |= y * 128;
|
|
55
55
|
}
|
|
56
56
|
var er = {}.toString, dt = Array.isArray || function(t) {
|
|
57
57
|
return er.call(t) == "[object Array]";
|
|
58
58
|
}, tr = 50;
|
|
59
|
-
|
|
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(
|
|
@@ -78,47 +78,47 @@ function l(t, e, r) {
|
|
|
78
78
|
}
|
|
79
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
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
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
|
-
|
|
90
|
+
u.from = function(t, e, r) {
|
|
91
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
100
|
function rr(t, e, r, n) {
|
|
101
|
-
return
|
|
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
|
-
|
|
103
|
+
u.alloc = function(t, e, r) {
|
|
104
104
|
return rr(null, t, e, r);
|
|
105
105
|
};
|
|
106
106
|
function ze(t, e) {
|
|
107
|
-
if (
|
|
107
|
+
if (mt(e), t = q(t, e < 0 ? 0 : Ve(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
|
-
|
|
112
|
+
u.allocUnsafe = function(t) {
|
|
113
113
|
return ze(null, t);
|
|
114
114
|
};
|
|
115
|
-
|
|
115
|
+
u.allocUnsafeSlow = function(t) {
|
|
116
116
|
return ze(null, t);
|
|
117
117
|
};
|
|
118
118
|
function nr(t, e, r) {
|
|
119
|
-
if ((typeof r != "string" || r === "") && (r = "utf8"), !
|
|
119
|
+
if ((typeof r != "string" || r === "") && (r = "utf8"), !u.isEncoding(r))
|
|
120
120
|
throw new TypeError('"encoding" must be a valid string encoding');
|
|
121
|
-
var n =
|
|
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;
|
|
@@ -135,7 +135,7 @@ function ir(t, e, r, n) {
|
|
|
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
140
|
function or(t, e) {
|
|
141
141
|
if ($(e)) {
|
|
@@ -155,11 +155,11 @@ function Ve(t) {
|
|
|
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 = D;
|
|
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 @@ l.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 @@ l.isEncoding = function(e) {
|
|
|
188
188
|
return !1;
|
|
189
189
|
}
|
|
190
190
|
};
|
|
191
|
-
|
|
191
|
+
u.concat = function(e, r) {
|
|
192
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))
|
|
@@ -206,7 +206,7 @@ l.concat = function(e, r) {
|
|
|
206
206
|
}
|
|
207
207
|
return i;
|
|
208
208
|
};
|
|
209
|
-
function
|
|
209
|
+
function gt(t, e) {
|
|
210
210
|
if ($(t))
|
|
211
211
|
return t.length;
|
|
212
212
|
if (typeof ArrayBuffer < "u" && typeof ArrayBuffer.isView == "function" && (ArrayBuffer.isView(t) || t instanceof ArrayBuffer))
|
|
@@ -238,7 +238,7 @@ function mt(t, e) {
|
|
|
238
238
|
e = ("" + e).toLowerCase(), n = !0;
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
|
-
|
|
241
|
+
u.byteLength = gt;
|
|
242
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))
|
|
@@ -246,7 +246,7 @@ function sr(t, e, r) {
|
|
|
246
246
|
for (t || (t = "utf8"); ; )
|
|
247
247
|
switch (t) {
|
|
248
248
|
case "hex":
|
|
249
|
-
return
|
|
249
|
+
return gr(this, e, r);
|
|
250
250
|
case "utf8":
|
|
251
251
|
case "utf-8":
|
|
252
252
|
return yt(this, e, r);
|
|
@@ -254,7 +254,7 @@ function sr(t, e, r) {
|
|
|
254
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
259
|
return hr(this, e, r);
|
|
260
260
|
case "ucs2":
|
|
@@ -267,12 +267,12 @@ function sr(t, e, r) {
|
|
|
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 @@ l.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 @@ l.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 @@ l.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
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
|
-
|
|
307
|
+
u.prototype.inspect = function() {
|
|
308
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,9 +320,9 @@ l.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, a = Math.min(s, f),
|
|
324
|
-
if (
|
|
325
|
-
s =
|
|
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
|
+
if (l[c] !== h[c]) {
|
|
325
|
+
s = l[c], f = h[c];
|
|
326
326
|
break;
|
|
327
327
|
}
|
|
328
328
|
return s < f ? -1 : f < s ? 1 : 0;
|
|
@@ -335,10 +335,10 @@ function _t(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 =
|
|
338
|
+
if (typeof e == "string" && (e = u.from(e, n)), $(e))
|
|
339
339
|
return e.length === 0 ? -1 : Xe(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) : Xe(t, [e], r, n, i);
|
|
342
342
|
throw new TypeError("val must be string, number or Buffer");
|
|
343
343
|
}
|
|
344
344
|
function Xe(t, e, r, n, i) {
|
|
@@ -348,35 +348,35 @@ function Xe(t, e, r, n, i) {
|
|
|
348
348
|
return -1;
|
|
349
349
|
o = 2, s /= 2, f /= 2, r /= 2;
|
|
350
350
|
}
|
|
351
|
-
function a(
|
|
352
|
-
return o === 1 ?
|
|
351
|
+
function a(g, x) {
|
|
352
|
+
return o === 1 ? g[x] : g.readUInt16BE(x * o);
|
|
353
353
|
}
|
|
354
|
-
var
|
|
354
|
+
var l;
|
|
355
355
|
if (i) {
|
|
356
|
-
var
|
|
357
|
-
for (
|
|
358
|
-
if (a(t,
|
|
359
|
-
if (
|
|
356
|
+
var h = -1;
|
|
357
|
+
for (l = r; l < s; l++)
|
|
358
|
+
if (a(t, l) === a(e, h === -1 ? 0 : l - h)) {
|
|
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
|
-
for (r + f > s && (r = s - f),
|
|
364
|
-
for (var
|
|
365
|
-
if (a(t,
|
|
366
|
-
|
|
363
|
+
for (r + f > s && (r = s - f), l = r; l >= 0; l--) {
|
|
364
|
+
for (var c = !0, p = 0; p < f; p++)
|
|
365
|
+
if (a(t, l + p) !== a(e, p)) {
|
|
366
|
+
c = !1;
|
|
367
367
|
break;
|
|
368
368
|
}
|
|
369
|
-
if (
|
|
369
|
+
if (c) return l;
|
|
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
|
-
|
|
376
|
+
u.prototype.indexOf = function(e, r, n) {
|
|
377
377
|
return _t(this, e, r, n, !0);
|
|
378
378
|
};
|
|
379
|
-
|
|
379
|
+
u.prototype.lastIndexOf = function(e, r, n) {
|
|
380
380
|
return _t(this, e, r, n, !1);
|
|
381
381
|
};
|
|
382
382
|
function fr(t, e, r, n) {
|
|
@@ -399,16 +399,16 @@ function ar(t, e, r, n) {
|
|
|
399
399
|
function wt(t, e, r, n) {
|
|
400
400
|
return xe(Er(e), t, r, n);
|
|
401
401
|
}
|
|
402
|
-
function
|
|
402
|
+
function ur(t, e, r, n) {
|
|
403
403
|
return wt(t, e, r, n);
|
|
404
404
|
}
|
|
405
|
-
function
|
|
405
|
+
function lr(t, e, r, n) {
|
|
406
406
|
return xe(xt(e), t, r, n);
|
|
407
407
|
}
|
|
408
408
|
function cr(t, e, r, n) {
|
|
409
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")
|
|
@@ -434,9 +434,9 @@ l.prototype.write = function(e, r, n, i) {
|
|
|
434
434
|
return wt(this, e, r, n);
|
|
435
435
|
case "latin1":
|
|
436
436
|
case "binary":
|
|
437
|
-
return lr(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":
|
|
@@ -447,7 +447,7 @@ l.prototype.write = function(e, r, n, 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)
|
|
@@ -461,19 +461,19 @@ function yt(t, e, 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 a,
|
|
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
|
-
a = t[i + 1], (a & 192) === 128 && (
|
|
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
|
-
a = t[i + 1],
|
|
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
|
-
a = t[i + 1],
|
|
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;
|
|
@@ -499,14 +499,14 @@ function pr(t, e, r) {
|
|
|
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)
|
|
506
506
|
n += String.fromCharCode(t[i]);
|
|
507
507
|
return n;
|
|
508
508
|
}
|
|
509
|
-
function
|
|
509
|
+
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)
|
|
@@ -518,15 +518,15 @@ function _r(t, e, r) {
|
|
|
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
|
}
|
|
@@ -536,74 +536,74 @@ 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
|
-
|
|
539
|
+
u.prototype.readUIntLE = function(e, r, n) {
|
|
540
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
|
-
|
|
545
|
+
u.prototype.readUIntBE = function(e, r, n) {
|
|
546
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
|
-
|
|
551
|
+
u.prototype.readUInt8 = function(e, r) {
|
|
552
552
|
return r || L(e, 1, this.length), this[e];
|
|
553
553
|
};
|
|
554
|
-
|
|
554
|
+
u.prototype.readUInt16LE = function(e, r) {
|
|
555
555
|
return r || L(e, 2, this.length), this[e] | this[e + 1] << 8;
|
|
556
556
|
};
|
|
557
|
-
|
|
557
|
+
u.prototype.readUInt16BE = function(e, r) {
|
|
558
558
|
return r || L(e, 2, this.length), this[e] << 8 | this[e + 1];
|
|
559
559
|
};
|
|
560
|
-
|
|
560
|
+
u.prototype.readUInt32LE = function(e, r) {
|
|
561
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
|
-
|
|
563
|
+
u.prototype.readUInt32BE = function(e, r) {
|
|
564
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
|
-
|
|
566
|
+
u.prototype.readIntLE = function(e, r, n) {
|
|
567
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
|
-
|
|
572
|
+
u.prototype.readIntBE = function(e, r, n) {
|
|
573
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
|
-
|
|
578
|
+
u.prototype.readInt8 = function(e, r) {
|
|
579
579
|
return r || L(e, 1, this.length), this[e] & 128 ? (255 - this[e] + 1) * -1 : this[e];
|
|
580
580
|
};
|
|
581
|
-
|
|
581
|
+
u.prototype.readInt16LE = function(e, r) {
|
|
582
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
|
-
|
|
586
|
+
u.prototype.readInt16BE = function(e, r) {
|
|
587
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
|
-
|
|
591
|
+
u.prototype.readInt32LE = function(e, r) {
|
|
592
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
|
-
|
|
594
|
+
u.prototype.readInt32BE = function(e, r) {
|
|
595
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
|
-
|
|
597
|
+
u.prototype.readFloatLE = function(e, r) {
|
|
598
598
|
return r || L(e, 4, this.length), ve(this, e, !0, 23, 4);
|
|
599
599
|
};
|
|
600
|
-
|
|
600
|
+
u.prototype.readFloatBE = function(e, r) {
|
|
601
601
|
return r || L(e, 4, this.length), ve(this, e, !1, 23, 4);
|
|
602
602
|
};
|
|
603
|
-
|
|
603
|
+
u.prototype.readDoubleLE = function(e, r) {
|
|
604
604
|
return r || L(e, 8, this.length), ve(this, e, !0, 52, 8);
|
|
605
605
|
};
|
|
606
|
-
|
|
606
|
+
u.prototype.readDoubleBE = function(e, r) {
|
|
607
607
|
return r || L(e, 8, this.length), ve(this, e, !1, 52, 8);
|
|
608
608
|
};
|
|
609
609
|
function N(t, e, r, n, i, o) {
|
|
@@ -611,7 +611,7 @@ function N(t, e, r, n, i, o) {
|
|
|
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
|
N(this, e, r, n, o, 0);
|
|
@@ -621,7 +621,7 @@ l.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
|
N(this, e, r, n, o, 0);
|
|
@@ -631,32 +631,32 @@ l.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 || N(this, e, r, 1, 255, 0),
|
|
634
|
+
u.prototype.writeUInt8 = function(e, r, n) {
|
|
635
|
+
return e = +e, r = r | 0, n || N(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 || N(this, e, r, 2, 65535, 0),
|
|
642
|
+
u.prototype.writeUInt16LE = function(e, r, n) {
|
|
643
|
+
return e = +e, r = r | 0, n || N(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 || N(this, e, r, 2, 65535, 0),
|
|
645
|
+
u.prototype.writeUInt16BE = function(e, r, n) {
|
|
646
|
+
return e = +e, r = r | 0, n || N(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 || N(this, e, r, 4, 4294967295, 0),
|
|
653
|
+
u.prototype.writeUInt32LE = function(e, r, n) {
|
|
654
|
+
return e = +e, r = r | 0, n || N(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 || N(this, e, r, 4, 4294967295, 0),
|
|
656
|
+
u.prototype.writeUInt32BE = function(e, r, n) {
|
|
657
|
+
return e = +e, r = r | 0, n || N(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
|
N(this, e, r, n, o - 1, -o);
|
|
@@ -666,7 +666,7 @@ l.prototype.writeIntLE = function(e, r, n, i) {
|
|
|
666
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
|
N(this, e, r, n, o - 1, -o);
|
|
@@ -676,20 +676,20 @@ l.prototype.writeIntBE = function(e, r, n, i) {
|
|
|
676
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 || N(this, e, r, 1, 127, -128),
|
|
679
|
+
u.prototype.writeInt8 = function(e, r, n) {
|
|
680
|
+
return e = +e, r = r | 0, n || N(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 || N(this, e, r, 2, 32767, -32768),
|
|
682
|
+
u.prototype.writeInt16LE = function(e, r, n) {
|
|
683
|
+
return e = +e, r = r | 0, n || N(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 || N(this, e, r, 2, 32767, -32768),
|
|
685
|
+
u.prototype.writeInt16BE = function(e, r, n) {
|
|
686
|
+
return e = +e, r = r | 0, n || N(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 || N(this, e, r, 4, 2147483647, -2147483648),
|
|
688
|
+
u.prototype.writeInt32LE = function(e, r, n) {
|
|
689
|
+
return e = +e, r = r | 0, n || N(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 || N(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 || N(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
694
|
function vt(t, e, r, n, i, o) {
|
|
695
695
|
if (r + n > t.length) throw new RangeError("Index out of range");
|
|
@@ -698,22 +698,22 @@ function vt(t, e, r, n, i, o) {
|
|
|
698
698
|
function bt(t, e, r, n, i) {
|
|
699
699
|
return i || vt(t, e, r, 4), ht(t, e, r, n, 23, 4), r + 4;
|
|
700
700
|
}
|
|
701
|
-
|
|
701
|
+
u.prototype.writeFloatLE = function(e, r, n) {
|
|
702
702
|
return bt(this, e, r, !0, n);
|
|
703
703
|
};
|
|
704
|
-
|
|
704
|
+
u.prototype.writeFloatBE = function(e, r, n) {
|
|
705
705
|
return bt(this, e, r, !1, n);
|
|
706
706
|
};
|
|
707
707
|
function Et(t, e, r, n, i) {
|
|
708
708
|
return i || vt(t, e, r, 8), ht(t, e, r, n, 52, 8), r + 8;
|
|
709
709
|
}
|
|
710
|
-
|
|
710
|
+
u.prototype.writeDoubleLE = function(e, r, n) {
|
|
711
711
|
return Et(this, e, r, !0, n);
|
|
712
712
|
};
|
|
713
|
-
|
|
713
|
+
u.prototype.writeDoubleBE = function(e, r, n) {
|
|
714
714
|
return Et(this, e, r, !1, n);
|
|
715
715
|
};
|
|
716
|
-
|
|
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 @@ l.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 @@ l.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 @@ l.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,7 +756,7 @@ l.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
761
|
this[s + r] = f[s % a];
|
|
762
762
|
}
|
|
@@ -859,27 +859,27 @@ var Ce;
|
|
|
859
859
|
function H() {
|
|
860
860
|
}
|
|
861
861
|
H.prototype = /* @__PURE__ */ Object.create(null);
|
|
862
|
-
function
|
|
863
|
-
|
|
864
|
-
}
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
this.domain = null,
|
|
873
|
-
};
|
|
874
|
-
|
|
862
|
+
function m() {
|
|
863
|
+
m.init.call(this);
|
|
864
|
+
}
|
|
865
|
+
m.EventEmitter = m;
|
|
866
|
+
m.usingDomains = !1;
|
|
867
|
+
m.prototype.domain = void 0;
|
|
868
|
+
m.prototype._events = void 0;
|
|
869
|
+
m.prototype._maxListeners = void 0;
|
|
870
|
+
m.defaultMaxListeners = 10;
|
|
871
|
+
m.init = function() {
|
|
872
|
+
this.domain = null, m.usingDomains && Ce.active && !(this instanceof Ce.Domain) && (this.domain = Ce.active), (!this._events || this._events === Object.getPrototypeOf(this)._events) && (this._events = new H(), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;
|
|
873
|
+
};
|
|
874
|
+
m.prototype.setMaxListeners = function(e) {
|
|
875
875
|
if (typeof e != "number" || e < 0 || isNaN(e))
|
|
876
876
|
throw new TypeError('"n" argument must be a positive number');
|
|
877
877
|
return this._maxListeners = e, this;
|
|
878
878
|
};
|
|
879
879
|
function Rt(t) {
|
|
880
|
-
return t._maxListeners === void 0 ?
|
|
880
|
+
return t._maxListeners === void 0 ? m.defaultMaxListeners : t._maxListeners;
|
|
881
881
|
}
|
|
882
|
-
|
|
882
|
+
m.prototype.getMaxListeners = function() {
|
|
883
883
|
return Rt(this);
|
|
884
884
|
};
|
|
885
885
|
function Ir(t, e, r) {
|
|
@@ -917,45 +917,45 @@ function Lr(t, e, r, n) {
|
|
|
917
917
|
for (var i = t.length, o = ae(t, i), s = 0; s < i; ++s)
|
|
918
918
|
o[s].apply(r, n);
|
|
919
919
|
}
|
|
920
|
-
|
|
921
|
-
var r, n, i, o, s, f, a,
|
|
920
|
+
m.prototype.emit = function(e) {
|
|
921
|
+
var r, n, i, o, s, f, a, l = e === "error";
|
|
922
922
|
if (f = this._events, f)
|
|
923
|
-
|
|
924
|
-
else if (!
|
|
923
|
+
l = l && f.error == null;
|
|
924
|
+
else if (!l)
|
|
925
925
|
return !1;
|
|
926
|
-
if (a = this.domain,
|
|
926
|
+
if (a = this.domain, l) {
|
|
927
927
|
if (r = arguments[1], a)
|
|
928
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;
|
|
932
|
-
var
|
|
933
|
-
throw
|
|
932
|
+
var h = new Error('Uncaught, unspecified "error" event. (' + r + ")");
|
|
933
|
+
throw h.context = r, h;
|
|
934
934
|
}
|
|
935
935
|
return !1;
|
|
936
936
|
}
|
|
937
937
|
if (n = f[e], !n)
|
|
938
938
|
return !1;
|
|
939
|
-
var
|
|
939
|
+
var c = typeof n == "function";
|
|
940
940
|
switch (i = arguments.length, i) {
|
|
941
941
|
// fast cases
|
|
942
942
|
case 1:
|
|
943
|
-
Ir(n,
|
|
943
|
+
Ir(n, c, this);
|
|
944
944
|
break;
|
|
945
945
|
case 2:
|
|
946
|
-
Cr(n,
|
|
946
|
+
Cr(n, c, this, arguments[1]);
|
|
947
947
|
break;
|
|
948
948
|
case 3:
|
|
949
|
-
Or(n,
|
|
949
|
+
Or(n, c, this, arguments[1], arguments[2]);
|
|
950
950
|
break;
|
|
951
951
|
case 4:
|
|
952
|
-
Ar(n,
|
|
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
|
-
Lr(n,
|
|
958
|
+
Lr(n, c, this, o);
|
|
959
959
|
}
|
|
960
960
|
return !0;
|
|
961
961
|
};
|
|
@@ -979,11 +979,11 @@ function It(t, e, r, n) {
|
|
|
979
979
|
function Tr(t) {
|
|
980
980
|
typeof console.warn == "function" ? console.warn(t) : console.log(t);
|
|
981
981
|
}
|
|
982
|
-
|
|
982
|
+
m.prototype.addListener = function(e, r) {
|
|
983
983
|
return It(this, e, r, !1);
|
|
984
984
|
};
|
|
985
|
-
|
|
986
|
-
|
|
985
|
+
m.prototype.on = m.prototype.addListener;
|
|
986
|
+
m.prototype.prependListener = function(e, r) {
|
|
987
987
|
return It(this, e, r, !0);
|
|
988
988
|
};
|
|
989
989
|
function Ct(t, e, r) {
|
|
@@ -993,17 +993,17 @@ function Ct(t, e, r) {
|
|
|
993
993
|
}
|
|
994
994
|
return i.listener = r, i;
|
|
995
995
|
}
|
|
996
|
-
|
|
996
|
+
m.prototype.once = function(e, r) {
|
|
997
997
|
if (typeof r != "function")
|
|
998
998
|
throw new TypeError('"listener" argument must be a function');
|
|
999
999
|
return this.on(e, Ct(this, e, r)), this;
|
|
1000
1000
|
};
|
|
1001
|
-
|
|
1001
|
+
m.prototype.prependOnceListener = function(e, r) {
|
|
1002
1002
|
if (typeof r != "function")
|
|
1003
1003
|
throw new TypeError('"listener" argument must be a function');
|
|
1004
1004
|
return this.prependListener(e, Ct(this, e, r)), this;
|
|
1005
1005
|
};
|
|
1006
|
-
|
|
1006
|
+
m.prototype.removeListener = function(e, r) {
|
|
1007
1007
|
var n, i, o, s, f;
|
|
1008
1008
|
if (typeof r != "function")
|
|
1009
1009
|
throw new TypeError('"listener" argument must be a function');
|
|
@@ -1031,7 +1031,7 @@ g.prototype.removeListener = function(e, r) {
|
|
|
1031
1031
|
}
|
|
1032
1032
|
return this;
|
|
1033
1033
|
};
|
|
1034
|
-
|
|
1034
|
+
m.prototype.removeAllListeners = function(e) {
|
|
1035
1035
|
var r, n;
|
|
1036
1036
|
if (n = this._events, !n)
|
|
1037
1037
|
return this;
|
|
@@ -1050,14 +1050,14 @@ g.prototype.removeAllListeners = function(e) {
|
|
|
1050
1050
|
while (r[0]);
|
|
1051
1051
|
return this;
|
|
1052
1052
|
};
|
|
1053
|
-
|
|
1053
|
+
m.prototype.listeners = function(e) {
|
|
1054
1054
|
var r, n, i = this._events;
|
|
1055
1055
|
return i ? (r = i[e], r ? typeof r == "function" ? n = [r.listener || r] : n = Nr(r) : n = []) : n = [], n;
|
|
1056
1056
|
};
|
|
1057
|
-
|
|
1057
|
+
m.listenerCount = function(t, e) {
|
|
1058
1058
|
return typeof t.listenerCount == "function" ? t.listenerCount(e) : Ot.call(t, e);
|
|
1059
1059
|
};
|
|
1060
|
-
|
|
1060
|
+
m.prototype.listenerCount = Ot;
|
|
1061
1061
|
function Ot(t) {
|
|
1062
1062
|
var e = this._events;
|
|
1063
1063
|
if (e) {
|
|
@@ -1069,7 +1069,7 @@ function Ot(t) {
|
|
|
1069
1069
|
}
|
|
1070
1070
|
return 0;
|
|
1071
1071
|
}
|
|
1072
|
-
|
|
1072
|
+
m.prototype.eventNames = function() {
|
|
1073
1073
|
return this._eventsCount > 0 ? Reflect.ownKeys(this._events) : [];
|
|
1074
1074
|
};
|
|
1075
1075
|
function Dr(t, e) {
|
|
@@ -1126,18 +1126,18 @@ function Fr(t) {
|
|
|
1126
1126
|
}
|
|
1127
1127
|
}
|
|
1128
1128
|
}
|
|
1129
|
-
var z = [], ne = !1, ee,
|
|
1129
|
+
var z = [], ne = !1, ee, me = -1;
|
|
1130
1130
|
function Mr() {
|
|
1131
|
-
!ne || !ee || (ne = !1, ee.length ? z = ee.concat(z) :
|
|
1131
|
+
!ne || !ee || (ne = !1, ee.length ? z = ee.concat(z) : me = -1, z.length && Dt());
|
|
1132
1132
|
}
|
|
1133
1133
|
function Dt() {
|
|
1134
1134
|
if (!ne) {
|
|
1135
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
1142
|
ee = null, ne = !1, Fr(t);
|
|
1143
1143
|
}
|
|
@@ -1157,7 +1157,7 @@ Nt.prototype.run = function() {
|
|
|
1157
1157
|
};
|
|
1158
1158
|
var Br = {}, se = ie.performance || {};
|
|
1159
1159
|
se.now || se.mozNow || se.msNow || se.oNow || se.webkitNow;
|
|
1160
|
-
var
|
|
1160
|
+
var ge = {
|
|
1161
1161
|
env: Br
|
|
1162
1162
|
}, ke;
|
|
1163
1163
|
typeof Object.create == "function" ? ke = function(e, r) {
|
|
@@ -1200,7 +1200,7 @@ function kr(t) {
|
|
|
1200
1200
|
return f;
|
|
1201
1201
|
}
|
|
1202
1202
|
}), s = n[r]; r < i; s = n[++r])
|
|
1203
|
-
Je(s) || !
|
|
1203
|
+
Je(s) || !ue(s) ? o += " " + s : o += " " + G(s);
|
|
1204
1204
|
return o;
|
|
1205
1205
|
}
|
|
1206
1206
|
function Ft(t, e) {
|
|
@@ -1208,14 +1208,14 @@ function Ft(t, e) {
|
|
|
1208
1208
|
return function() {
|
|
1209
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
|
}
|
|
@@ -1223,7 +1223,7 @@ function Ft(t, e) {
|
|
|
1223
1223
|
}
|
|
1224
1224
|
var pe = {}, Oe;
|
|
1225
1225
|
function Pr(t) {
|
|
1226
|
-
if (Q(Oe) && (Oe =
|
|
1226
|
+
if (Q(Oe) && (Oe = ge.env.NODE_DEBUG || ""), t = t.toUpperCase(), !pe[t])
|
|
1227
1227
|
if (new RegExp("\\b" + t + "\\b", "i").test(Oe)) {
|
|
1228
1228
|
var e = 0;
|
|
1229
1229
|
pe[t] = function() {
|
|
@@ -1306,20 +1306,20 @@ function ye(t, e, r) {
|
|
|
1306
1306
|
if (Te(e))
|
|
1307
1307
|
return Ae(e);
|
|
1308
1308
|
}
|
|
1309
|
-
var a = "",
|
|
1310
|
-
if (Yr(e) && (
|
|
1311
|
-
var
|
|
1312
|
-
a = " [Function" +
|
|
1309
|
+
var a = "", l = !1, h = ["{", "}"];
|
|
1310
|
+
if (Yr(e) && (l = !0, h = ["[", "]"]), De(e)) {
|
|
1311
|
+
var c = e.name ? ": " + e.name : "";
|
|
1312
|
+
a = " [Function" + c + "]";
|
|
1313
1313
|
}
|
|
1314
|
-
if (Le(e) && (a = " " + RegExp.prototype.toString.call(e)), et(e) && (a = " " + Date.prototype.toUTCString.call(e)), Te(e) && (a = " " + Ae(e)), o.length === 0 && (!
|
|
1315
|
-
return
|
|
1314
|
+
if (Le(e) && (a = " " + RegExp.prototype.toString.call(e)), et(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
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
|
|
1321
|
-
return Pe(t, e, r, s,
|
|
1322
|
-
}), t.seen.pop(), Jr(
|
|
1319
|
+
var p;
|
|
1320
|
+
return l ? p = Vr(t, e, r, s, o) : p = o.map(function(g) {
|
|
1321
|
+
return Pe(t, e, r, s, g, l);
|
|
1322
|
+
}), t.seen.pop(), Jr(p, a, h);
|
|
1323
1323
|
}
|
|
1324
1324
|
function zr(t, e) {
|
|
1325
1325
|
if (Q(e))
|
|
@@ -1363,13 +1363,13 @@ function Pe(t, e, r, n, i, o) {
|
|
|
1363
1363
|
var s, f, a;
|
|
1364
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 ? (Je(r) ? f = ye(t, a.value, null) : f = ye(t, a.value, r - 1), f.indexOf(`
|
|
1365
1365
|
`) > -1 && (o ? f = f.split(`
|
|
1366
|
-
`).map(function(
|
|
1367
|
-
return " " +
|
|
1366
|
+
`).map(function(l) {
|
|
1367
|
+
return " " + l;
|
|
1368
1368
|
}).join(`
|
|
1369
1369
|
`).substr(2) : f = `
|
|
1370
1370
|
` + f.split(`
|
|
1371
|
-
`).map(function(
|
|
1372
|
-
return " " +
|
|
1371
|
+
`).map(function(l) {
|
|
1372
|
+
return " " + l;
|
|
1373
1373
|
}).join(`
|
|
1374
1374
|
`))) : f = t.stylize("[Circular]", "special")), Q(s)) {
|
|
1375
1375
|
if (o && i.match(/^\d+$/))
|
|
@@ -1406,16 +1406,16 @@ function Q(t) {
|
|
|
1406
1406
|
return t === void 0;
|
|
1407
1407
|
}
|
|
1408
1408
|
function Le(t) {
|
|
1409
|
-
return
|
|
1409
|
+
return ue(t) && We(t) === "[object RegExp]";
|
|
1410
1410
|
}
|
|
1411
|
-
function
|
|
1411
|
+
function ue(t) {
|
|
1412
1412
|
return typeof t == "object" && t !== null;
|
|
1413
1413
|
}
|
|
1414
1414
|
function et(t) {
|
|
1415
|
-
return
|
|
1415
|
+
return ue(t) && We(t) === "[object Date]";
|
|
1416
1416
|
}
|
|
1417
1417
|
function Te(t) {
|
|
1418
|
-
return
|
|
1418
|
+
return ue(t) && (We(t) === "[object Error]" || t instanceof Error);
|
|
1419
1419
|
}
|
|
1420
1420
|
function De(t) {
|
|
1421
1421
|
return typeof t == "function";
|
|
@@ -1424,7 +1424,7 @@ function We(t) {
|
|
|
1424
1424
|
return Object.prototype.toString.call(t);
|
|
1425
1425
|
}
|
|
1426
1426
|
function Qr(t, e) {
|
|
1427
|
-
if (!e || !
|
|
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;
|
|
@@ -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 Hr =
|
|
1468
|
+
var Hr = u.isEncoding || function(t) {
|
|
1469
1469
|
switch (t && t.toLowerCase()) {
|
|
1470
1470
|
case "hex":
|
|
1471
1471
|
case "utf8":
|
|
@@ -1487,7 +1487,7 @@ function Gr(t) {
|
|
|
1487
1487
|
if (t && !Hr(t))
|
|
1488
1488
|
throw new Error("Unknown encoding: " + t);
|
|
1489
1489
|
}
|
|
1490
|
-
function
|
|
1490
|
+
function le(t) {
|
|
1491
1491
|
switch (this.encoding = (t || "utf8").toLowerCase().replace(/[-_]/, ""), Gr(t), this.encoding) {
|
|
1492
1492
|
case "utf8":
|
|
1493
1493
|
this.surrogateSize = 3;
|
|
@@ -1503,9 +1503,9 @@ function ue(t) {
|
|
|
1503
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; ) {
|
|
1510
1510
|
var r = t.length >= this.charLength - this.charReceived ? this.charLength - this.charReceived : t.length;
|
|
1511
1511
|
if (t.copy(this.charBuffer, this.charReceived, 0, r), this.charReceived += r, this.charReceived < this.charLength)
|
|
@@ -1530,7 +1530,7 @@ ue.prototype.write = function(t) {
|
|
|
1530
1530
|
}
|
|
1531
1531
|
return e;
|
|
1532
1532
|
};
|
|
1533
|
-
|
|
1533
|
+
le.prototype.detectIncompleteChar = function(t) {
|
|
1534
1534
|
for (var e = t.length >= 3 ? 3 : t.length; e > 0; e--) {
|
|
1535
1535
|
var r = t[t.length - e];
|
|
1536
1536
|
if (e == 1 && r >> 5 == 6) {
|
|
@@ -1548,7 +1548,7 @@ ue.prototype.detectIncompleteChar = function(t) {
|
|
|
1548
1548
|
}
|
|
1549
1549
|
this.charReceived = e;
|
|
1550
1550
|
};
|
|
1551
|
-
|
|
1551
|
+
le.prototype.end = function(t) {
|
|
1552
1552
|
var e = "";
|
|
1553
1553
|
if (t && t.length && (e = this.write(t)), this.charReceived) {
|
|
1554
1554
|
var r = this.charReceived, n = this.charBuffer, i = this.encoding;
|
|
@@ -1565,9 +1565,9 @@ function Xr(t) {
|
|
|
1565
1565
|
function Kr(t) {
|
|
1566
1566
|
this.charReceived = t.length % 3, this.charLength = this.charReceived ? 3 : 0;
|
|
1567
1567
|
}
|
|
1568
|
-
|
|
1569
|
-
var
|
|
1570
|
-
oe(
|
|
1568
|
+
C.ReadableState = Ut;
|
|
1569
|
+
var E = Pr("stream");
|
|
1570
|
+
oe(C, m);
|
|
1571
1571
|
function en(t, e, r) {
|
|
1572
1572
|
if (typeof t.prependListener == "function")
|
|
1573
1573
|
return t.prependListener(e, r);
|
|
@@ -1579,21 +1579,21 @@ function tn(t, e) {
|
|
|
1579
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
|
-
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
|
|
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
|
-
function
|
|
1585
|
-
if (!(this instanceof
|
|
1586
|
-
this._readableState = new Ut(t, this), this.readable = !0, t && typeof t.read == "function" && (this._read = t.read),
|
|
1584
|
+
function C(t) {
|
|
1585
|
+
if (!(this instanceof C)) return new C(t);
|
|
1586
|
+
this._readableState = new Ut(t, this), this.readable = !0, t && typeof t.read == "function" && (this._read = t.read), m.call(this);
|
|
1587
1587
|
}
|
|
1588
|
-
|
|
1588
|
+
C.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
|
+
C.prototype.unshift = function(t) {
|
|
1593
1593
|
var e = this._readableState;
|
|
1594
1594
|
return kt(this, e, t, "", !0);
|
|
1595
1595
|
};
|
|
1596
|
-
|
|
1596
|
+
C.prototype.isPaused = function() {
|
|
1597
1597
|
return this._readableState.flowing === !1;
|
|
1598
1598
|
};
|
|
1599
1599
|
function kt(t, e, r, n, i) {
|
|
@@ -1619,8 +1619,8 @@ function kt(t, e, r, n, i) {
|
|
|
1619
1619
|
function rn(t) {
|
|
1620
1620
|
return !t.ended && (t.needReadable || t.length < t.highWaterMark || t.length === 0);
|
|
1621
1621
|
}
|
|
1622
|
-
|
|
1623
|
-
return this._readableState.decoder = new
|
|
1622
|
+
C.prototype.setEncoding = function(t) {
|
|
1623
|
+
return this._readableState.decoder = new le(t), this._readableState.encoding = t, this;
|
|
1624
1624
|
};
|
|
1625
1625
|
var tt = 8388608;
|
|
1626
1626
|
function nn(t) {
|
|
@@ -1629,15 +1629,15 @@ function nn(t) {
|
|
|
1629
1629
|
function rt(t, e) {
|
|
1630
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
|
-
|
|
1633
|
-
|
|
1632
|
+
C.prototype.read = function(t) {
|
|
1633
|
+
E("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
|
-
return
|
|
1636
|
+
return E("read: emitReadable", e.length, e.ended), e.length === 0 && e.ended ? Ne(this) : Se(this), null;
|
|
1637
1637
|
if (t = rt(t, e), t === 0 && e.ended)
|
|
1638
1638
|
return e.length === 0 && Ne(this), null;
|
|
1639
1639
|
var n = e.needReadable;
|
|
1640
|
-
|
|
1640
|
+
E("need readable", n), (e.length === 0 || e.length - t < e.highWaterMark) && (n = !0, E("length less than watermark", n)), e.ended || e.reading ? (n = !1, E("reading or ended", n)) : n && (E("do read"), e.reading = !0, e.sync = !0, e.length === 0 && (e.needReadable = !0), this._read(e.highWaterMark), e.sync = !1, e.reading || (t = rt(r, e)));
|
|
1641
1641
|
var i;
|
|
1642
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 && Ne(this)), i !== null && this.emit("data", i), i;
|
|
1643
1643
|
};
|
|
@@ -1656,23 +1656,23 @@ function sn(t, e) {
|
|
|
1656
1656
|
}
|
|
1657
1657
|
function Se(t) {
|
|
1658
1658
|
var e = t._readableState;
|
|
1659
|
-
e.needReadable = !1, e.emittedReadable || (
|
|
1659
|
+
e.needReadable = !1, e.emittedReadable || (E("emitReadable", e.flowing), e.emittedReadable = !0, e.sync ? B(nt, t) : nt(t));
|
|
1660
1660
|
}
|
|
1661
1661
|
function nt(t) {
|
|
1662
|
-
|
|
1662
|
+
E("emit readable"), t.emit("readable"), Qe(t);
|
|
1663
1663
|
}
|
|
1664
1664
|
function fn(t, e) {
|
|
1665
1665
|
e.readingMore || (e.readingMore = !0, B(an, t, e));
|
|
1666
1666
|
}
|
|
1667
1667
|
function an(t, e) {
|
|
1668
|
-
for (var r = e.length; !e.reading && !e.flowing && !e.ended && e.length < e.highWaterMark && (
|
|
1668
|
+
for (var r = e.length; !e.reading && !e.flowing && !e.ended && e.length < e.highWaterMark && (E("maybeReadMore read 0"), t.read(0), r !== e.length); )
|
|
1669
1669
|
r = e.length;
|
|
1670
1670
|
e.readingMore = !1;
|
|
1671
1671
|
}
|
|
1672
|
-
|
|
1672
|
+
C.prototype._read = function(t) {
|
|
1673
1673
|
this.emit("error", new Error("not implemented"));
|
|
1674
1674
|
};
|
|
1675
|
-
|
|
1675
|
+
C.prototype.pipe = function(t, e) {
|
|
1676
1676
|
var r = this, n = this._readableState;
|
|
1677
1677
|
switch (n.pipesCount) {
|
|
1678
1678
|
case 0:
|
|
@@ -1685,52 +1685,52 @@ I.prototype.pipe = function(t, e) {
|
|
|
1685
1685
|
n.pipes.push(t);
|
|
1686
1686
|
break;
|
|
1687
1687
|
}
|
|
1688
|
-
n.pipesCount += 1,
|
|
1689
|
-
var i = !e || e.end !== !1, o = i ? f :
|
|
1688
|
+
n.pipesCount += 1, E("pipe count=%d opts=%j", n.pipesCount, e);
|
|
1689
|
+
var i = !e || e.end !== !1, o = i ? f : h;
|
|
1690
1690
|
n.endEmitted ? B(o) : r.once("end", o), t.on("unpipe", s);
|
|
1691
|
-
function s(
|
|
1692
|
-
|
|
1691
|
+
function s(R) {
|
|
1692
|
+
E("onunpipe"), R === r && h();
|
|
1693
1693
|
}
|
|
1694
1694
|
function f() {
|
|
1695
|
-
|
|
1695
|
+
E("onend"), t.end();
|
|
1696
1696
|
}
|
|
1697
|
-
var a =
|
|
1697
|
+
var a = un(r);
|
|
1698
1698
|
t.on("drain", a);
|
|
1699
|
-
var
|
|
1700
|
-
function
|
|
1701
|
-
|
|
1699
|
+
var l = !1;
|
|
1700
|
+
function h() {
|
|
1701
|
+
E("cleanup"), t.removeListener("close", x), t.removeListener("finish", y), t.removeListener("drain", a), t.removeListener("error", g), t.removeListener("unpipe", s), r.removeListener("end", f), r.removeListener("end", h), r.removeListener("data", p), l = !0, n.awaitDrain && (!t._writableState || t._writableState.needDrain) && a();
|
|
1702
1702
|
}
|
|
1703
|
-
var
|
|
1704
|
-
r.on("data",
|
|
1705
|
-
function
|
|
1706
|
-
|
|
1707
|
-
var
|
|
1708
|
-
|
|
1703
|
+
var c = !1;
|
|
1704
|
+
r.on("data", p);
|
|
1705
|
+
function p(R) {
|
|
1706
|
+
E("ondata"), c = !1;
|
|
1707
|
+
var v = t.write(R);
|
|
1708
|
+
v === !1 && !c && ((n.pipesCount === 1 && n.pipes === t || n.pipesCount > 1 && $t(n.pipes, t) !== -1) && !l && (E("false write response, pause", r._readableState.awaitDrain), r._readableState.awaitDrain++, c = !0), r.pause());
|
|
1709
1709
|
}
|
|
1710
|
-
function
|
|
1711
|
-
|
|
1710
|
+
function g(R) {
|
|
1711
|
+
E("onerror", R), S(), t.removeListener("error", g), tn(t, "error") === 0 && t.emit("error", R);
|
|
1712
1712
|
}
|
|
1713
|
-
en(t, "error",
|
|
1714
|
-
function
|
|
1715
|
-
t.removeListener("finish",
|
|
1713
|
+
en(t, "error", g);
|
|
1714
|
+
function x() {
|
|
1715
|
+
t.removeListener("finish", y), S();
|
|
1716
1716
|
}
|
|
1717
|
-
t.once("close",
|
|
1718
|
-
function
|
|
1719
|
-
|
|
1717
|
+
t.once("close", x);
|
|
1718
|
+
function y() {
|
|
1719
|
+
E("onfinish"), t.removeListener("close", x), S();
|
|
1720
1720
|
}
|
|
1721
|
-
t.once("finish",
|
|
1722
|
-
function
|
|
1723
|
-
|
|
1721
|
+
t.once("finish", y);
|
|
1722
|
+
function S() {
|
|
1723
|
+
E("unpipe"), r.unpipe(t);
|
|
1724
1724
|
}
|
|
1725
|
-
return t.emit("pipe", r), n.flowing || (
|
|
1725
|
+
return t.emit("pipe", r), n.flowing || (E("pipe resume"), r.resume()), t;
|
|
1726
1726
|
};
|
|
1727
|
-
function
|
|
1727
|
+
function un(t) {
|
|
1728
1728
|
return function() {
|
|
1729
1729
|
var e = t._readableState;
|
|
1730
|
-
|
|
1730
|
+
E("pipeOnDrain", e.awaitDrain), e.awaitDrain && e.awaitDrain--, e.awaitDrain === 0 && t.listeners("data").length && (e.flowing = !0, Qe(t));
|
|
1731
1731
|
};
|
|
1732
1732
|
}
|
|
1733
|
-
|
|
1733
|
+
C.prototype.unpipe = function(t) {
|
|
1734
1734
|
var e = this._readableState;
|
|
1735
1735
|
if (e.pipesCount === 0) return this;
|
|
1736
1736
|
if (e.pipesCount === 1)
|
|
@@ -1745,48 +1745,48 @@ I.prototype.unpipe = function(t) {
|
|
|
1745
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
|
-
|
|
1749
|
-
var r =
|
|
1748
|
+
C.prototype.on = function(t, e) {
|
|
1749
|
+
var r = m.prototype.on.call(this, t, e);
|
|
1750
1750
|
if (t === "data")
|
|
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
|
-
|
|
1759
|
-
function
|
|
1760
|
-
|
|
1758
|
+
C.prototype.addListener = C.prototype.on;
|
|
1759
|
+
function ln(t) {
|
|
1760
|
+
E("readable nexttick read 0"), t.read(0);
|
|
1761
1761
|
}
|
|
1762
|
-
|
|
1762
|
+
C.prototype.resume = function() {
|
|
1763
1763
|
var t = this._readableState;
|
|
1764
|
-
return t.flowing || (
|
|
1764
|
+
return t.flowing || (E("resume"), t.flowing = !0, cn(this, t)), this;
|
|
1765
1765
|
};
|
|
1766
1766
|
function cn(t, e) {
|
|
1767
1767
|
e.resumeScheduled || (e.resumeScheduled = !0, B(hn, t, e));
|
|
1768
1768
|
}
|
|
1769
1769
|
function hn(t, e) {
|
|
1770
|
-
e.reading || (
|
|
1770
|
+
e.reading || (E("resume read 0"), t.read(0)), e.resumeScheduled = !1, e.awaitDrain = 0, t.emit("resume"), Qe(t), e.flowing && !e.reading && t.read(0);
|
|
1771
1771
|
}
|
|
1772
|
-
|
|
1773
|
-
return
|
|
1772
|
+
C.prototype.pause = function() {
|
|
1773
|
+
return E("call pause flowing=%j", this._readableState.flowing), this._readableState.flowing !== !1 && (E("pause"), this._readableState.flowing = !1, this.emit("pause")), this;
|
|
1774
1774
|
};
|
|
1775
1775
|
function Qe(t) {
|
|
1776
1776
|
var e = t._readableState;
|
|
1777
|
-
for (
|
|
1777
|
+
for (E("flow", e.flowing); e.flowing && t.read() !== null; )
|
|
1778
1778
|
;
|
|
1779
1779
|
}
|
|
1780
|
-
|
|
1780
|
+
C.prototype.wrap = function(t) {
|
|
1781
1781
|
var e = this._readableState, r = !1, n = this;
|
|
1782
1782
|
t.on("end", function() {
|
|
1783
|
-
if (
|
|
1783
|
+
if (E("wrapped end"), e.decoder && !e.ended) {
|
|
1784
1784
|
var s = e.decoder.end();
|
|
1785
1785
|
s && s.length && n.push(s);
|
|
1786
1786
|
}
|
|
1787
1787
|
n.push(null);
|
|
1788
1788
|
}), t.on("data", function(s) {
|
|
1789
|
-
if (
|
|
1789
|
+
if (E("wrapped data"), e.decoder && (s = e.decoder.write(s)), !(e.objectMode && s == null) && !(!e.objectMode && (!s || !s.length))) {
|
|
1790
1790
|
var f = n.push(s);
|
|
1791
1791
|
f || (r = !0, t.pause());
|
|
1792
1792
|
}
|
|
@@ -1801,10 +1801,10 @@ I.prototype.wrap = function(t) {
|
|
|
1801
1801
|
return _n(o, function(s) {
|
|
1802
1802
|
t.on(s, n.emit.bind(n, s));
|
|
1803
1803
|
}), n._read = function(s) {
|
|
1804
|
-
|
|
1804
|
+
E("wrapped _read", s), r && (r = !1, t.resume());
|
|
1805
1805
|
}, n;
|
|
1806
1806
|
};
|
|
1807
|
-
|
|
1807
|
+
C._fromList = Pt;
|
|
1808
1808
|
function Pt(t, e) {
|
|
1809
1809
|
if (e.length === 0) return null;
|
|
1810
1810
|
var r;
|
|
@@ -1812,7 +1812,7 @@ function Pt(t, e) {
|
|
|
1812
1812
|
}
|
|
1813
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 ? pn(t, e) :
|
|
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
1817
|
function pn(t, e) {
|
|
1818
1818
|
var r = e.head, n = 1, i = r.data;
|
|
@@ -1826,8 +1826,8 @@ function pn(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) {
|
|
@@ -1841,9 +1841,9 @@ function gn(t, e) {
|
|
|
1841
1841
|
function Ne(t) {
|
|
1842
1842
|
var e = t._readableState;
|
|
1843
1843
|
if (e.length > 0) throw new Error('"endReadable()" called on non-empty stream');
|
|
1844
|
-
e.endEmitted || (e.ended = !0, B(
|
|
1844
|
+
e.endEmitted || (e.ended = !0, B(gn, e, t));
|
|
1845
1845
|
}
|
|
1846
|
-
function
|
|
1846
|
+
function gn(t, e) {
|
|
1847
1847
|
!t.endEmitted && t.length === 0 && (t.endEmitted = !0, e.readable = !1, e.emit("end"));
|
|
1848
1848
|
}
|
|
1849
1849
|
function _n(t, e) {
|
|
@@ -1856,7 +1856,7 @@ function $t(t, e) {
|
|
|
1856
1856
|
return -1;
|
|
1857
1857
|
}
|
|
1858
1858
|
T.WritableState = He;
|
|
1859
|
-
oe(T,
|
|
1859
|
+
oe(T, m);
|
|
1860
1860
|
function wn() {
|
|
1861
1861
|
}
|
|
1862
1862
|
function yn(t, e, r) {
|
|
@@ -1882,7 +1882,7 @@ He.prototype.getBuffer = function() {
|
|
|
1882
1882
|
};
|
|
1883
1883
|
function T(t) {
|
|
1884
1884
|
if (!(this instanceof T) && !(this instanceof M)) return new T(t);
|
|
1885
|
-
this._writableState = new He(t, this), this.writable = !0, t && (typeof t.write == "function" && (this._write = t.write), typeof t.writev == "function" && (this._writev = t.writev)),
|
|
1885
|
+
this._writableState = new He(t, this), this.writable = !0, t && (typeof t.write == "function" && (this._write = t.write), typeof t.writev == "function" && (this._writev = t.writev)), m.call(this);
|
|
1886
1886
|
}
|
|
1887
1887
|
T.prototype.pipe = function() {
|
|
1888
1888
|
this.emit("error", new Error("Cannot pipe, not readable"));
|
|
@@ -1893,11 +1893,11 @@ function vn(t, e) {
|
|
|
1893
1893
|
}
|
|
1894
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;
|
|
@@ -1912,10 +1912,10 @@ T.prototype.setDefaultEncoding = function(e) {
|
|
|
1912
1912
|
return this._writableState.defaultEncoding = e, this;
|
|
1913
1913
|
};
|
|
1914
1914
|
function En(t, e, r) {
|
|
1915
|
-
return !t.objectMode && t.decodeStrings !== !1 && typeof e == "string" && (e =
|
|
1915
|
+
return !t.objectMode && t.decodeStrings !== !1 && typeof e == "string" && (e = u.from(e, r)), e;
|
|
1916
1916
|
}
|
|
1917
1917
|
function xn(t, e, r, n, i) {
|
|
1918
|
-
r = En(e, r, n),
|
|
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;
|
|
@@ -1960,8 +1960,8 @@ function jt(t, e) {
|
|
|
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, a = r.encoding,
|
|
1964
|
-
if ($e(t, e, !1,
|
|
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);
|
|
@@ -2000,7 +2000,7 @@ function Vt(t) {
|
|
|
2000
2000
|
t.corkedRequestsFree ? t.corkedRequestsFree.next = e : t.corkedRequestsFree = e;
|
|
2001
2001
|
};
|
|
2002
2002
|
}
|
|
2003
|
-
oe(M,
|
|
2003
|
+
oe(M, C);
|
|
2004
2004
|
var st = Object.keys(T.prototype);
|
|
2005
2005
|
for (var Fe = 0; Fe < st.length; Fe++) {
|
|
2006
2006
|
var Me = st[Fe];
|
|
@@ -2008,7 +2008,7 @@ for (var Fe = 0; Fe < st.length; Fe++) {
|
|
|
2008
2008
|
}
|
|
2009
2009
|
function M(t) {
|
|
2010
2010
|
if (!(this instanceof M)) return new M(t);
|
|
2011
|
-
|
|
2011
|
+
C.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
2013
|
function An() {
|
|
2014
2014
|
this.allowHalfOpen || this._writableState.ended || B(Ln, this);
|
|
@@ -2073,20 +2073,20 @@ function fe(t) {
|
|
|
2073
2073
|
fe.prototype._transform = function(t, e, r) {
|
|
2074
2074
|
r(null, t);
|
|
2075
2075
|
};
|
|
2076
|
-
oe(V,
|
|
2077
|
-
V.Readable =
|
|
2076
|
+
oe(V, m);
|
|
2077
|
+
V.Readable = C;
|
|
2078
2078
|
V.Writable = T;
|
|
2079
2079
|
V.Duplex = M;
|
|
2080
2080
|
V.Transform = k;
|
|
2081
2081
|
V.PassThrough = fe;
|
|
2082
2082
|
V.Stream = V;
|
|
2083
2083
|
function V() {
|
|
2084
|
-
|
|
2084
|
+
m.call(this);
|
|
2085
2085
|
}
|
|
2086
2086
|
V.prototype.pipe = function(t, e) {
|
|
2087
2087
|
var r = this;
|
|
2088
|
-
function n(
|
|
2089
|
-
t.writable && t.write(
|
|
2088
|
+
function n(h) {
|
|
2089
|
+
t.writable && t.write(h) === !1 && r.pause && r.pause();
|
|
2090
2090
|
}
|
|
2091
2091
|
r.on("data", n);
|
|
2092
2092
|
function i() {
|
|
@@ -2100,15 +2100,15 @@ 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 a(
|
|
2104
|
-
if (
|
|
2105
|
-
throw
|
|
2103
|
+
function a(h) {
|
|
2104
|
+
if (l(), m.listenerCount(this, "error") === 0)
|
|
2105
|
+
throw h;
|
|
2106
2106
|
}
|
|
2107
2107
|
r.on("error", a), t.on("error", a);
|
|
2108
|
-
function
|
|
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",
|
|
2108
|
+
function l() {
|
|
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
|
-
return r.on("end",
|
|
2111
|
+
return r.on("end", l), r.on("close", l), t.on("close", l), t.emit("pipe", r), t;
|
|
2112
2112
|
};
|
|
2113
2113
|
const Jt = function(t) {
|
|
2114
2114
|
return typeof t == "object" && t !== null && !Array.isArray(t);
|
|
@@ -2150,7 +2150,7 @@ const Yt = function(t) {
|
|
|
2150
2150
|
};
|
|
2151
2151
|
class at {
|
|
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 (D(e)) {
|
|
@@ -2158,7 +2158,7 @@ class at {
|
|
|
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 at {
|
|
|
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) {
|
|
@@ -2199,7 +2199,7 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
2199
2199
|
error: void 0,
|
|
2200
2200
|
enabled: t.from_line === 1,
|
|
2201
2201
|
escaping: !1,
|
|
2202
|
-
escapeIsQuote: D(t.escape) && D(t.quote) &&
|
|
2202
|
+
escapeIsQuote: D(t.escape) && D(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
2205
|
field: new at(20),
|
|
@@ -2220,24 +2220,24 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
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([Nn], "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
|
+
}, ut = function(t) {
|
|
2241
2241
|
const e = {};
|
|
2242
2242
|
for (const n in t)
|
|
2243
2243
|
e[Pn(n)] = t[n];
|
|
@@ -2341,7 +2341,7 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = 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)), !D(e.comment))
|
|
2345
2345
|
throw new w(
|
|
2346
2346
|
"CSV_INVALID_OPTION_COMMENT",
|
|
2347
2347
|
[
|
|
@@ -2376,8 +2376,8 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = 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)), !D(n) || n.length === 0)
|
|
2381
2381
|
throw new w(
|
|
2382
2382
|
"CSV_INVALID_OPTION_DELIMITER",
|
|
2383
2383
|
[
|
|
@@ -2388,7 +2388,7 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = 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 && !D(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, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = 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)), !D(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, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = 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,7 +2635,7 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = 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
|
+
}, lt = function(t) {
|
|
2639
2639
|
return t.every(
|
|
2640
2640
|
(e) => e == null || e.toString && e.toString().trim() === ""
|
|
2641
2641
|
);
|
|
@@ -2644,11 +2644,11 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
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:
|
|
2651
|
+
utf16le: u.from([255, 254])
|
|
2652
2652
|
}, qn = function(t = {}) {
|
|
2653
2653
|
const e = {
|
|
2654
2654
|
bytes: 0,
|
|
@@ -2657,7 +2657,7 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
2657
2657
|
invalid_field_length: 0,
|
|
2658
2658
|
lines: 1,
|
|
2659
2659
|
records: 0
|
|
2660
|
-
}, r =
|
|
2660
|
+
}, r = ut(t);
|
|
2661
2661
|
return {
|
|
2662
2662
|
info: e,
|
|
2663
2663
|
original_options: t,
|
|
@@ -2665,111 +2665,111 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
2665
2665
|
state: kn(r),
|
|
2666
2666
|
__needMoreData: function(n, i, o) {
|
|
2667
2667
|
if (o) return !1;
|
|
2668
|
-
const { encoding: s, escape: f, quote: a } = this.options, { quoting:
|
|
2669
|
-
|
|
2668
|
+
const { encoding: s, escape: f, quote: a } = this.options, { quoting: l, needMoreDataSize: h, recordDelimiterMaxLength: c } = this.state, p = i - n - 1, g = Math.max(
|
|
2669
|
+
h,
|
|
2670
2670
|
// Skip if the remaining buffer smaller than record delimiter
|
|
2671
2671
|
// If "record_delimiter" is yet to be discovered:
|
|
2672
2672
|
// 1. It is equals to `[]` and "recordDelimiterMaxLength" equals `0`
|
|
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
|
-
|
|
2677
|
-
`, s).length :
|
|
2676
|
+
c === 0 ? u.from(`\r
|
|
2677
|
+
`, s).length : c,
|
|
2678
2678
|
// Skip if remaining buffer can be an escaped quote
|
|
2679
|
-
|
|
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
|
-
|
|
2681
|
+
l ? a.length + c : 0
|
|
2682
2682
|
);
|
|
2683
|
-
return
|
|
2683
|
+
return p < g;
|
|
2684
2684
|
},
|
|
2685
2685
|
// Central parser implementation
|
|
2686
2686
|
parse: function(n, i, o, s) {
|
|
2687
2687
|
const {
|
|
2688
2688
|
bom: f,
|
|
2689
2689
|
comment_no_infix: a,
|
|
2690
|
-
encoding:
|
|
2691
|
-
from_line:
|
|
2692
|
-
ltrim:
|
|
2693
|
-
max_record_size:
|
|
2694
|
-
raw:
|
|
2695
|
-
relax_quotes:
|
|
2696
|
-
rtrim:
|
|
2697
|
-
skip_empty_lines:
|
|
2698
|
-
to:
|
|
2699
|
-
to_line:
|
|
2690
|
+
encoding: l,
|
|
2691
|
+
from_line: h,
|
|
2692
|
+
ltrim: c,
|
|
2693
|
+
max_record_size: p,
|
|
2694
|
+
raw: g,
|
|
2695
|
+
relax_quotes: x,
|
|
2696
|
+
rtrim: y,
|
|
2697
|
+
skip_empty_lines: S,
|
|
2698
|
+
to: R,
|
|
2699
|
+
to_line: v
|
|
2700
2700
|
} = this.options;
|
|
2701
|
-
let { comment: _, escape:
|
|
2701
|
+
let { comment: _, escape: I, quote: U, record_delimiter: Re } = this.options;
|
|
2702
2702
|
const { bomSkipped: Wt, previousBuf: ce, rawBuffer: Qt, escapeIsQuote: Ht } = this.state;
|
|
2703
|
-
let
|
|
2703
|
+
let b;
|
|
2704
2704
|
if (ce === void 0)
|
|
2705
2705
|
if (n === void 0) {
|
|
2706
2706
|
s();
|
|
2707
2707
|
return;
|
|
2708
2708
|
} else
|
|
2709
|
-
|
|
2710
|
-
else ce !== void 0 && n === void 0 ?
|
|
2709
|
+
b = n;
|
|
2710
|
+
else ce !== void 0 && n === void 0 ? b = ce : b = u.concat([ce, n]);
|
|
2711
2711
|
if (Wt === !1)
|
|
2712
2712
|
if (f === !1)
|
|
2713
2713
|
this.state.bomSkipped = !0;
|
|
2714
|
-
else if (
|
|
2714
|
+
else if (b.length < 3) {
|
|
2715
2715
|
if (i === !1) {
|
|
2716
|
-
this.state.previousBuf =
|
|
2716
|
+
this.state.previousBuf = b;
|
|
2717
2717
|
return;
|
|
2718
2718
|
}
|
|
2719
2719
|
} else {
|
|
2720
|
-
for (const
|
|
2721
|
-
if (re[
|
|
2722
|
-
const J = re[
|
|
2723
|
-
this.state.bufBytesStart += J,
|
|
2724
|
-
const he =
|
|
2720
|
+
for (const O in re)
|
|
2721
|
+
if (re[O].compare(b, 0, re[O].length) === 0) {
|
|
2722
|
+
const J = re[O].length;
|
|
2723
|
+
this.state.bufBytesStart += J, b = b.slice(J);
|
|
2724
|
+
const he = ut({
|
|
2725
2725
|
...this.original_options,
|
|
2726
|
-
encoding:
|
|
2726
|
+
encoding: O
|
|
2727
2727
|
});
|
|
2728
2728
|
for (const A in he)
|
|
2729
2729
|
this.options[A] = he[A];
|
|
2730
|
-
({ comment: _, escape:
|
|
2730
|
+
({ comment: _, escape: I, quote: U } = this.options);
|
|
2731
2731
|
break;
|
|
2732
2732
|
}
|
|
2733
2733
|
this.state.bomSkipped = !0;
|
|
2734
2734
|
}
|
|
2735
|
-
const Ie =
|
|
2736
|
-
let
|
|
2737
|
-
for (
|
|
2738
|
-
if (this.state.wasRowDelimiter === !0 && (this.info.lines++, this.state.wasRowDelimiter = !1),
|
|
2735
|
+
const Ie = b.length;
|
|
2736
|
+
let d;
|
|
2737
|
+
for (d = 0; d < Ie && !this.__needMoreData(d, Ie, i); d++) {
|
|
2738
|
+
if (this.state.wasRowDelimiter === !0 && (this.info.lines++, this.state.wasRowDelimiter = !1), v !== -1 && this.info.lines > v) {
|
|
2739
2739
|
this.state.stop = !0, s();
|
|
2740
2740
|
return;
|
|
2741
2741
|
}
|
|
2742
2742
|
this.state.quoting === !1 && Re.length === 0 && this.__autoDiscoverRecordDelimiter(
|
|
2743
|
-
|
|
2744
|
-
|
|
2743
|
+
b,
|
|
2744
|
+
d
|
|
2745
2745
|
) && (Re = this.options.record_delimiter);
|
|
2746
|
-
const
|
|
2747
|
-
if (
|
|
2746
|
+
const O = b[d];
|
|
2747
|
+
if (g === !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
|
-
if (
|
|
2750
|
+
if (I !== null && this.state.quoting === !0 && this.__isEscape(b, d, O) && d + I.length < Ie)
|
|
2751
2751
|
if (Ht) {
|
|
2752
|
-
if (this.__isQuote(
|
|
2753
|
-
this.state.escaping = !0,
|
|
2752
|
+
if (this.__isQuote(b, d + I.length)) {
|
|
2753
|
+
this.state.escaping = !0, d += I.length - 1;
|
|
2754
2754
|
continue;
|
|
2755
2755
|
}
|
|
2756
2756
|
} else {
|
|
2757
|
-
this.state.escaping = !0,
|
|
2757
|
+
this.state.escaping = !0, d += I.length - 1;
|
|
2758
2758
|
continue;
|
|
2759
2759
|
}
|
|
2760
|
-
if (this.state.commenting === !1 && this.__isQuote(
|
|
2760
|
+
if (this.state.commenting === !1 && this.__isQuote(b, d))
|
|
2761
2761
|
if (this.state.quoting === !0) {
|
|
2762
|
-
const A =
|
|
2763
|
-
|
|
2764
|
-
|
|
2762
|
+
const A = b[d + U.length], Z = y && this.__isCharTrimable(b, d + U.length), j = _ !== null && this.__compareBytes(_, b, d + U.length, A), X = this.__isDelimiter(
|
|
2763
|
+
b,
|
|
2764
|
+
d + U.length,
|
|
2765
2765
|
A
|
|
2766
|
-
), de = Re.length === 0 ? this.__autoDiscoverRecordDelimiter(
|
|
2767
|
-
if (
|
|
2768
|
-
|
|
2766
|
+
), de = Re.length === 0 ? this.__autoDiscoverRecordDelimiter(b, d + U.length) : this.__isRecordDelimiter(A, b, d + U.length);
|
|
2767
|
+
if (I !== null && this.__isEscape(b, d, O) && this.__isQuote(b, d + I.length))
|
|
2768
|
+
d += I.length - 1;
|
|
2769
2769
|
else if (!A || X || de || j || Z) {
|
|
2770
|
-
this.state.quoting = !1, this.state.wasQuoting = !0,
|
|
2770
|
+
this.state.quoting = !1, this.state.wasQuoting = !0, d += U.length - 1;
|
|
2771
2771
|
continue;
|
|
2772
|
-
} else if (
|
|
2772
|
+
} else if (x === !1) {
|
|
2773
2773
|
const Ge = this.__error(
|
|
2774
2774
|
new w(
|
|
2775
2775
|
"CSV_INVALID_CLOSING_QUOTE",
|
|
@@ -2786,9 +2786,9 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
2786
2786
|
);
|
|
2787
2787
|
if (Ge !== void 0) return Ge;
|
|
2788
2788
|
} else
|
|
2789
|
-
this.state.quoting = !1, this.state.wasQuoting = !0, this.state.field.prepend(U),
|
|
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) {
|
|
2791
|
-
if (
|
|
2791
|
+
if (x === !1) {
|
|
2792
2792
|
const A = this.__infoField(), Z = Object.keys(re).map(
|
|
2793
2793
|
(X) => re[X].equals(this.state.field.toString()) ? X : !1
|
|
2794
2794
|
).filter(Boolean)[0], j = this.__error(
|
|
@@ -2796,7 +2796,7 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
2796
2796
|
"INVALID_OPENING_QUOTE",
|
|
2797
2797
|
[
|
|
2798
2798
|
"Invalid Opening Quote:",
|
|
2799
|
-
`a quote is found on field ${JSON.stringify(A.column)} at line ${A.lines}, value is ${JSON.stringify(this.state.field.toString(
|
|
2799
|
+
`a quote is found on field ${JSON.stringify(A.column)} at line ${A.lines}, value is ${JSON.stringify(this.state.field.toString(l))}`,
|
|
2800
2800
|
Z ? `(${Z} bom)` : void 0
|
|
2801
2801
|
],
|
|
2802
2802
|
this.options,
|
|
@@ -2809,76 +2809,76 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
2809
2809
|
if (j !== void 0) return j;
|
|
2810
2810
|
}
|
|
2811
2811
|
} else {
|
|
2812
|
-
this.state.quoting = !0,
|
|
2812
|
+
this.state.quoting = !0, d += U.length - 1;
|
|
2813
2813
|
continue;
|
|
2814
2814
|
}
|
|
2815
2815
|
if (this.state.quoting === !1) {
|
|
2816
2816
|
const A = this.__isRecordDelimiter(
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2817
|
+
O,
|
|
2818
|
+
b,
|
|
2819
|
+
d
|
|
2820
2820
|
);
|
|
2821
2821
|
if (A !== 0) {
|
|
2822
2822
|
if (this.state.commenting && this.state.wasQuoting === !1 && this.state.record.length === 0 && this.state.field.length === 0)
|
|
2823
2823
|
this.info.comment_lines++;
|
|
2824
2824
|
else {
|
|
2825
|
-
if (this.state.enabled === !1 && this.info.lines + (this.state.wasRowDelimiter === !0 ? 1 : 0) >=
|
|
2826
|
-
this.state.enabled = !0, this.__resetField(), this.__resetRecord(),
|
|
2825
|
+
if (this.state.enabled === !1 && this.info.lines + (this.state.wasRowDelimiter === !0 ? 1 : 0) >= h) {
|
|
2826
|
+
this.state.enabled = !0, this.__resetField(), this.__resetRecord(), d += A - 1;
|
|
2827
2827
|
continue;
|
|
2828
2828
|
}
|
|
2829
|
-
if (
|
|
2830
|
-
this.info.empty_lines++,
|
|
2829
|
+
if (S === !0 && this.state.wasQuoting === !1 && this.state.record.length === 0 && this.state.field.length === 0) {
|
|
2830
|
+
this.info.empty_lines++, d += A - 1;
|
|
2831
2831
|
continue;
|
|
2832
2832
|
}
|
|
2833
|
-
this.info.bytes = this.state.bufBytesStart +
|
|
2833
|
+
this.info.bytes = this.state.bufBytesStart + d;
|
|
2834
2834
|
const X = this.__onField();
|
|
2835
2835
|
if (X !== void 0) return X;
|
|
2836
|
-
this.info.bytes = this.state.bufBytesStart +
|
|
2836
|
+
this.info.bytes = this.state.bufBytesStart + d + A;
|
|
2837
2837
|
const de = this.__onRecord(o);
|
|
2838
2838
|
if (de !== void 0) return de;
|
|
2839
|
-
if (
|
|
2839
|
+
if (R !== -1 && this.info.records >= R) {
|
|
2840
2840
|
this.state.stop = !0, s();
|
|
2841
2841
|
return;
|
|
2842
2842
|
}
|
|
2843
2843
|
}
|
|
2844
|
-
this.state.commenting = !1,
|
|
2844
|
+
this.state.commenting = !1, d += A - 1;
|
|
2845
2845
|
continue;
|
|
2846
2846
|
}
|
|
2847
2847
|
if (this.state.commenting)
|
|
2848
2848
|
continue;
|
|
2849
|
-
if (_ !== null && (a === !1 || this.state.record.length === 0 && this.state.field.length === 0) && this.__compareBytes(_,
|
|
2849
|
+
if (_ !== null && (a === !1 || this.state.record.length === 0 && this.state.field.length === 0) && this.__compareBytes(_, b, d, O) !== 0) {
|
|
2850
2850
|
this.state.commenting = !0;
|
|
2851
2851
|
continue;
|
|
2852
2852
|
}
|
|
2853
|
-
const Z = this.__isDelimiter(
|
|
2853
|
+
const Z = this.__isDelimiter(b, d, O);
|
|
2854
2854
|
if (Z !== 0) {
|
|
2855
|
-
this.info.bytes = this.state.bufBytesStart +
|
|
2855
|
+
this.info.bytes = this.state.bufBytesStart + d;
|
|
2856
2856
|
const j = this.__onField();
|
|
2857
2857
|
if (j !== void 0) return j;
|
|
2858
|
-
|
|
2858
|
+
d += Z - 1;
|
|
2859
2859
|
continue;
|
|
2860
2860
|
}
|
|
2861
2861
|
}
|
|
2862
2862
|
}
|
|
2863
|
-
if (this.state.commenting === !1 &&
|
|
2863
|
+
if (this.state.commenting === !1 && p !== 0 && this.state.record_length + this.state.field.length > p)
|
|
2864
2864
|
return this.__error(
|
|
2865
2865
|
new w(
|
|
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 ${p}`,
|
|
2871
2871
|
`at line ${this.info.lines}`
|
|
2872
2872
|
],
|
|
2873
2873
|
this.options,
|
|
2874
2874
|
this.__infoField()
|
|
2875
2875
|
)
|
|
2876
2876
|
);
|
|
2877
|
-
const J =
|
|
2877
|
+
const J = c === !1 || this.state.quoting === !0 || this.state.field.length !== 0 || !this.__isCharTrimable(b, d), he = y === !1 || this.state.wasQuoting === !1;
|
|
2878
2878
|
if (J === !0 && he === !0)
|
|
2879
|
-
this.state.field.append(
|
|
2879
|
+
this.state.field.append(O);
|
|
2880
2880
|
else {
|
|
2881
|
-
if (
|
|
2881
|
+
if (y === !0 && !this.__isCharTrimable(b, d))
|
|
2882
2882
|
return this.__error(
|
|
2883
2883
|
new w(
|
|
2884
2884
|
"CSV_NON_TRIMABLE_CHAR_AFTER_CLOSING_QUOTE",
|
|
@@ -2891,13 +2891,13 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
2891
2891
|
this.__infoField()
|
|
2892
2892
|
)
|
|
2893
2893
|
);
|
|
2894
|
-
J === !1 && (
|
|
2894
|
+
J === !1 && (d += this.__isCharTrimable(b, d) - 1);
|
|
2895
2895
|
continue;
|
|
2896
2896
|
}
|
|
2897
2897
|
}
|
|
2898
2898
|
if (i === !0)
|
|
2899
2899
|
if (this.state.quoting === !0) {
|
|
2900
|
-
const
|
|
2900
|
+
const O = this.__error(
|
|
2901
2901
|
new w(
|
|
2902
2902
|
"CSV_QUOTE_NOT_CLOSED",
|
|
2903
2903
|
[
|
|
@@ -2908,16 +2908,16 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
2908
2908
|
this.__infoField()
|
|
2909
2909
|
)
|
|
2910
2910
|
);
|
|
2911
|
-
if (
|
|
2911
|
+
if (O !== void 0) return O;
|
|
2912
2912
|
} else if (this.state.wasQuoting === !0 || this.state.record.length !== 0 || this.state.field.length !== 0) {
|
|
2913
|
-
this.info.bytes = this.state.bufBytesStart +
|
|
2914
|
-
const
|
|
2915
|
-
if (
|
|
2913
|
+
this.info.bytes = this.state.bufBytesStart + d;
|
|
2914
|
+
const O = this.__onField();
|
|
2915
|
+
if (O !== void 0) return O;
|
|
2916
2916
|
const J = this.__onRecord(o);
|
|
2917
2917
|
if (J !== void 0) return J;
|
|
2918
2918
|
} else this.state.wasRowDelimiter === !0 ? this.info.empty_lines++ : this.state.commenting === !0 && this.info.comment_lines++;
|
|
2919
2919
|
else
|
|
2920
|
-
this.state.bufBytesStart +=
|
|
2920
|
+
this.state.bufBytesStart += d, this.state.previousBuf = b.slice(d);
|
|
2921
2921
|
this.state.wasRowDelimiter === !0 && (this.info.lines++, this.state.wasRowDelimiter = !1);
|
|
2922
2922
|
},
|
|
2923
2923
|
__onRecord: function(n) {
|
|
@@ -2927,34 +2927,34 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
2927
2927
|
encoding: s,
|
|
2928
2928
|
info: f,
|
|
2929
2929
|
from: a,
|
|
2930
|
-
relax_column_count:
|
|
2931
|
-
relax_column_count_less:
|
|
2932
|
-
relax_column_count_more:
|
|
2933
|
-
raw:
|
|
2934
|
-
skip_records_with_empty_values:
|
|
2935
|
-
} = this.options, { enabled:
|
|
2936
|
-
if (
|
|
2930
|
+
relax_column_count: l,
|
|
2931
|
+
relax_column_count_less: h,
|
|
2932
|
+
relax_column_count_more: c,
|
|
2933
|
+
raw: p,
|
|
2934
|
+
skip_records_with_empty_values: g
|
|
2935
|
+
} = this.options, { enabled: x, record: y } = this.state;
|
|
2936
|
+
if (x === !1)
|
|
2937
2937
|
return this.__resetRecord();
|
|
2938
|
-
const
|
|
2938
|
+
const S = y.length;
|
|
2939
2939
|
if (i === !0) {
|
|
2940
|
-
if (
|
|
2940
|
+
if (g === !0 && lt(y)) {
|
|
2941
2941
|
this.__resetRecord();
|
|
2942
2942
|
return;
|
|
2943
2943
|
}
|
|
2944
|
-
return this.__firstLineToColumns(
|
|
2944
|
+
return this.__firstLineToColumns(y);
|
|
2945
2945
|
}
|
|
2946
|
-
if (i === !1 && this.info.records === 0 && (this.state.expectedRecordLength =
|
|
2947
|
-
const
|
|
2946
|
+
if (i === !1 && this.info.records === 0 && (this.state.expectedRecordLength = S), S !== this.state.expectedRecordLength) {
|
|
2947
|
+
const R = i === !1 ? new w(
|
|
2948
2948
|
"CSV_RECORD_INCONSISTENT_FIELDS_LENGTH",
|
|
2949
2949
|
[
|
|
2950
2950
|
"Invalid Record Length:",
|
|
2951
2951
|
`expect ${this.state.expectedRecordLength},`,
|
|
2952
|
-
`got ${
|
|
2952
|
+
`got ${S} on line ${this.info.lines}`
|
|
2953
2953
|
],
|
|
2954
2954
|
this.options,
|
|
2955
2955
|
this.__infoField(),
|
|
2956
2956
|
{
|
|
2957
|
-
record:
|
|
2957
|
+
record: y
|
|
2958
2958
|
}
|
|
2959
2959
|
) : new w(
|
|
2960
2960
|
"CSV_RECORD_INCONSISTENT_COLUMNS",
|
|
@@ -2962,22 +2962,22 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
2962
2962
|
"Invalid Record Length:",
|
|
2963
2963
|
`columns length is ${i.length},`,
|
|
2964
2964
|
// rename columns
|
|
2965
|
-
`got ${
|
|
2965
|
+
`got ${S} on line ${this.info.lines}`
|
|
2966
2966
|
],
|
|
2967
2967
|
this.options,
|
|
2968
2968
|
this.__infoField(),
|
|
2969
2969
|
{
|
|
2970
|
-
record:
|
|
2970
|
+
record: y
|
|
2971
2971
|
}
|
|
2972
2972
|
);
|
|
2973
|
-
if (
|
|
2974
|
-
this.info.invalid_field_length++, this.state.error =
|
|
2973
|
+
if (l === !0 || h === !0 && S < this.state.expectedRecordLength || c === !0 && S > this.state.expectedRecordLength)
|
|
2974
|
+
this.info.invalid_field_length++, this.state.error = R;
|
|
2975
2975
|
else {
|
|
2976
|
-
const
|
|
2977
|
-
if (
|
|
2976
|
+
const v = this.__error(R);
|
|
2977
|
+
if (v) return v;
|
|
2978
2978
|
}
|
|
2979
2979
|
}
|
|
2980
|
-
if (
|
|
2980
|
+
if (g === !0 && lt(y)) {
|
|
2981
2981
|
this.__resetRecord();
|
|
2982
2982
|
return;
|
|
2983
2983
|
}
|
|
@@ -2986,48 +2986,48 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
2986
2986
|
return;
|
|
2987
2987
|
}
|
|
2988
2988
|
if (this.info.records++, a === 1 || this.info.records >= a) {
|
|
2989
|
-
const { objname:
|
|
2989
|
+
const { objname: R } = this.options;
|
|
2990
2990
|
if (i !== !1) {
|
|
2991
|
-
const
|
|
2992
|
-
for (let _ = 0,
|
|
2993
|
-
i[_] === void 0 || i[_].disabled || (o === !0 &&
|
|
2994
|
-
if (
|
|
2991
|
+
const v = {};
|
|
2992
|
+
for (let _ = 0, I = y.length; _ < I; _++)
|
|
2993
|
+
i[_] === void 0 || i[_].disabled || (o === !0 && v[i[_].name] !== void 0 ? Array.isArray(v[i[_].name]) ? v[i[_].name] = v[i[_].name].concat(y[_]) : v[i[_].name] = [v[i[_].name], y[_]] : v[i[_].name] = y[_]);
|
|
2994
|
+
if (p === !0 || f === !0) {
|
|
2995
2995
|
const _ = Object.assign(
|
|
2996
|
-
{ record:
|
|
2997
|
-
|
|
2996
|
+
{ record: v },
|
|
2997
|
+
p === !0 ? { raw: this.state.rawBuffer.toString(s) } : {},
|
|
2998
2998
|
f === !0 ? { info: this.__infoRecord() } : {}
|
|
2999
|
-
),
|
|
3000
|
-
|
|
2999
|
+
), I = this.__push(
|
|
3000
|
+
R === void 0 ? _ : [v[R], _],
|
|
3001
3001
|
n
|
|
3002
3002
|
);
|
|
3003
|
-
if (
|
|
3004
|
-
return
|
|
3003
|
+
if (I)
|
|
3004
|
+
return I;
|
|
3005
3005
|
} else {
|
|
3006
3006
|
const _ = this.__push(
|
|
3007
|
-
|
|
3007
|
+
R === void 0 ? v : [v[R], v],
|
|
3008
3008
|
n
|
|
3009
3009
|
);
|
|
3010
3010
|
if (_)
|
|
3011
3011
|
return _;
|
|
3012
3012
|
}
|
|
3013
|
-
} else if (
|
|
3014
|
-
const
|
|
3015
|
-
{ record:
|
|
3016
|
-
|
|
3013
|
+
} else if (p === !0 || f === !0) {
|
|
3014
|
+
const v = Object.assign(
|
|
3015
|
+
{ record: y },
|
|
3016
|
+
p === !0 ? { raw: this.state.rawBuffer.toString(s) } : {},
|
|
3017
3017
|
f === !0 ? { info: this.__infoRecord() } : {}
|
|
3018
3018
|
), _ = this.__push(
|
|
3019
|
-
|
|
3019
|
+
R === void 0 ? v : [y[R], v],
|
|
3020
3020
|
n
|
|
3021
3021
|
);
|
|
3022
3022
|
if (_)
|
|
3023
3023
|
return _;
|
|
3024
3024
|
} else {
|
|
3025
|
-
const
|
|
3026
|
-
|
|
3025
|
+
const v = this.__push(
|
|
3026
|
+
R === void 0 ? y : [y[R], y],
|
|
3027
3027
|
n
|
|
3028
3028
|
);
|
|
3029
|
-
if (
|
|
3030
|
-
return
|
|
3029
|
+
if (v)
|
|
3030
|
+
return v;
|
|
3031
3031
|
}
|
|
3032
3032
|
}
|
|
3033
3033
|
this.__resetRecord();
|
|
@@ -3066,13 +3066,13 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
3066
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
|
-
let
|
|
3070
|
-
if (o === !0 && a === !1 && (
|
|
3071
|
-
const [
|
|
3072
|
-
if (
|
|
3073
|
-
|
|
3069
|
+
let l = this.state.field.toString(i);
|
|
3070
|
+
if (o === !0 && a === !1 && (l = l.trimRight()), n === !0) {
|
|
3071
|
+
const [h, c] = this.__cast(l);
|
|
3072
|
+
if (h !== void 0) return h;
|
|
3073
|
+
l = c;
|
|
3074
3074
|
}
|
|
3075
|
-
this.state.record.push(
|
|
3075
|
+
this.state.record.push(l), s !== 0 && typeof l == "string" && (this.state.record_length += l.length), this.__resetField();
|
|
3076
3076
|
},
|
|
3077
3077
|
__resetField: function() {
|
|
3078
3078
|
this.state.field.reset(), this.state.wasQuoting = !1;
|
|
@@ -3115,11 +3115,11 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
3115
3115
|
__isCharTrimable: function(n, i) {
|
|
3116
3116
|
return ((s, f) => {
|
|
3117
3117
|
const { timchars: a } = this.state;
|
|
3118
|
-
e: for (let
|
|
3119
|
-
const
|
|
3120
|
-
for (let
|
|
3121
|
-
if (c
|
|
3122
|
-
return
|
|
3118
|
+
e: for (let l = 0; l < a.length; l++) {
|
|
3119
|
+
const h = a[l];
|
|
3120
|
+
for (let c = 0; c < h.length; c++)
|
|
3121
|
+
if (h[c] !== s[f + c]) continue e;
|
|
3122
|
+
return h.length;
|
|
3123
3123
|
}
|
|
3124
3124
|
return 0;
|
|
3125
3125
|
})(n, i);
|
|
@@ -3147,11 +3147,11 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
3147
3147
|
if (f !== !1 && typeof f == "number" && this.state.record.length === f - 1)
|
|
3148
3148
|
return 0;
|
|
3149
3149
|
e: for (let a = 0; a < s.length; a++) {
|
|
3150
|
-
const
|
|
3151
|
-
if (
|
|
3152
|
-
for (let
|
|
3153
|
-
if (
|
|
3154
|
-
return
|
|
3150
|
+
const l = s[a];
|
|
3151
|
+
if (l[0] === o) {
|
|
3152
|
+
for (let h = 1; h < l.length; h++)
|
|
3153
|
+
if (l[h] !== n[i + h]) continue e;
|
|
3154
|
+
return l.length;
|
|
3155
3155
|
}
|
|
3156
3156
|
}
|
|
3157
3157
|
return 0;
|
|
@@ -3159,12 +3159,12 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
3159
3159
|
__isRecordDelimiter: function(n, i, o) {
|
|
3160
3160
|
const { record_delimiter: s } = this.options, f = s.length;
|
|
3161
3161
|
e: for (let a = 0; a < f; a++) {
|
|
3162
|
-
const
|
|
3163
|
-
if (
|
|
3164
|
-
for (let
|
|
3165
|
-
if (
|
|
3162
|
+
const l = s[a], h = l.length;
|
|
3163
|
+
if (l[0] === n) {
|
|
3164
|
+
for (let c = 1; c < h; c++)
|
|
3165
|
+
if (l[c] !== i[o + c])
|
|
3166
3166
|
continue e;
|
|
3167
|
-
return
|
|
3167
|
+
return l.length;
|
|
3168
3168
|
}
|
|
3169
3169
|
}
|
|
3170
3170
|
return 0;
|
|
@@ -3193,16 +3193,16 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = 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
3203
|
const a = s[f].length;
|
|
3204
|
-
for (let
|
|
3205
|
-
if (s[f][
|
|
3204
|
+
for (let l = 0; l < a; l++)
|
|
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;
|
|
3208
3208
|
}
|
|
@@ -3389,10 +3389,11 @@ class ri {
|
|
|
3389
3389
|
* Determine schema configuration.
|
|
3390
3390
|
*/
|
|
3391
3391
|
async determineSchemaConfig(e, r) {
|
|
3392
|
-
const n = Xn(e), i = await Kn(e);
|
|
3392
|
+
const n = Xn(e), { rows: i, valueDelimiterId: o } = await Kn(e, r);
|
|
3393
3393
|
return {
|
|
3394
3394
|
recordDelimiterId: n,
|
|
3395
|
-
|
|
3395
|
+
rows: i,
|
|
3396
|
+
valueDelimiterId: o
|
|
3396
3397
|
};
|
|
3397
3398
|
}
|
|
3398
3399
|
/**
|
|
@@ -3400,50 +3401,50 @@ class ri {
|
|
|
3400
3401
|
*/
|
|
3401
3402
|
async parseStream(e, r, n, i, o) {
|
|
3402
3403
|
return new Promise((s, f) => {
|
|
3403
|
-
let a,
|
|
3404
|
-
const
|
|
3405
|
-
if (
|
|
3406
|
-
|
|
3407
|
-
const
|
|
3408
|
-
a = void 0,
|
|
3409
|
-
|
|
3410
|
-
}),
|
|
3404
|
+
let a, l, h, c = !1, p = !1;
|
|
3405
|
+
const g = () => {
|
|
3406
|
+
if (p) return;
|
|
3407
|
+
p = !0;
|
|
3408
|
+
const S = a;
|
|
3409
|
+
a = void 0, h = void 0, S != null && (Be(() => S.removeAllListeners()), Be(() => S.end())), Be(() => {
|
|
3410
|
+
l?.cancel();
|
|
3411
|
+
}), l = void 0;
|
|
3411
3412
|
};
|
|
3412
|
-
i.signal.addEventListener("abort",
|
|
3413
|
-
const
|
|
3414
|
-
|
|
3413
|
+
i.signal.addEventListener("abort", g, { once: !0 });
|
|
3414
|
+
const x = (S) => {
|
|
3415
|
+
c || (c = !0, g(), i.signal.aborted || i.abort(S), f(S));
|
|
3415
3416
|
};
|
|
3416
3417
|
(async () => {
|
|
3417
|
-
a = je(r),
|
|
3418
|
+
a = je(r), h = ei({ chunk: o, chunkSize: e.chunkSize ?? Gn }), a.on("readable", () => {
|
|
3418
3419
|
try {
|
|
3419
|
-
if (a == null ||
|
|
3420
|
-
let
|
|
3421
|
-
for (; (
|
|
3422
|
-
if (
|
|
3423
|
-
i.signal.throwIfAborted(),
|
|
3420
|
+
if (a == null || h == null) return;
|
|
3421
|
+
let I;
|
|
3422
|
+
for (; (I = a.read()) != null; ) {
|
|
3423
|
+
if (c) return;
|
|
3424
|
+
i.signal.throwIfAborted(), h.push(I);
|
|
3424
3425
|
}
|
|
3425
|
-
} catch (
|
|
3426
|
-
|
|
3426
|
+
} catch (I) {
|
|
3427
|
+
x(I);
|
|
3427
3428
|
}
|
|
3428
|
-
}), a.on("error", (
|
|
3429
|
-
|
|
3429
|
+
}), a.on("error", (I) => x(I)), a.on("end", () => {
|
|
3430
|
+
c || (h?.flush(), s(ti(a)));
|
|
3430
3431
|
});
|
|
3431
|
-
const
|
|
3432
|
-
if (!
|
|
3433
|
-
throw await Wn(
|
|
3434
|
-
|
|
3435
|
-
const
|
|
3436
|
-
let
|
|
3437
|
-
for (; !
|
|
3438
|
-
if (
|
|
3432
|
+
const S = await fetch(encodeURI(n), { signal: i.signal });
|
|
3433
|
+
if (!S.ok || S.body == null)
|
|
3434
|
+
throw await Wn(S, `Failed to fetch '${n}' file.`, "datapos-connector-file-store-emulator|Connector|retrieve");
|
|
3435
|
+
l = S.body.getReader();
|
|
3436
|
+
const R = new TextDecoder(e.encodingId);
|
|
3437
|
+
let v = await l.read();
|
|
3438
|
+
for (; !v.done; ) {
|
|
3439
|
+
if (c) return;
|
|
3439
3440
|
i.signal.throwIfAborted();
|
|
3440
|
-
const
|
|
3441
|
-
|
|
3441
|
+
const I = R.decode(v.value, { stream: !0 });
|
|
3442
|
+
I.length > 0 && a.write(I), v = await l.read();
|
|
3442
3443
|
}
|
|
3443
|
-
if (
|
|
3444
|
-
const _ =
|
|
3444
|
+
if (c) return;
|
|
3445
|
+
const _ = R.decode();
|
|
3445
3446
|
_.length > 0 && a.write(_), a.end();
|
|
3446
|
-
})().catch((
|
|
3447
|
+
})().catch((S) => x(S));
|
|
3447
3448
|
});
|
|
3448
3449
|
}
|
|
3449
3450
|
}
|
|
@@ -3454,37 +3455,35 @@ function Xn(t) {
|
|
|
3454
3455
|
` : n >= e && n >= r ? "\r" : `
|
|
3455
3456
|
`;
|
|
3456
3457
|
}
|
|
3457
|
-
async function Kn(t) {
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
for (const o of e)
|
|
3458
|
+
async function Kn(t, e) {
|
|
3459
|
+
let r, n, i, o = [];
|
|
3460
|
+
for (const s of e)
|
|
3461
3461
|
try {
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
await new Promise((h) => {
|
|
3462
|
+
let f = 0, a, l = 0, h = 0;
|
|
3463
|
+
const c = je({ delimiter: s, relax_column_count: !0 });
|
|
3464
|
+
await new Promise((p) => {
|
|
3466
3465
|
try {
|
|
3466
|
+
const g = [];
|
|
3467
3467
|
c.on("readable", () => {
|
|
3468
|
-
let
|
|
3469
|
-
for (; (
|
|
3470
|
-
|
|
3471
|
-
const
|
|
3472
|
-
|
|
3468
|
+
let x;
|
|
3469
|
+
for (; (x = c.read()) != null; ) {
|
|
3470
|
+
l++;
|
|
3471
|
+
const y = x.length;
|
|
3472
|
+
a != null && (h += Math.abs(y - a)), a = y, f += y, g.push(x);
|
|
3473
3473
|
}
|
|
3474
|
-
}), c.on("error", (
|
|
3475
|
-
console.log(7777,
|
|
3474
|
+
}), c.on("error", (x) => {
|
|
3475
|
+
console.log(7777, x), p();
|
|
3476
3476
|
}), c.on("end", () => {
|
|
3477
|
-
const
|
|
3478
|
-
|
|
3477
|
+
const x = f / l;
|
|
3478
|
+
(!i || h <= i) && (!n || x > n) && (r = s, n = x, i = h, o = [...g]), p();
|
|
3479
3479
|
}), c.write(t), c.end();
|
|
3480
|
-
} catch
|
|
3481
|
-
|
|
3480
|
+
} catch {
|
|
3481
|
+
p();
|
|
3482
3482
|
}
|
|
3483
3483
|
});
|
|
3484
|
-
} catch
|
|
3485
|
-
console.log(8888, s);
|
|
3484
|
+
} catch {
|
|
3486
3485
|
}
|
|
3487
|
-
return
|
|
3486
|
+
return { rows: o, valueDelimiterId: r ?? "," };
|
|
3488
3487
|
}
|
|
3489
3488
|
function ei(t) {
|
|
3490
3489
|
const e = Math.max(1, Math.floor(t.chunkSize)), r = [];
|
|
@@ -3501,8 +3500,8 @@ function ei(t) {
|
|
|
3501
3500
|
const a = r.pop();
|
|
3502
3501
|
if (a != null)
|
|
3503
3502
|
return a.length = 0, a;
|
|
3504
|
-
const
|
|
3505
|
-
return
|
|
3503
|
+
const l = Array.from({ length: e });
|
|
3504
|
+
return l.length = 0, l;
|
|
3506
3505
|
}
|
|
3507
3506
|
}
|
|
3508
3507
|
function ti(t) {
|