@datapos/datapos-tool-csv-parse 0.0.90 → 0.0.92
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 +331 -325
- package/dist/types/src/index.d.ts +15 -5
- package/package.json +2 -2
|
@@ -30,11 +30,11 @@ function Ze(t) {
|
|
|
30
30
|
o.push(Kt(t, f, f + s > a ? a : f + s));
|
|
31
31
|
return n === 1 ? (e = t[r - 1], i += P[e >> 2], i += P[e << 4 & 63], i += "==") : n === 2 && (e = (t[r - 2] << 8) + t[r - 1], i += P[e >> 10], i += P[e >> 4 & 63], i += P[e << 2 & 63], i += "="), o.push(i), o.join("");
|
|
32
32
|
}
|
|
33
|
-
function
|
|
34
|
-
var o, s, f = i * 8 - n - 1, a = (1 << f) - 1, l = a >> 1,
|
|
35
|
-
for (
|
|
33
|
+
function be(t, e, r, n, i) {
|
|
34
|
+
var o, s, f = i * 8 - n - 1, a = (1 << f) - 1, l = a >> 1, h = -7, c = r ? i - 1 : 0, d = r ? -1 : 1, m = t[e + c];
|
|
35
|
+
for (c += d, o = m & (1 << -h) - 1, m >>= -h, h += f; h > 0; o = o * 256 + t[e + c], c += d, 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 += d, h -= 8)
|
|
38
38
|
;
|
|
39
39
|
if (o === 0)
|
|
40
40
|
o = 1 - l;
|
|
@@ -46,12 +46,12 @@ function ve(t, e, r, n, i) {
|
|
|
46
46
|
return (m ? -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, l = o * 8 - i - 1,
|
|
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, d = i === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, m = n ? 0 : o - 1, v = 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 += d / a : e += d * 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 + m] = f & 255, m += v, f /= 256, i -= 8)
|
|
51
51
|
;
|
|
52
|
-
for (s = s << i | f, l += i; l > 0; t[r + m] = s & 255, m +=
|
|
52
|
+
for (s = s << i | f, l += i; l > 0; t[r + m] = s & 255, m += v, s /= 256, l -= 8)
|
|
53
53
|
;
|
|
54
|
-
t[r + m -
|
|
54
|
+
t[r + m - v] |= y * 128;
|
|
55
55
|
}
|
|
56
56
|
var er = {}.toString, dt = Array.isArray || function(t) {
|
|
57
57
|
return er.call(t) == "[object Array]";
|
|
@@ -74,7 +74,7 @@ function u(t, e, r) {
|
|
|
74
74
|
throw new Error(
|
|
75
75
|
"If encoding is specified then the first argument must be a string"
|
|
76
76
|
);
|
|
77
|
-
return
|
|
77
|
+
return Ve(this, t);
|
|
78
78
|
}
|
|
79
79
|
return pt(this, t, e, r);
|
|
80
80
|
}
|
|
@@ -103,17 +103,17 @@ function rr(t, e, r, n) {
|
|
|
103
103
|
u.alloc = function(t, e, r) {
|
|
104
104
|
return rr(null, t, e, r);
|
|
105
105
|
};
|
|
106
|
-
function
|
|
107
|
-
if (mt(e), t = q(t, e < 0 ? 0 :
|
|
106
|
+
function Ve(t, e) {
|
|
107
|
+
if (mt(e), t = q(t, e < 0 ? 0 : ze(e) | 0), !u.TYPED_ARRAY_SUPPORT)
|
|
108
108
|
for (var r = 0; r < e; ++r)
|
|
109
109
|
t[r] = 0;
|
|
110
110
|
return t;
|
|
111
111
|
}
|
|
112
112
|
u.allocUnsafe = function(t) {
|
|
113
|
-
return
|
|
113
|
+
return Ve(null, t);
|
|
114
114
|
};
|
|
115
115
|
u.allocUnsafeSlow = function(t) {
|
|
116
|
-
return
|
|
116
|
+
return Ve(null, t);
|
|
117
117
|
};
|
|
118
118
|
function nr(t, e, r) {
|
|
119
119
|
if ((typeof r != "string" || r === "") && (r = "utf8"), !u.isEncoding(r))
|
|
@@ -124,7 +124,7 @@ function nr(t, e, r) {
|
|
|
124
124
|
return i !== n && (t = t.slice(0, i)), t;
|
|
125
125
|
}
|
|
126
126
|
function Ue(t, e) {
|
|
127
|
-
var r = e.length < 0 ? 0 :
|
|
127
|
+
var r = e.length < 0 ? 0 : ze(e.length) | 0;
|
|
128
128
|
t = q(t, r);
|
|
129
129
|
for (var n = 0; n < r; n += 1)
|
|
130
130
|
t[n] = e[n] & 255;
|
|
@@ -139,7 +139,7 @@ function ir(t, e, r, n) {
|
|
|
139
139
|
}
|
|
140
140
|
function or(t, e) {
|
|
141
141
|
if ($(e)) {
|
|
142
|
-
var r =
|
|
142
|
+
var r = ze(e.length) | 0;
|
|
143
143
|
return t = q(t, r), t.length === 0 || e.copy(t, 0, 0, r), t;
|
|
144
144
|
}
|
|
145
145
|
if (e) {
|
|
@@ -150,7 +150,7 @@ function or(t, e) {
|
|
|
150
150
|
}
|
|
151
151
|
throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.");
|
|
152
152
|
}
|
|
153
|
-
function
|
|
153
|
+
function ze(t) {
|
|
154
154
|
if (t >= _e())
|
|
155
155
|
throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + _e().toString(16) + " bytes");
|
|
156
156
|
return t | 0;
|
|
@@ -320,9 +320,9 @@ u.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), l = this.slice(i, o),
|
|
324
|
-
if (l[
|
|
325
|
-
s = l[
|
|
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;
|
|
@@ -348,25 +348,25 @@ 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(m,
|
|
352
|
-
return o === 1 ? m[
|
|
351
|
+
function a(m, v) {
|
|
352
|
+
return o === 1 ? m[v] : m.readUInt16BE(v * o);
|
|
353
353
|
}
|
|
354
354
|
var l;
|
|
355
355
|
if (i) {
|
|
356
|
-
var
|
|
356
|
+
var h = -1;
|
|
357
357
|
for (l = r; l < s; l++)
|
|
358
|
-
if (a(t, l) === a(e,
|
|
359
|
-
if (
|
|
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
363
|
for (r + f > s && (r = s - f), l = r; l >= 0; l--) {
|
|
364
|
-
for (var
|
|
365
|
-
if (a(t, l +
|
|
366
|
-
|
|
364
|
+
for (var c = !0, d = 0; d < f; d++)
|
|
365
|
+
if (a(t, l + d) !== a(e, d)) {
|
|
366
|
+
c = !1;
|
|
367
367
|
break;
|
|
368
368
|
}
|
|
369
|
-
if (
|
|
369
|
+
if (c) return l;
|
|
370
370
|
}
|
|
371
371
|
return -1;
|
|
372
372
|
}
|
|
@@ -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, l,
|
|
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], l = t[i + 2], (a & 192) === 128 && (l & 192) === 128 && (
|
|
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], l = t[i + 2],
|
|
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;
|
|
@@ -510,7 +510,7 @@ function gr(t, e, r) {
|
|
|
510
510
|
var n = t.length;
|
|
511
511
|
(!e || e < 0) && (e = 0), (!r || r < 0 || r > n) && (r = n);
|
|
512
512
|
for (var i = "", o = e; o < r; ++o)
|
|
513
|
-
i +=
|
|
513
|
+
i += vr(t[o]);
|
|
514
514
|
return i;
|
|
515
515
|
}
|
|
516
516
|
function _r(t, e, r) {
|
|
@@ -532,79 +532,79 @@ u.prototype.slice = function(e, r) {
|
|
|
532
532
|
}
|
|
533
533
|
return i;
|
|
534
534
|
};
|
|
535
|
-
function
|
|
535
|
+
function L(t, e, r) {
|
|
536
536
|
if (t % 1 !== 0 || t < 0) throw new RangeError("offset is not uint");
|
|
537
537
|
if (t + e > r) throw new RangeError("Trying to access beyond buffer length");
|
|
538
538
|
}
|
|
539
539
|
u.prototype.readUIntLE = function(e, r, n) {
|
|
540
|
-
e = e | 0, r = r | 0, n ||
|
|
540
|
+
e = e | 0, r = r | 0, n || L(e, r, this.length);
|
|
541
541
|
for (var i = this[e], o = 1, s = 0; ++s < r && (o *= 256); )
|
|
542
542
|
i += this[e + s] * o;
|
|
543
543
|
return i;
|
|
544
544
|
};
|
|
545
545
|
u.prototype.readUIntBE = function(e, r, n) {
|
|
546
|
-
e = e | 0, r = r | 0, n ||
|
|
546
|
+
e = e | 0, r = r | 0, n || L(e, r, this.length);
|
|
547
547
|
for (var i = this[e + --r], o = 1; r > 0 && (o *= 256); )
|
|
548
548
|
i += this[e + --r] * o;
|
|
549
549
|
return i;
|
|
550
550
|
};
|
|
551
551
|
u.prototype.readUInt8 = function(e, r) {
|
|
552
|
-
return r ||
|
|
552
|
+
return r || L(e, 1, this.length), this[e];
|
|
553
553
|
};
|
|
554
554
|
u.prototype.readUInt16LE = function(e, r) {
|
|
555
|
-
return r ||
|
|
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
|
-
return r ||
|
|
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
|
-
return r ||
|
|
561
|
+
return r || L(e, 4, this.length), (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + this[e + 3] * 16777216;
|
|
562
562
|
};
|
|
563
563
|
u.prototype.readUInt32BE = function(e, r) {
|
|
564
|
-
return r ||
|
|
564
|
+
return r || L(e, 4, this.length), this[e] * 16777216 + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]);
|
|
565
565
|
};
|
|
566
566
|
u.prototype.readIntLE = function(e, r, n) {
|
|
567
|
-
e = e | 0, r = r | 0, n ||
|
|
567
|
+
e = e | 0, r = r | 0, n || L(e, r, this.length);
|
|
568
568
|
for (var i = this[e], o = 1, s = 0; ++s < r && (o *= 256); )
|
|
569
569
|
i += this[e + s] * o;
|
|
570
570
|
return o *= 128, i >= o && (i -= Math.pow(2, 8 * r)), i;
|
|
571
571
|
};
|
|
572
572
|
u.prototype.readIntBE = function(e, r, n) {
|
|
573
|
-
e = e | 0, r = r | 0, n ||
|
|
573
|
+
e = e | 0, r = r | 0, n || L(e, r, this.length);
|
|
574
574
|
for (var i = r, o = 1, s = this[e + --i]; i > 0 && (o *= 256); )
|
|
575
575
|
s += this[e + --i] * o;
|
|
576
576
|
return o *= 128, s >= o && (s -= Math.pow(2, 8 * r)), s;
|
|
577
577
|
};
|
|
578
578
|
u.prototype.readInt8 = function(e, r) {
|
|
579
|
-
return r ||
|
|
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
|
-
r ||
|
|
582
|
+
r || L(e, 2, this.length);
|
|
583
583
|
var n = this[e] | this[e + 1] << 8;
|
|
584
584
|
return n & 32768 ? n | 4294901760 : n;
|
|
585
585
|
};
|
|
586
586
|
u.prototype.readInt16BE = function(e, r) {
|
|
587
|
-
r ||
|
|
587
|
+
r || L(e, 2, this.length);
|
|
588
588
|
var n = this[e + 1] | this[e] << 8;
|
|
589
589
|
return n & 32768 ? n | 4294901760 : n;
|
|
590
590
|
};
|
|
591
591
|
u.prototype.readInt32LE = function(e, r) {
|
|
592
|
-
return r ||
|
|
592
|
+
return r || L(e, 4, this.length), this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24;
|
|
593
593
|
};
|
|
594
594
|
u.prototype.readInt32BE = function(e, r) {
|
|
595
|
-
return r ||
|
|
595
|
+
return r || L(e, 4, this.length), this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3];
|
|
596
596
|
};
|
|
597
597
|
u.prototype.readFloatLE = function(e, r) {
|
|
598
|
-
return r ||
|
|
598
|
+
return r || L(e, 4, this.length), be(this, e, !0, 23, 4);
|
|
599
599
|
};
|
|
600
600
|
u.prototype.readFloatBE = function(e, r) {
|
|
601
|
-
return r ||
|
|
601
|
+
return r || L(e, 4, this.length), be(this, e, !1, 23, 4);
|
|
602
602
|
};
|
|
603
603
|
u.prototype.readDoubleLE = function(e, r) {
|
|
604
|
-
return r ||
|
|
604
|
+
return r || L(e, 8, this.length), be(this, e, !0, 52, 8);
|
|
605
605
|
};
|
|
606
606
|
u.prototype.readDoubleBE = function(e, r) {
|
|
607
|
-
return r ||
|
|
607
|
+
return r || L(e, 8, this.length), be(this, e, !1, 52, 8);
|
|
608
608
|
};
|
|
609
609
|
function N(t, e, r, n, i, o) {
|
|
610
610
|
if (!$(t)) throw new TypeError('"buffer" argument must be a Buffer instance');
|
|
@@ -634,16 +634,16 @@ u.prototype.writeUIntBE = function(e, r, n, i) {
|
|
|
634
634
|
u.prototype.writeUInt8 = function(e, r, n) {
|
|
635
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
|
-
function
|
|
637
|
+
function ve(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
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) :
|
|
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) : ve(this, e, r, !0), r + 2;
|
|
644
644
|
};
|
|
645
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) :
|
|
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) : ve(this, e, r, !1), r + 2;
|
|
647
647
|
};
|
|
648
648
|
function Ee(t, e, r, n) {
|
|
649
649
|
e < 0 && (e = 4294967295 + e + 1);
|
|
@@ -680,10 +680,10 @@ u.prototype.writeInt8 = function(e, r, n) {
|
|
|
680
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
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) :
|
|
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) : ve(this, e, r, !0), r + 2;
|
|
684
684
|
};
|
|
685
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) :
|
|
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) : ve(this, e, r, !1), r + 2;
|
|
687
687
|
};
|
|
688
688
|
u.prototype.writeInt32LE = function(e, r, n) {
|
|
689
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;
|
|
@@ -691,21 +691,21 @@ u.prototype.writeInt32LE = function(e, r, n) {
|
|
|
691
691
|
u.prototype.writeInt32BE = function(e, r, n) {
|
|
692
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
|
-
function
|
|
694
|
+
function bt(t, e, r, n, i, o) {
|
|
695
695
|
if (r + n > t.length) throw new RangeError("Index out of range");
|
|
696
696
|
if (r < 0) throw new RangeError("Index out of range");
|
|
697
697
|
}
|
|
698
|
-
function
|
|
699
|
-
return i ||
|
|
698
|
+
function vt(t, e, r, n, i) {
|
|
699
|
+
return i || bt(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
|
-
return
|
|
702
|
+
return vt(this, e, r, !0, n);
|
|
703
703
|
};
|
|
704
704
|
u.prototype.writeFloatBE = function(e, r, n) {
|
|
705
|
-
return
|
|
705
|
+
return vt(this, e, r, !1, n);
|
|
706
706
|
};
|
|
707
707
|
function Et(t, e, r, n, i) {
|
|
708
|
-
return i ||
|
|
708
|
+
return i || bt(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);
|
|
@@ -764,15 +764,15 @@ u.prototype.fill = function(e, r, n, i) {
|
|
|
764
764
|
};
|
|
765
765
|
var wr = /[^+\/0-9A-Za-z-_]/g;
|
|
766
766
|
function yr(t) {
|
|
767
|
-
if (t =
|
|
767
|
+
if (t = br(t).replace(wr, ""), t.length < 2) return "";
|
|
768
768
|
for (; t.length % 4 !== 0; )
|
|
769
769
|
t = t + "=";
|
|
770
770
|
return t;
|
|
771
771
|
}
|
|
772
|
-
function
|
|
772
|
+
function br(t) {
|
|
773
773
|
return t.trim ? t.trim() : t.replace(/^\s+|\s+$/g, "");
|
|
774
774
|
}
|
|
775
|
-
function
|
|
775
|
+
function vr(t) {
|
|
776
776
|
return t < 16 ? "0" + t.toString(16) : t.toString(16);
|
|
777
777
|
}
|
|
778
778
|
function we(t, e) {
|
|
@@ -910,7 +910,7 @@ function Ar(t, e, r, n, i, o) {
|
|
|
910
910
|
for (var s = t.length, f = ae(t, s), a = 0; a < s; ++a)
|
|
911
911
|
f[a].call(r, n, i, o);
|
|
912
912
|
}
|
|
913
|
-
function
|
|
913
|
+
function Lr(t, e, r, n) {
|
|
914
914
|
if (e)
|
|
915
915
|
t.apply(r, n);
|
|
916
916
|
else
|
|
@@ -929,33 +929,33 @@ g.prototype.emit = function(e) {
|
|
|
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
|
-
|
|
958
|
+
Lr(n, c, this, o);
|
|
959
959
|
}
|
|
960
960
|
return !0;
|
|
961
961
|
};
|
|
@@ -972,11 +972,11 @@ function It(t, e, r, n) {
|
|
|
972
972
|
else if (typeof s == "function" ? s = o[e] = n ? [r, s] : [s, r] : n ? s.unshift(r) : s.push(r), !s.warned && (i = Rt(t), i && i > 0 && s.length > i)) {
|
|
973
973
|
s.warned = !0;
|
|
974
974
|
var f = new Error("Possible EventEmitter memory leak detected. " + s.length + " " + e + " listeners added. Use emitter.setMaxListeners() to increase limit");
|
|
975
|
-
f.name = "MaxListenersExceededWarning", f.emitter = t, f.type = e, f.count = s.length,
|
|
975
|
+
f.name = "MaxListenersExceededWarning", f.emitter = t, f.type = e, f.count = s.length, Tr(f);
|
|
976
976
|
}
|
|
977
977
|
return t;
|
|
978
978
|
}
|
|
979
|
-
function
|
|
979
|
+
function Tr(t) {
|
|
980
980
|
typeof console.warn == "function" ? console.warn(t) : console.log(t);
|
|
981
981
|
}
|
|
982
982
|
g.prototype.addListener = function(e, r) {
|
|
@@ -1090,13 +1090,13 @@ function Nr(t) {
|
|
|
1090
1090
|
function At() {
|
|
1091
1091
|
throw new Error("setTimeout has not been defined");
|
|
1092
1092
|
}
|
|
1093
|
-
function
|
|
1093
|
+
function Lt() {
|
|
1094
1094
|
throw new Error("clearTimeout has not been defined");
|
|
1095
1095
|
}
|
|
1096
|
-
var Y = At, W =
|
|
1096
|
+
var Y = At, W = Lt;
|
|
1097
1097
|
typeof ie.setTimeout == "function" && (Y = setTimeout);
|
|
1098
1098
|
typeof ie.clearTimeout == "function" && (W = clearTimeout);
|
|
1099
|
-
function
|
|
1099
|
+
function Tt(t) {
|
|
1100
1100
|
if (Y === setTimeout)
|
|
1101
1101
|
return setTimeout(t, 0);
|
|
1102
1102
|
if ((Y === At || !Y) && setTimeout)
|
|
@@ -1114,7 +1114,7 @@ function Lt(t) {
|
|
|
1114
1114
|
function Fr(t) {
|
|
1115
1115
|
if (W === clearTimeout)
|
|
1116
1116
|
return clearTimeout(t);
|
|
1117
|
-
if ((W ===
|
|
1117
|
+
if ((W === Lt || !W) && clearTimeout)
|
|
1118
1118
|
return W = clearTimeout, clearTimeout(t);
|
|
1119
1119
|
try {
|
|
1120
1120
|
return W(t);
|
|
@@ -1126,18 +1126,18 @@ function Fr(t) {
|
|
|
1126
1126
|
}
|
|
1127
1127
|
}
|
|
1128
1128
|
}
|
|
1129
|
-
var
|
|
1129
|
+
var V = [], ne = !1, ee, me = -1;
|
|
1130
1130
|
function Mr() {
|
|
1131
|
-
!ne || !ee || (ne = !1, ee.length ?
|
|
1131
|
+
!ne || !ee || (ne = !1, ee.length ? V = ee.concat(V) : me = -1, V.length && Dt());
|
|
1132
1132
|
}
|
|
1133
1133
|
function Dt() {
|
|
1134
1134
|
if (!ne) {
|
|
1135
|
-
var t =
|
|
1135
|
+
var t = Tt(Mr);
|
|
1136
1136
|
ne = !0;
|
|
1137
|
-
for (var e =
|
|
1138
|
-
for (ee =
|
|
1137
|
+
for (var e = V.length; e; ) {
|
|
1138
|
+
for (ee = V, V = []; ++me < e; )
|
|
1139
1139
|
ee && ee[me].run();
|
|
1140
|
-
me = -1, e =
|
|
1140
|
+
me = -1, e = V.length;
|
|
1141
1141
|
}
|
|
1142
1142
|
ee = null, ne = !1, Fr(t);
|
|
1143
1143
|
}
|
|
@@ -1147,7 +1147,7 @@ function U(t) {
|
|
|
1147
1147
|
if (arguments.length > 1)
|
|
1148
1148
|
for (var r = 1; r < arguments.length; r++)
|
|
1149
1149
|
e[r - 1] = arguments[r];
|
|
1150
|
-
|
|
1150
|
+
V.push(new Nt(t, e)), V.length === 1 && !ne && Tt(Dt);
|
|
1151
1151
|
}
|
|
1152
1152
|
function Nt(t, e) {
|
|
1153
1153
|
this.fun = t, this.array = e;
|
|
@@ -1288,40 +1288,40 @@ function ye(t, e, r) {
|
|
|
1288
1288
|
var n = e.inspect(r, t);
|
|
1289
1289
|
return Ye(n) || (n = ye(t, n, r)), n;
|
|
1290
1290
|
}
|
|
1291
|
-
var i =
|
|
1291
|
+
var i = Vr(t, e);
|
|
1292
1292
|
if (i)
|
|
1293
1293
|
return i;
|
|
1294
1294
|
var o = Object.keys(e), s = qr(o);
|
|
1295
|
-
if (t.showHidden && (o = Object.getOwnPropertyNames(e)),
|
|
1295
|
+
if (t.showHidden && (o = Object.getOwnPropertyNames(e)), Te(e) && (o.indexOf("message") >= 0 || o.indexOf("description") >= 0))
|
|
1296
1296
|
return Ae(e);
|
|
1297
1297
|
if (o.length === 0) {
|
|
1298
1298
|
if (De(e)) {
|
|
1299
1299
|
var f = e.name ? ": " + e.name : "";
|
|
1300
1300
|
return t.stylize("[Function" + f + "]", "special");
|
|
1301
1301
|
}
|
|
1302
|
-
if (
|
|
1302
|
+
if (Le(e))
|
|
1303
1303
|
return t.stylize(RegExp.prototype.toString.call(e), "regexp");
|
|
1304
1304
|
if (et(e))
|
|
1305
1305
|
return t.stylize(Date.prototype.toString.call(e), "date");
|
|
1306
|
-
if (
|
|
1306
|
+
if (Te(e))
|
|
1307
1307
|
return Ae(e);
|
|
1308
1308
|
}
|
|
1309
|
-
var a = "", l = !1,
|
|
1310
|
-
if (Yr(e) && (l = !0,
|
|
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 (
|
|
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
|
-
return
|
|
1317
|
+
return Le(e) ? t.stylize(RegExp.prototype.toString.call(e), "regexp") : t.stylize("[Object]", "special");
|
|
1318
1318
|
t.seen.push(e);
|
|
1319
|
-
var
|
|
1320
|
-
return l ?
|
|
1319
|
+
var d;
|
|
1320
|
+
return l ? d = zr(t, e, r, s, o) : d = o.map(function(m) {
|
|
1321
1321
|
return Pe(t, e, r, s, m, l);
|
|
1322
|
-
}), t.seen.pop(), Jr(
|
|
1322
|
+
}), t.seen.pop(), Jr(d, a, h);
|
|
1323
1323
|
}
|
|
1324
|
-
function
|
|
1324
|
+
function Vr(t, e) {
|
|
1325
1325
|
if (Q(e))
|
|
1326
1326
|
return t.stylize("undefined", "undefined");
|
|
1327
1327
|
if (Ye(e)) {
|
|
@@ -1338,7 +1338,7 @@ function zr(t, e) {
|
|
|
1338
1338
|
function Ae(t) {
|
|
1339
1339
|
return "[" + Error.prototype.toString.call(t) + "]";
|
|
1340
1340
|
}
|
|
1341
|
-
function
|
|
1341
|
+
function zr(t, e, r, n, i) {
|
|
1342
1342
|
for (var o = [], s = 0, f = e.length; s < f; ++s)
|
|
1343
1343
|
Bt(e, String(s)) ? o.push(Pe(
|
|
1344
1344
|
t,
|
|
@@ -1405,7 +1405,7 @@ function Ye(t) {
|
|
|
1405
1405
|
function Q(t) {
|
|
1406
1406
|
return t === void 0;
|
|
1407
1407
|
}
|
|
1408
|
-
function
|
|
1408
|
+
function Le(t) {
|
|
1409
1409
|
return ue(t) && We(t) === "[object RegExp]";
|
|
1410
1410
|
}
|
|
1411
1411
|
function ue(t) {
|
|
@@ -1414,7 +1414,7 @@ function ue(t) {
|
|
|
1414
1414
|
function et(t) {
|
|
1415
1415
|
return ue(t) && We(t) === "[object Date]";
|
|
1416
1416
|
}
|
|
1417
|
-
function
|
|
1417
|
+
function Te(t) {
|
|
1418
1418
|
return ue(t) && (We(t) === "[object Error]" || t instanceof Error);
|
|
1419
1419
|
}
|
|
1420
1420
|
function De(t) {
|
|
@@ -1566,7 +1566,7 @@ function Kr(t) {
|
|
|
1566
1566
|
this.charReceived = t.length % 3, this.charLength = this.charReceived ? 3 : 0;
|
|
1567
1567
|
}
|
|
1568
1568
|
C.ReadableState = Ut;
|
|
1569
|
-
var
|
|
1569
|
+
var x = Pr("stream");
|
|
1570
1570
|
oe(C, g);
|
|
1571
1571
|
function en(t, e, r) {
|
|
1572
1572
|
if (typeof t.prependListener == "function")
|
|
@@ -1630,14 +1630,14 @@ 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
1632
|
C.prototype.read = function(t) {
|
|
1633
|
-
|
|
1633
|
+
x("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 x("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
|
+
x("need readable", n), (e.length === 0 || e.length - t < e.highWaterMark) && (n = !0, x("length less than watermark", n)), e.ended || e.reading ? (n = !1, x("reading or ended", n)) : n && (x("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,16 +1656,16 @@ 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 || (x("emitReadable", e.flowing), e.emittedReadable = !0, e.sync ? U(nt, t) : nt(t));
|
|
1660
1660
|
}
|
|
1661
1661
|
function nt(t) {
|
|
1662
|
-
|
|
1662
|
+
x("emit readable"), t.emit("readable"), Qe(t);
|
|
1663
1663
|
}
|
|
1664
1664
|
function fn(t, e) {
|
|
1665
1665
|
e.readingMore || (e.readingMore = !0, U(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 && (x("maybeReadMore read 0"), t.read(0), r !== e.length); )
|
|
1669
1669
|
r = e.length;
|
|
1670
1670
|
e.readingMore = !1;
|
|
1671
1671
|
}
|
|
@@ -1685,49 +1685,49 @@ C.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, x("pipe count=%d opts=%j", n.pipesCount, e);
|
|
1689
|
+
var i = !e || e.end !== !1, o = i ? f : h;
|
|
1690
1690
|
n.endEmitted ? U(o) : r.once("end", o), t.on("unpipe", s);
|
|
1691
1691
|
function s(I) {
|
|
1692
|
-
|
|
1692
|
+
x("onunpipe"), I === r && h();
|
|
1693
1693
|
}
|
|
1694
1694
|
function f() {
|
|
1695
|
-
|
|
1695
|
+
x("onend"), t.end();
|
|
1696
1696
|
}
|
|
1697
1697
|
var a = un(r);
|
|
1698
1698
|
t.on("drain", a);
|
|
1699
1699
|
var l = !1;
|
|
1700
|
-
function
|
|
1701
|
-
|
|
1700
|
+
function h() {
|
|
1701
|
+
x("cleanup"), t.removeListener("close", v), t.removeListener("finish", y), t.removeListener("drain", a), t.removeListener("error", m), t.removeListener("unpipe", s), r.removeListener("end", f), r.removeListener("end", h), r.removeListener("data", d), 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", d);
|
|
1705
|
+
function d(I) {
|
|
1706
|
+
x("ondata"), c = !1;
|
|
1707
|
+
var b = t.write(I);
|
|
1708
|
+
b === !1 && !c && ((n.pipesCount === 1 && n.pipes === t || n.pipesCount > 1 && $t(n.pipes, t) !== -1) && !l && (x("false write response, pause", r._readableState.awaitDrain), r._readableState.awaitDrain++, c = !0), r.pause());
|
|
1709
1709
|
}
|
|
1710
1710
|
function m(I) {
|
|
1711
|
-
|
|
1711
|
+
x("onerror", I), S(), t.removeListener("error", m), tn(t, "error") === 0 && t.emit("error", I);
|
|
1712
1712
|
}
|
|
1713
1713
|
en(t, "error", m);
|
|
1714
|
-
function
|
|
1714
|
+
function v() {
|
|
1715
1715
|
t.removeListener("finish", y), S();
|
|
1716
1716
|
}
|
|
1717
|
-
t.once("close",
|
|
1717
|
+
t.once("close", v);
|
|
1718
1718
|
function y() {
|
|
1719
|
-
|
|
1719
|
+
x("onfinish"), t.removeListener("close", v), S();
|
|
1720
1720
|
}
|
|
1721
1721
|
t.once("finish", y);
|
|
1722
1722
|
function S() {
|
|
1723
|
-
|
|
1723
|
+
x("unpipe"), r.unpipe(t);
|
|
1724
1724
|
}
|
|
1725
|
-
return t.emit("pipe", r), n.flowing || (
|
|
1725
|
+
return t.emit("pipe", r), n.flowing || (x("pipe resume"), r.resume()), t;
|
|
1726
1726
|
};
|
|
1727
1727
|
function un(t) {
|
|
1728
1728
|
return function() {
|
|
1729
1729
|
var e = t._readableState;
|
|
1730
|
-
|
|
1730
|
+
x("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) {
|
|
@@ -1757,36 +1757,36 @@ C.prototype.on = function(t, e) {
|
|
|
1757
1757
|
};
|
|
1758
1758
|
C.prototype.addListener = C.prototype.on;
|
|
1759
1759
|
function ln(t) {
|
|
1760
|
-
|
|
1760
|
+
x("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 || (x("resume"), t.flowing = !0, cn(this, t)), this;
|
|
1765
1765
|
};
|
|
1766
1766
|
function cn(t, e) {
|
|
1767
1767
|
e.resumeScheduled || (e.resumeScheduled = !0, U(hn, t, e));
|
|
1768
1768
|
}
|
|
1769
1769
|
function hn(t, e) {
|
|
1770
|
-
e.reading || (
|
|
1770
|
+
e.reading || (x("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
1772
|
C.prototype.pause = function() {
|
|
1773
|
-
return
|
|
1773
|
+
return x("call pause flowing=%j", this._readableState.flowing), this._readableState.flowing !== !1 && (x("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 (x("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 (x("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 (x("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,7 +1801,7 @@ C.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
|
+
x("wrapped _read", s), r && (r = !1, t.resume());
|
|
1805
1805
|
}, n;
|
|
1806
1806
|
};
|
|
1807
1807
|
C._fromList = Pt;
|
|
@@ -1855,8 +1855,8 @@ function $t(t, e) {
|
|
|
1855
1855
|
if (t[r] === e) return r;
|
|
1856
1856
|
return -1;
|
|
1857
1857
|
}
|
|
1858
|
-
|
|
1859
|
-
oe(
|
|
1858
|
+
T.WritableState = He;
|
|
1859
|
+
oe(T, g);
|
|
1860
1860
|
function wn() {
|
|
1861
1861
|
}
|
|
1862
1862
|
function yn(t, e, r) {
|
|
@@ -1873,41 +1873,41 @@ function He(t, e) {
|
|
|
1873
1873
|
var i = t.decodeStrings === !1;
|
|
1874
1874
|
this.decodeStrings = !i, this.defaultEncoding = t.defaultEncoding || "utf8", this.length = 0, this.writing = !1, this.corked = 0, this.sync = !0, this.bufferProcessing = !1, this.onwrite = function(o) {
|
|
1875
1875
|
In(e, o);
|
|
1876
|
-
}, this.writecb = null, this.writelen = 0, this.bufferedRequest = null, this.lastBufferedRequest = null, this.pendingcb = 0, this.prefinished = !1, this.errorEmitted = !1, this.bufferedRequestCount = 0, this.corkedRequestsFree = new
|
|
1876
|
+
}, this.writecb = null, this.writelen = 0, this.bufferedRequest = null, this.lastBufferedRequest = null, this.pendingcb = 0, this.prefinished = !1, this.errorEmitted = !1, this.bufferedRequestCount = 0, this.corkedRequestsFree = new zt(this);
|
|
1877
1877
|
}
|
|
1878
1878
|
He.prototype.getBuffer = function() {
|
|
1879
1879
|
for (var e = this.bufferedRequest, r = []; e; )
|
|
1880
1880
|
r.push(e), e = e.next;
|
|
1881
1881
|
return r;
|
|
1882
1882
|
};
|
|
1883
|
-
function
|
|
1884
|
-
if (!(this instanceof
|
|
1883
|
+
function T(t) {
|
|
1884
|
+
if (!(this instanceof T) && !(this instanceof B)) return new T(t);
|
|
1885
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)), g.call(this);
|
|
1886
1886
|
}
|
|
1887
|
-
|
|
1887
|
+
T.prototype.pipe = function() {
|
|
1888
1888
|
this.emit("error", new Error("Cannot pipe, not readable"));
|
|
1889
1889
|
};
|
|
1890
|
-
function
|
|
1890
|
+
function bn(t, e) {
|
|
1891
1891
|
var r = new Error("write after end");
|
|
1892
1892
|
t.emit("error", r), U(e, r);
|
|
1893
1893
|
}
|
|
1894
|
-
function
|
|
1894
|
+
function vn(t, e, r, n) {
|
|
1895
1895
|
var i = !0, o = !1;
|
|
1896
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), U(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), u.isBuffer(t) ? e = "buffer" : e || (e = n.defaultEncoding), typeof r != "function" && (r = wn), n.ended ?
|
|
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 ? bn(this, r) : vn(this, n, t, r) && (n.pendingcb++, i = xn(this, n, t, e, r)), i;
|
|
1901
1901
|
};
|
|
1902
|
-
|
|
1902
|
+
T.prototype.cork = function() {
|
|
1903
1903
|
var t = this._writableState;
|
|
1904
1904
|
t.corked++;
|
|
1905
1905
|
};
|
|
1906
|
-
|
|
1906
|
+
T.prototype.uncork = function() {
|
|
1907
1907
|
var t = this._writableState;
|
|
1908
1908
|
t.corked && (t.corked--, !t.writing && !t.corked && !t.finished && !t.bufferProcessing && t.bufferedRequest && jt(this, t));
|
|
1909
1909
|
};
|
|
1910
|
-
|
|
1910
|
+
T.prototype.setDefaultEncoding = function(e) {
|
|
1911
1911
|
if (typeof e == "string" && (e = e.toLowerCase()), !(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((e + "").toLowerCase()) > -1)) throw new TypeError("Unknown encoding: " + e);
|
|
1912
1912
|
return this._writableState.defaultEncoding = e, this;
|
|
1913
1913
|
};
|
|
@@ -1944,7 +1944,7 @@ function In(t, e) {
|
|
|
1944
1944
|
}
|
|
1945
1945
|
}
|
|
1946
1946
|
function it(t, e, r, n) {
|
|
1947
|
-
r || Cn(t, e), e.pendingcb--, n(),
|
|
1947
|
+
r || Cn(t, e), e.pendingcb--, n(), Vt(t, e);
|
|
1948
1948
|
}
|
|
1949
1949
|
function Cn(t, e) {
|
|
1950
1950
|
e.length === 0 && e.needDrain && (e.needDrain = !1, t.emit("drain"));
|
|
@@ -1957,22 +1957,22 @@ function jt(t, e) {
|
|
|
1957
1957
|
o.entry = r;
|
|
1958
1958
|
for (var s = 0; r; )
|
|
1959
1959
|
i[s] = r, r = r.next, s += 1;
|
|
1960
|
-
$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
|
|
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 zt(e);
|
|
1961
1961
|
} else {
|
|
1962
1962
|
for (; r; ) {
|
|
1963
|
-
var f = r.chunk, a = r.encoding, l = r.callback,
|
|
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);
|
|
1968
1968
|
}
|
|
1969
1969
|
e.bufferedRequestCount = 0, e.bufferedRequest = r, e.bufferProcessing = !1;
|
|
1970
1970
|
}
|
|
1971
|
-
|
|
1971
|
+
T.prototype._write = function(t, e, r) {
|
|
1972
1972
|
r(new Error("not implemented"));
|
|
1973
1973
|
};
|
|
1974
|
-
|
|
1975
|
-
|
|
1974
|
+
T.prototype._writev = null;
|
|
1975
|
+
T.prototype.end = function(t, e, r) {
|
|
1976
1976
|
var n = this._writableState;
|
|
1977
1977
|
typeof t == "function" ? (r = t, t = null, e = null) : typeof e == "function" && (r = e, e = null), t != null && this.write(t, e), n.corked && (n.corked = 1, this.uncork()), !n.ending && !n.finished && On(this, n, r);
|
|
1978
1978
|
};
|
|
@@ -1982,14 +1982,14 @@ function qt(t) {
|
|
|
1982
1982
|
function ot(t, e) {
|
|
1983
1983
|
e.prefinished || (e.prefinished = !0, t.emit("prefinish"));
|
|
1984
1984
|
}
|
|
1985
|
-
function
|
|
1985
|
+
function Vt(t, e) {
|
|
1986
1986
|
var r = qt(e);
|
|
1987
1987
|
return r && (e.pendingcb === 0 ? (ot(t, e), e.finished = !0, t.emit("finish")) : ot(t, e)), r;
|
|
1988
1988
|
}
|
|
1989
1989
|
function On(t, e, r) {
|
|
1990
|
-
e.ending = !0,
|
|
1990
|
+
e.ending = !0, Vt(t, e), r && (e.finished ? U(r) : t.once("finish", r)), e.ended = !0, t.writable = !1;
|
|
1991
1991
|
}
|
|
1992
|
-
function
|
|
1992
|
+
function zt(t) {
|
|
1993
1993
|
var e = this;
|
|
1994
1994
|
this.next = null, this.entry = null, this.finish = function(r) {
|
|
1995
1995
|
var n = e.entry;
|
|
@@ -2001,23 +2001,23 @@ function Vt(t) {
|
|
|
2001
2001
|
};
|
|
2002
2002
|
}
|
|
2003
2003
|
oe(B, C);
|
|
2004
|
-
var st = Object.keys(
|
|
2004
|
+
var st = Object.keys(T.prototype);
|
|
2005
2005
|
for (var Fe = 0; Fe < st.length; Fe++) {
|
|
2006
2006
|
var Me = st[Fe];
|
|
2007
|
-
B.prototype[Me] || (B.prototype[Me] =
|
|
2007
|
+
B.prototype[Me] || (B.prototype[Me] = T.prototype[Me]);
|
|
2008
2008
|
}
|
|
2009
2009
|
function B(t) {
|
|
2010
2010
|
if (!(this instanceof B)) return new B(t);
|
|
2011
|
-
C.call(this, t),
|
|
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
|
-
this.allowHalfOpen || this._writableState.ended || U(
|
|
2014
|
+
this.allowHalfOpen || this._writableState.ended || U(Ln, this);
|
|
2015
2015
|
}
|
|
2016
|
-
function
|
|
2016
|
+
function Ln(t) {
|
|
2017
2017
|
t.end();
|
|
2018
2018
|
}
|
|
2019
2019
|
oe(k, B);
|
|
2020
|
-
function
|
|
2020
|
+
function Tn(t) {
|
|
2021
2021
|
this.afterTransform = function(e, r) {
|
|
2022
2022
|
return Dn(t, e, r);
|
|
2023
2023
|
}, this.needTransform = !1, this.transforming = !1, this.writecb = null, this.writechunk = null, this.writeencoding = null;
|
|
@@ -2033,7 +2033,7 @@ function Dn(t, e, r) {
|
|
|
2033
2033
|
}
|
|
2034
2034
|
function k(t) {
|
|
2035
2035
|
if (!(this instanceof k)) return new k(t);
|
|
2036
|
-
B.call(this, t), this._transformState = new
|
|
2036
|
+
B.call(this, t), this._transformState = new Tn(this);
|
|
2037
2037
|
var e = this;
|
|
2038
2038
|
this._readableState.needReadable = !0, this._readableState.sync = !1, t && (typeof t.transform == "function" && (this._transform = t.transform), typeof t.flush == "function" && (this._flush = t.flush)), this.once("prefinish", function() {
|
|
2039
2039
|
typeof this._flush == "function" ? this._flush(function(r) {
|
|
@@ -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(
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
function
|
|
2076
|
+
oe(z, g);
|
|
2077
|
+
z.Readable = C;
|
|
2078
|
+
z.Writable = T;
|
|
2079
|
+
z.Duplex = B;
|
|
2080
|
+
z.Transform = k;
|
|
2081
|
+
z.PassThrough = fe;
|
|
2082
|
+
z.Stream = z;
|
|
2083
|
+
function z() {
|
|
2084
2084
|
g.call(this);
|
|
2085
2085
|
}
|
|
2086
|
-
|
|
2086
|
+
z.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,9 +2100,9 @@ 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(
|
|
2103
|
+
function a(h) {
|
|
2104
2104
|
if (l(), g.listenerCount(this, "error") === 0)
|
|
2105
|
-
throw
|
|
2105
|
+
throw h;
|
|
2106
2106
|
}
|
|
2107
2107
|
r.on("error", a), t.on("error", a);
|
|
2108
2108
|
function l() {
|
|
@@ -2665,22 +2665,22 @@ 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: l, needMoreDataSize:
|
|
2669
|
-
|
|
2668
|
+
const { encoding: s, escape: f, quote: a } = this.options, { quoting: l, needMoreDataSize: h, recordDelimiterMaxLength: c } = this.state, d = i - n - 1, m = 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
|
-
l ? a.length +
|
|
2681
|
+
l ? a.length + c : 0
|
|
2682
2682
|
);
|
|
2683
|
-
return
|
|
2683
|
+
return d < m;
|
|
2684
2684
|
},
|
|
2685
2685
|
// Central parser implementation
|
|
2686
2686
|
parse: function(n, i, o, s) {
|
|
@@ -2688,39 +2688,39 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
2688
2688
|
bom: f,
|
|
2689
2689
|
comment_no_infix: a,
|
|
2690
2690
|
encoding: l,
|
|
2691
|
-
from_line:
|
|
2692
|
-
ltrim:
|
|
2693
|
-
max_record_size:
|
|
2691
|
+
from_line: h,
|
|
2692
|
+
ltrim: c,
|
|
2693
|
+
max_record_size: d,
|
|
2694
2694
|
raw: m,
|
|
2695
|
-
relax_quotes:
|
|
2695
|
+
relax_quotes: v,
|
|
2696
2696
|
rtrim: y,
|
|
2697
2697
|
skip_empty_lines: S,
|
|
2698
2698
|
to: I,
|
|
2699
|
-
to_line:
|
|
2699
|
+
to_line: b
|
|
2700
2700
|
} = this.options;
|
|
2701
2701
|
let { comment: _, escape: R, quote: F, record_delimiter: Re } = this.options;
|
|
2702
2702
|
const { bomSkipped: Wt, previousBuf: ce, rawBuffer: Qt, escapeIsQuote: Ht } = this.state;
|
|
2703
|
-
let
|
|
2703
|
+
let E;
|
|
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
|
+
E = n;
|
|
2710
|
+
else ce !== void 0 && n === void 0 ? E = ce : E = 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 (E.length < 3) {
|
|
2715
2715
|
if (i === !1) {
|
|
2716
|
-
this.state.previousBuf =
|
|
2716
|
+
this.state.previousBuf = E;
|
|
2717
2717
|
return;
|
|
2718
2718
|
}
|
|
2719
2719
|
} else {
|
|
2720
2720
|
for (const O in re)
|
|
2721
|
-
if (re[O].compare(
|
|
2721
|
+
if (re[O].compare(E, 0, re[O].length) === 0) {
|
|
2722
2722
|
const J = re[O].length;
|
|
2723
|
-
this.state.bufBytesStart += J,
|
|
2723
|
+
this.state.bufBytesStart += J, E = E.slice(J);
|
|
2724
2724
|
const he = ut({
|
|
2725
2725
|
...this.original_options,
|
|
2726
2726
|
encoding: O
|
|
@@ -2732,44 +2732,44 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
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 = E.length;
|
|
2736
|
+
let p;
|
|
2737
|
+
for (p = 0; p < Ie && !this.__needMoreData(p, Ie, i); p++) {
|
|
2738
|
+
if (this.state.wasRowDelimiter === !0 && (this.info.lines++, this.state.wasRowDelimiter = !1), b !== -1 && this.info.lines > b) {
|
|
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
|
+
E,
|
|
2744
|
+
p
|
|
2745
2745
|
) && (Re = this.options.record_delimiter);
|
|
2746
|
-
const O =
|
|
2746
|
+
const O = E[p];
|
|
2747
2747
|
if (m === !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 (R !== null && this.state.quoting === !0 && this.__isEscape(
|
|
2750
|
+
if (R !== null && this.state.quoting === !0 && this.__isEscape(E, p, O) && p + R.length < Ie)
|
|
2751
2751
|
if (Ht) {
|
|
2752
|
-
if (this.__isQuote(
|
|
2753
|
-
this.state.escaping = !0,
|
|
2752
|
+
if (this.__isQuote(E, p + R.length)) {
|
|
2753
|
+
this.state.escaping = !0, p += R.length - 1;
|
|
2754
2754
|
continue;
|
|
2755
2755
|
}
|
|
2756
2756
|
} else {
|
|
2757
|
-
this.state.escaping = !0,
|
|
2757
|
+
this.state.escaping = !0, p += R.length - 1;
|
|
2758
2758
|
continue;
|
|
2759
2759
|
}
|
|
2760
|
-
if (this.state.commenting === !1 && this.__isQuote(
|
|
2760
|
+
if (this.state.commenting === !1 && this.__isQuote(E, p))
|
|
2761
2761
|
if (this.state.quoting === !0) {
|
|
2762
|
-
const A =
|
|
2763
|
-
|
|
2764
|
-
|
|
2762
|
+
const A = E[p + F.length], Z = y && this.__isCharTrimable(E, p + F.length), j = _ !== null && this.__compareBytes(_, E, p + F.length, A), X = this.__isDelimiter(
|
|
2763
|
+
E,
|
|
2764
|
+
p + F.length,
|
|
2765
2765
|
A
|
|
2766
|
-
), de = Re.length === 0 ? this.__autoDiscoverRecordDelimiter(
|
|
2767
|
-
if (R !== null && this.__isEscape(
|
|
2768
|
-
|
|
2766
|
+
), de = Re.length === 0 ? this.__autoDiscoverRecordDelimiter(E, p + F.length) : this.__isRecordDelimiter(A, E, p + F.length);
|
|
2767
|
+
if (R !== null && this.__isEscape(E, p, O) && this.__isQuote(E, p + R.length))
|
|
2768
|
+
p += R.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, p += F.length - 1;
|
|
2771
2771
|
continue;
|
|
2772
|
-
} else if (
|
|
2772
|
+
} else if (v === !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(F),
|
|
2789
|
+
this.state.quoting = !1, this.state.wasQuoting = !0, this.state.field.prepend(F), p += F.length - 1;
|
|
2790
2790
|
} else if (this.state.field.length !== 0) {
|
|
2791
|
-
if (
|
|
2791
|
+
if (v === !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(
|
|
@@ -2809,31 +2809,31 @@ 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, p += F.length - 1;
|
|
2813
2813
|
continue;
|
|
2814
2814
|
}
|
|
2815
2815
|
if (this.state.quoting === !1) {
|
|
2816
2816
|
const A = this.__isRecordDelimiter(
|
|
2817
2817
|
O,
|
|
2818
|
-
|
|
2819
|
-
|
|
2818
|
+
E,
|
|
2819
|
+
p
|
|
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(), p += A - 1;
|
|
2827
2827
|
continue;
|
|
2828
2828
|
}
|
|
2829
2829
|
if (S === !0 && this.state.wasQuoting === !1 && this.state.record.length === 0 && this.state.field.length === 0) {
|
|
2830
|
-
this.info.empty_lines++,
|
|
2830
|
+
this.info.empty_lines++, p += A - 1;
|
|
2831
2831
|
continue;
|
|
2832
2832
|
}
|
|
2833
|
-
this.info.bytes = this.state.bufBytesStart +
|
|
2833
|
+
this.info.bytes = this.state.bufBytesStart + p;
|
|
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 + p + A;
|
|
2837
2837
|
const de = this.__onRecord(o);
|
|
2838
2838
|
if (de !== void 0) return de;
|
|
2839
2839
|
if (I !== -1 && this.info.records >= I) {
|
|
@@ -2841,44 +2841,44 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
2841
2841
|
return;
|
|
2842
2842
|
}
|
|
2843
2843
|
}
|
|
2844
|
-
this.state.commenting = !1,
|
|
2844
|
+
this.state.commenting = !1, p += 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(_, E, p, O) !== 0) {
|
|
2850
2850
|
this.state.commenting = !0;
|
|
2851
2851
|
continue;
|
|
2852
2852
|
}
|
|
2853
|
-
const Z = this.__isDelimiter(
|
|
2853
|
+
const Z = this.__isDelimiter(E, p, O);
|
|
2854
2854
|
if (Z !== 0) {
|
|
2855
|
-
this.info.bytes = this.state.bufBytesStart +
|
|
2855
|
+
this.info.bytes = this.state.bufBytesStart + p;
|
|
2856
2856
|
const j = this.__onField();
|
|
2857
2857
|
if (j !== void 0) return j;
|
|
2858
|
-
|
|
2858
|
+
p += Z - 1;
|
|
2859
2859
|
continue;
|
|
2860
2860
|
}
|
|
2861
2861
|
}
|
|
2862
2862
|
}
|
|
2863
|
-
if (this.state.commenting === !1 &&
|
|
2863
|
+
if (this.state.commenting === !1 && d !== 0 && this.state.record_length + this.state.field.length > d)
|
|
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 ${d}`,
|
|
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(E, p), he = y === !1 || this.state.wasQuoting === !1;
|
|
2878
2878
|
if (J === !0 && he === !0)
|
|
2879
2879
|
this.state.field.append(O);
|
|
2880
2880
|
else {
|
|
2881
|
-
if (y === !0 && !this.__isCharTrimable(
|
|
2881
|
+
if (y === !0 && !this.__isCharTrimable(E, p))
|
|
2882
2882
|
return this.__error(
|
|
2883
2883
|
new w(
|
|
2884
2884
|
"CSV_NON_TRIMABLE_CHAR_AFTER_CLOSING_QUOTE",
|
|
@@ -2891,7 +2891,7 @@ 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 && (p += this.__isCharTrimable(E, p) - 1);
|
|
2895
2895
|
continue;
|
|
2896
2896
|
}
|
|
2897
2897
|
}
|
|
@@ -2910,14 +2910,14 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
2910
2910
|
);
|
|
2911
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 +
|
|
2913
|
+
this.info.bytes = this.state.bufBytesStart + p;
|
|
2914
2914
|
const O = this.__onField();
|
|
2915
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 += p, this.state.previousBuf = E.slice(p);
|
|
2921
2921
|
this.state.wasRowDelimiter === !0 && (this.info.lines++, this.state.wasRowDelimiter = !1);
|
|
2922
2922
|
},
|
|
2923
2923
|
__onRecord: function(n) {
|
|
@@ -2928,12 +2928,12 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
2928
2928
|
info: f,
|
|
2929
2929
|
from: a,
|
|
2930
2930
|
relax_column_count: l,
|
|
2931
|
-
relax_column_count_less:
|
|
2932
|
-
relax_column_count_more:
|
|
2933
|
-
raw:
|
|
2931
|
+
relax_column_count_less: h,
|
|
2932
|
+
relax_column_count_more: c,
|
|
2933
|
+
raw: d,
|
|
2934
2934
|
skip_records_with_empty_values: m
|
|
2935
|
-
} = this.options, { enabled:
|
|
2936
|
-
if (
|
|
2935
|
+
} = this.options, { enabled: v, record: y } = this.state;
|
|
2936
|
+
if (v === !1)
|
|
2937
2937
|
return this.__resetRecord();
|
|
2938
2938
|
const S = y.length;
|
|
2939
2939
|
if (i === !0) {
|
|
@@ -2970,11 +2970,11 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
2970
2970
|
record: y
|
|
2971
2971
|
}
|
|
2972
2972
|
);
|
|
2973
|
-
if (l === !0 ||
|
|
2973
|
+
if (l === !0 || h === !0 && S < this.state.expectedRecordLength || c === !0 && S > this.state.expectedRecordLength)
|
|
2974
2974
|
this.info.invalid_field_length++, this.state.error = I;
|
|
2975
2975
|
else {
|
|
2976
|
-
const
|
|
2977
|
-
if (
|
|
2976
|
+
const b = this.__error(I);
|
|
2977
|
+
if (b) return b;
|
|
2978
2978
|
}
|
|
2979
2979
|
}
|
|
2980
2980
|
if (m === !0 && lt(y)) {
|
|
@@ -2988,46 +2988,46 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
2988
2988
|
if (this.info.records++, a === 1 || this.info.records >= a) {
|
|
2989
2989
|
const { objname: I } = this.options;
|
|
2990
2990
|
if (i !== !1) {
|
|
2991
|
-
const
|
|
2991
|
+
const b = {};
|
|
2992
2992
|
for (let _ = 0, R = y.length; _ < R; _++)
|
|
2993
|
-
i[_] === void 0 || i[_].disabled || (o === !0 &&
|
|
2994
|
-
if (
|
|
2993
|
+
i[_] === void 0 || i[_].disabled || (o === !0 && b[i[_].name] !== void 0 ? Array.isArray(b[i[_].name]) ? b[i[_].name] = b[i[_].name].concat(y[_]) : b[i[_].name] = [b[i[_].name], y[_]] : b[i[_].name] = y[_]);
|
|
2994
|
+
if (d === !0 || f === !0) {
|
|
2995
2995
|
const _ = Object.assign(
|
|
2996
|
-
{ record:
|
|
2997
|
-
|
|
2996
|
+
{ record: b },
|
|
2997
|
+
d === !0 ? { raw: this.state.rawBuffer.toString(s) } : {},
|
|
2998
2998
|
f === !0 ? { info: this.__infoRecord() } : {}
|
|
2999
2999
|
), R = this.__push(
|
|
3000
|
-
I === void 0 ? _ : [
|
|
3000
|
+
I === void 0 ? _ : [b[I], _],
|
|
3001
3001
|
n
|
|
3002
3002
|
);
|
|
3003
3003
|
if (R)
|
|
3004
3004
|
return R;
|
|
3005
3005
|
} else {
|
|
3006
3006
|
const _ = this.__push(
|
|
3007
|
-
I === void 0 ?
|
|
3007
|
+
I === void 0 ? b : [b[I], b],
|
|
3008
3008
|
n
|
|
3009
3009
|
);
|
|
3010
3010
|
if (_)
|
|
3011
3011
|
return _;
|
|
3012
3012
|
}
|
|
3013
|
-
} else if (
|
|
3014
|
-
const
|
|
3013
|
+
} else if (d === !0 || f === !0) {
|
|
3014
|
+
const b = Object.assign(
|
|
3015
3015
|
{ record: y },
|
|
3016
|
-
|
|
3016
|
+
d === !0 ? { raw: this.state.rawBuffer.toString(s) } : {},
|
|
3017
3017
|
f === !0 ? { info: this.__infoRecord() } : {}
|
|
3018
3018
|
), _ = this.__push(
|
|
3019
|
-
I === void 0 ?
|
|
3019
|
+
I === void 0 ? b : [y[I], b],
|
|
3020
3020
|
n
|
|
3021
3021
|
);
|
|
3022
3022
|
if (_)
|
|
3023
3023
|
return _;
|
|
3024
3024
|
} else {
|
|
3025
|
-
const
|
|
3025
|
+
const b = this.__push(
|
|
3026
3026
|
I === void 0 ? y : [y[I], y],
|
|
3027
3027
|
n
|
|
3028
3028
|
);
|
|
3029
|
-
if (
|
|
3030
|
-
return
|
|
3029
|
+
if (b)
|
|
3030
|
+
return b;
|
|
3031
3031
|
}
|
|
3032
3032
|
}
|
|
3033
3033
|
this.__resetRecord();
|
|
@@ -3068,9 +3068,9 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
3068
3068
|
return this.__resetField();
|
|
3069
3069
|
let l = this.state.field.toString(i);
|
|
3070
3070
|
if (o === !0 && a === !1 && (l = l.trimRight()), n === !0) {
|
|
3071
|
-
const [
|
|
3072
|
-
if (
|
|
3073
|
-
l =
|
|
3071
|
+
const [h, c] = this.__cast(l);
|
|
3072
|
+
if (h !== void 0) return h;
|
|
3073
|
+
l = c;
|
|
3074
3074
|
}
|
|
3075
3075
|
this.state.record.push(l), s !== 0 && typeof l == "string" && (this.state.record_length += l.length), this.__resetField();
|
|
3076
3076
|
},
|
|
@@ -3116,10 +3116,10 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
3116
3116
|
return ((s, f) => {
|
|
3117
3117
|
const { timchars: a } = this.state;
|
|
3118
3118
|
e: for (let l = 0; l < a.length; l++) {
|
|
3119
|
-
const
|
|
3120
|
-
for (let
|
|
3121
|
-
if (c
|
|
3122
|
-
return
|
|
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);
|
|
@@ -3149,8 +3149,8 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
3149
3149
|
e: for (let a = 0; a < s.length; a++) {
|
|
3150
3150
|
const l = s[a];
|
|
3151
3151
|
if (l[0] === o) {
|
|
3152
|
-
for (let
|
|
3153
|
-
if (l[
|
|
3152
|
+
for (let h = 1; h < l.length; h++)
|
|
3153
|
+
if (l[h] !== n[i + h]) continue e;
|
|
3154
3154
|
return l.length;
|
|
3155
3155
|
}
|
|
3156
3156
|
}
|
|
@@ -3159,10 +3159,10 @@ 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 l = s[a],
|
|
3162
|
+
const l = s[a], h = l.length;
|
|
3163
3163
|
if (l[0] === n) {
|
|
3164
|
-
for (let
|
|
3165
|
-
if (l[
|
|
3164
|
+
for (let c = 1; c < h; c++)
|
|
3165
|
+
if (l[c] !== i[o + c])
|
|
3166
3166
|
continue e;
|
|
3167
3167
|
return l.length;
|
|
3168
3168
|
}
|
|
@@ -3250,7 +3250,7 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
3250
3250
|
}
|
|
3251
3251
|
};
|
|
3252
3252
|
};
|
|
3253
|
-
class
|
|
3253
|
+
class Vn extends k {
|
|
3254
3254
|
constructor(e = {}) {
|
|
3255
3255
|
super({ readableObjectMode: !0, ...e, encoding: null }), this.api = qn({
|
|
3256
3256
|
on_skip: (r, n) => {
|
|
@@ -3309,7 +3309,7 @@ const je = function() {
|
|
|
3309
3309
|
e || {}
|
|
3310
3310
|
);
|
|
3311
3311
|
}
|
|
3312
|
-
const n = new
|
|
3312
|
+
const n = new Vn(e);
|
|
3313
3313
|
if (r) {
|
|
3314
3314
|
const i = e === void 0 || e.objname === void 0 ? [] : {};
|
|
3315
3315
|
n.on("readable", function() {
|
|
@@ -3330,14 +3330,14 @@ const je = function() {
|
|
|
3330
3330
|
}
|
|
3331
3331
|
return n;
|
|
3332
3332
|
};
|
|
3333
|
-
class
|
|
3333
|
+
class zn extends Error {
|
|
3334
3334
|
locator;
|
|
3335
3335
|
/** Logical source of the error. */
|
|
3336
3336
|
constructor(e, r, n) {
|
|
3337
3337
|
super(e, n), this.name = new.target.name, this.locator = r;
|
|
3338
3338
|
}
|
|
3339
3339
|
}
|
|
3340
|
-
class Jn extends
|
|
3340
|
+
class Jn extends zn {
|
|
3341
3341
|
}
|
|
3342
3342
|
class Yn extends Jn {
|
|
3343
3343
|
body;
|
|
@@ -3386,70 +3386,76 @@ class ri {
|
|
|
3386
3386
|
return je(e);
|
|
3387
3387
|
}
|
|
3388
3388
|
/**
|
|
3389
|
-
*
|
|
3389
|
+
* Infer schema.
|
|
3390
3390
|
*/
|
|
3391
|
-
async
|
|
3392
|
-
const i = Xn(r), {
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
for (const l of o) {
|
|
3396
|
-
const c = e.parseRecord(a, l, !0);
|
|
3391
|
+
async inferSchema(e, r, n) {
|
|
3392
|
+
const i = Xn(r), { parsingRecords: o, valueDelimiterId: s } = await Kn(r, n), f = [], a = [];
|
|
3393
|
+
for (const h of o) {
|
|
3394
|
+
const c = e.parseRecord(a, h, !0);
|
|
3397
3395
|
f.push(c);
|
|
3398
3396
|
}
|
|
3399
|
-
|
|
3397
|
+
const l = f[0];
|
|
3398
|
+
if (l) {
|
|
3399
|
+
const h = l.length;
|
|
3400
|
+
for (let c = 0; c < h; c++) {
|
|
3401
|
+
const d = l[c]?.inferredValue, m = d == null ? `Column ${c}` : String(d), v = a[c];
|
|
3402
|
+
v == null ? a.push({ label: { en: m } }) : v.label = { en: m };
|
|
3403
|
+
}
|
|
3404
|
+
}
|
|
3405
|
+
return { recordDelimiterId: i, valueDelimiterId: s, parsingRecords: o, inferenceRecords: f, columnConfigs: a };
|
|
3400
3406
|
}
|
|
3401
3407
|
/**
|
|
3402
3408
|
* Parse stream.
|
|
3403
3409
|
*/
|
|
3404
3410
|
async parseStream(e, r, n, i, o) {
|
|
3405
3411
|
return new Promise((s, f) => {
|
|
3406
|
-
let a, l,
|
|
3412
|
+
let a, l, h, c = !1, d = !1;
|
|
3407
3413
|
const m = () => {
|
|
3408
|
-
if (
|
|
3409
|
-
|
|
3414
|
+
if (d) return;
|
|
3415
|
+
d = !0;
|
|
3410
3416
|
const S = a;
|
|
3411
|
-
a = void 0,
|
|
3417
|
+
a = void 0, h = void 0, S != null && (Be(() => S.removeAllListeners()), Be(() => S.end())), Be(() => {
|
|
3412
3418
|
l?.cancel();
|
|
3413
3419
|
}), l = void 0;
|
|
3414
3420
|
};
|
|
3415
3421
|
i.signal.addEventListener("abort", m, { once: !0 });
|
|
3416
|
-
const
|
|
3417
|
-
|
|
3422
|
+
const v = (S) => {
|
|
3423
|
+
c || (c = !0, m(), i.signal.aborted || i.abort(S), f(S));
|
|
3418
3424
|
};
|
|
3419
3425
|
(async () => {
|
|
3420
3426
|
a = je({
|
|
3421
3427
|
...r,
|
|
3422
3428
|
cast: (R, F) => ({ value: R, wasValueQuoted: F.quoting })
|
|
3423
|
-
}),
|
|
3429
|
+
}), h = ei({ chunk: o, chunkSize: e.chunkSize ?? Gn }), a.on("readable", () => {
|
|
3424
3430
|
try {
|
|
3425
|
-
if (a == null ||
|
|
3431
|
+
if (a == null || h == null) return;
|
|
3426
3432
|
let R;
|
|
3427
3433
|
for (; (R = a.read()) != null; ) {
|
|
3428
|
-
if (
|
|
3429
|
-
i.signal.throwIfAborted(),
|
|
3434
|
+
if (c) return;
|
|
3435
|
+
i.signal.throwIfAborted(), h.push(R);
|
|
3430
3436
|
}
|
|
3431
3437
|
} catch (R) {
|
|
3432
|
-
|
|
3438
|
+
v(R);
|
|
3433
3439
|
}
|
|
3434
|
-
}), a.on("error", (R) =>
|
|
3435
|
-
|
|
3440
|
+
}), a.on("error", (R) => v(R)), a.on("end", () => {
|
|
3441
|
+
c || (h?.flush(), s(ti(a)));
|
|
3436
3442
|
});
|
|
3437
3443
|
const S = await fetch(encodeURI(n), { signal: i.signal });
|
|
3438
3444
|
if (!S.ok || S.body == null)
|
|
3439
3445
|
throw await Wn(S, `Failed to fetch '${n}' file.`, "datapos-connector-file-store-emulator|Connector|retrieve");
|
|
3440
3446
|
l = S.body.getReader();
|
|
3441
3447
|
const I = new TextDecoder(e.encodingId);
|
|
3442
|
-
let
|
|
3443
|
-
for (; !
|
|
3444
|
-
if (
|
|
3448
|
+
let b = await l.read();
|
|
3449
|
+
for (; !b.done; ) {
|
|
3450
|
+
if (c) return;
|
|
3445
3451
|
i.signal.throwIfAborted();
|
|
3446
|
-
const R = I.decode(
|
|
3447
|
-
R.length > 0 && a.write(R),
|
|
3452
|
+
const R = I.decode(b.value, { stream: !0 });
|
|
3453
|
+
R.length > 0 && a.write(R), b = await l.read();
|
|
3448
3454
|
}
|
|
3449
|
-
if (
|
|
3455
|
+
if (c) return;
|
|
3450
3456
|
const _ = I.decode();
|
|
3451
3457
|
_.length > 0 && a.write(_), a.end();
|
|
3452
|
-
})().catch((S) =>
|
|
3458
|
+
})().catch((S) => v(S));
|
|
3453
3459
|
});
|
|
3454
3460
|
}
|
|
3455
3461
|
}
|
|
@@ -3464,33 +3470,33 @@ async function Kn(t, e) {
|
|
|
3464
3470
|
let r, n, i, o = [];
|
|
3465
3471
|
for (const s of e)
|
|
3466
3472
|
try {
|
|
3467
|
-
let f = 0, a, l = 0,
|
|
3468
|
-
const
|
|
3469
|
-
cast: (
|
|
3473
|
+
let f = 0, a, l = 0, h = 0;
|
|
3474
|
+
const c = je({
|
|
3475
|
+
cast: (d, m) => ({ value: d, wasValueQuoted: m.quoting }),
|
|
3470
3476
|
delimiter: s,
|
|
3471
3477
|
relax_column_count: !0
|
|
3472
3478
|
});
|
|
3473
|
-
await new Promise((
|
|
3479
|
+
await new Promise((d) => {
|
|
3474
3480
|
try {
|
|
3475
3481
|
const m = [];
|
|
3476
|
-
|
|
3477
|
-
let
|
|
3478
|
-
for (; (
|
|
3482
|
+
c.on("readable", () => {
|
|
3483
|
+
let v;
|
|
3484
|
+
for (; (v = c.read()) != null; ) {
|
|
3479
3485
|
l++;
|
|
3480
|
-
const y =
|
|
3481
|
-
a != null && (
|
|
3486
|
+
const y = v.length;
|
|
3487
|
+
a != null && (h += Math.abs(y - a)), a = y, f += y, m.push(v);
|
|
3482
3488
|
}
|
|
3483
|
-
}),
|
|
3484
|
-
const
|
|
3485
|
-
(!i ||
|
|
3486
|
-
}),
|
|
3489
|
+
}), c.on("error", () => d()), c.on("end", () => {
|
|
3490
|
+
const v = f / l;
|
|
3491
|
+
(!i || h <= i) && (!n || v > n) && (r = s, n = v, i = h, o = [...m]), d();
|
|
3492
|
+
}), c.write(t), c.end();
|
|
3487
3493
|
} catch {
|
|
3488
|
-
|
|
3494
|
+
d();
|
|
3489
3495
|
}
|
|
3490
3496
|
});
|
|
3491
3497
|
} catch {
|
|
3492
3498
|
}
|
|
3493
|
-
return {
|
|
3499
|
+
return { parsingRecords: o, valueDelimiterId: r ?? "," };
|
|
3494
3500
|
}
|
|
3495
3501
|
function ei(t) {
|
|
3496
3502
|
const e = Math.max(1, Math.floor(t.chunkSize)), r = [];
|