@datapos/datapos-tool-csv-parse 0.0.58 → 0.0.60
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 +351 -349
- package/package.json +1 -1
|
@@ -30,28 +30,28 @@ function He(t) {
|
|
|
30
30
|
o.push(Xt(t, f, f + s > u ? u : 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, u = (1 << f) - 1, l = u >> 1, h = -7, c = r ? i - 1 : 0,
|
|
35
|
-
for (c +=
|
|
33
|
+
function ve(t, e, r, n, i) {
|
|
34
|
+
var o, s, f = i * 8 - n - 1, u = (1 << f) - 1, l = u >> 1, h = -7, c = r ? i - 1 : 0, g = r ? -1 : 1, y = t[e + c];
|
|
35
|
+
for (c += g, o = y & (1 << -h) - 1, y >>= -h, h += f; h > 0; o = o * 256 + t[e + c], c += g, h -= 8)
|
|
36
36
|
;
|
|
37
|
-
for (s = o & (1 << -h) - 1, o >>= -h, h += n; h > 0; s = s * 256 + t[e + c], c +=
|
|
37
|
+
for (s = o & (1 << -h) - 1, o >>= -h, h += n; h > 0; s = s * 256 + t[e + c], c += g, h -= 8)
|
|
38
38
|
;
|
|
39
39
|
if (o === 0)
|
|
40
40
|
o = 1 - l;
|
|
41
41
|
else {
|
|
42
42
|
if (o === u)
|
|
43
|
-
return s ? NaN : (
|
|
43
|
+
return s ? NaN : (y ? -1 : 1) * (1 / 0);
|
|
44
44
|
s = s + Math.pow(2, n), o = o - l;
|
|
45
45
|
}
|
|
46
|
-
return (
|
|
46
|
+
return (y ? -1 : 1) * s * Math.pow(2, o - n);
|
|
47
47
|
}
|
|
48
48
|
function ht(t, e, r, n, i, o) {
|
|
49
|
-
var s, f, u, l = o * 8 - i - 1, h = (1 << l) - 1, c = h >> 1,
|
|
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 * (u = Math.pow(2, -s)) < 1 && (s--, u *= 2), s + c >= 1 ? e +=
|
|
49
|
+
var s, f, u, l = o * 8 - i - 1, h = (1 << l) - 1, c = h >> 1, g = i === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, y = n ? 0 : o - 1, C = n ? 1 : -1, E = e < 0 || e === 0 && 1 / e < 0 ? 1 : 0;
|
|
50
|
+
for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (f = isNaN(e) ? 1 : 0, s = h) : (s = Math.floor(Math.log(e) / Math.LN2), e * (u = Math.pow(2, -s)) < 1 && (s--, u *= 2), s + c >= 1 ? e += g / u : e += g * Math.pow(2, 1 - c), e * u >= 2 && (s++, u /= 2), s + c >= h ? (f = 0, s = h) : s + c >= 1 ? (f = (e * u - 1) * Math.pow(2, i), s = s + c) : (f = e * Math.pow(2, c - 1) * Math.pow(2, i), s = 0)); i >= 8; t[r + y] = f & 255, y += C, f /= 256, i -= 8)
|
|
51
51
|
;
|
|
52
|
-
for (s = s << i | f, l += i; l > 0; t[r +
|
|
52
|
+
for (s = s << i | f, l += i; l > 0; t[r + y] = s & 255, y += C, s /= 256, l -= 8)
|
|
53
53
|
;
|
|
54
|
-
t[r +
|
|
54
|
+
t[r + y - C] |= E * 128;
|
|
55
55
|
}
|
|
56
56
|
var Kt = {}.toString, ct = Array.isArray || function(t) {
|
|
57
57
|
return Kt.call(t) == "[object Array]";
|
|
@@ -348,8 +348,8 @@ function Ge(t, e, r, n, i) {
|
|
|
348
348
|
return -1;
|
|
349
349
|
o = 2, s /= 2, f /= 2, r /= 2;
|
|
350
350
|
}
|
|
351
|
-
function u(
|
|
352
|
-
return o === 1 ?
|
|
351
|
+
function u(y, C) {
|
|
352
|
+
return o === 1 ? y[C] : y.readUInt16BE(C * o);
|
|
353
353
|
}
|
|
354
354
|
var l;
|
|
355
355
|
if (i) {
|
|
@@ -361,8 +361,8 @@ function Ge(t, e, r, n, i) {
|
|
|
361
361
|
h !== -1 && (l -= l - h), h = -1;
|
|
362
362
|
} else
|
|
363
363
|
for (r + f > s && (r = s - f), l = r; l >= 0; l--) {
|
|
364
|
-
for (var c = !0,
|
|
365
|
-
if (u(t, l +
|
|
364
|
+
for (var c = !0, g = 0; g < f; g++)
|
|
365
|
+
if (u(t, l + g) !== u(e, g)) {
|
|
366
366
|
c = !1;
|
|
367
367
|
break;
|
|
368
368
|
}
|
|
@@ -397,7 +397,7 @@ function fr(t, e, r, n) {
|
|
|
397
397
|
return xe(we(e, t.length - r), t, r, n);
|
|
398
398
|
}
|
|
399
399
|
function _t(t, e, r, n) {
|
|
400
|
-
return xe(
|
|
400
|
+
return xe(br(e), t, r, n);
|
|
401
401
|
}
|
|
402
402
|
function ar(t, e, r, n) {
|
|
403
403
|
return _t(t, e, r, n);
|
|
@@ -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 mr(t, e, r) {
|
|
@@ -532,79 +532,79 @@ a.prototype.slice = function(e, r) {
|
|
|
532
532
|
}
|
|
533
533
|
return i;
|
|
534
534
|
};
|
|
535
|
-
function
|
|
535
|
+
function T(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
|
a.prototype.readUIntLE = function(e, r, n) {
|
|
540
|
-
e = e | 0, r = r | 0, n ||
|
|
540
|
+
e = e | 0, r = r | 0, n || T(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
|
a.prototype.readUIntBE = function(e, r, n) {
|
|
546
|
-
e = e | 0, r = r | 0, n ||
|
|
546
|
+
e = e | 0, r = r | 0, n || T(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
|
a.prototype.readUInt8 = function(e, r) {
|
|
552
|
-
return r ||
|
|
552
|
+
return r || T(e, 1, this.length), this[e];
|
|
553
553
|
};
|
|
554
554
|
a.prototype.readUInt16LE = function(e, r) {
|
|
555
|
-
return r ||
|
|
555
|
+
return r || T(e, 2, this.length), this[e] | this[e + 1] << 8;
|
|
556
556
|
};
|
|
557
557
|
a.prototype.readUInt16BE = function(e, r) {
|
|
558
|
-
return r ||
|
|
558
|
+
return r || T(e, 2, this.length), this[e] << 8 | this[e + 1];
|
|
559
559
|
};
|
|
560
560
|
a.prototype.readUInt32LE = function(e, r) {
|
|
561
|
-
return r ||
|
|
561
|
+
return r || T(e, 4, this.length), (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + this[e + 3] * 16777216;
|
|
562
562
|
};
|
|
563
563
|
a.prototype.readUInt32BE = function(e, r) {
|
|
564
|
-
return r ||
|
|
564
|
+
return r || T(e, 4, this.length), this[e] * 16777216 + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]);
|
|
565
565
|
};
|
|
566
566
|
a.prototype.readIntLE = function(e, r, n) {
|
|
567
|
-
e = e | 0, r = r | 0, n ||
|
|
567
|
+
e = e | 0, r = r | 0, n || T(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
|
a.prototype.readIntBE = function(e, r, n) {
|
|
573
|
-
e = e | 0, r = r | 0, n ||
|
|
573
|
+
e = e | 0, r = r | 0, n || T(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
|
a.prototype.readInt8 = function(e, r) {
|
|
579
|
-
return r ||
|
|
579
|
+
return r || T(e, 1, this.length), this[e] & 128 ? (255 - this[e] + 1) * -1 : this[e];
|
|
580
580
|
};
|
|
581
581
|
a.prototype.readInt16LE = function(e, r) {
|
|
582
|
-
r ||
|
|
582
|
+
r || T(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
|
a.prototype.readInt16BE = function(e, r) {
|
|
587
|
-
r ||
|
|
587
|
+
r || T(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
|
a.prototype.readInt32LE = function(e, r) {
|
|
592
|
-
return r ||
|
|
592
|
+
return r || T(e, 4, this.length), this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24;
|
|
593
593
|
};
|
|
594
594
|
a.prototype.readInt32BE = function(e, r) {
|
|
595
|
-
return r ||
|
|
595
|
+
return r || T(e, 4, this.length), this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3];
|
|
596
596
|
};
|
|
597
597
|
a.prototype.readFloatLE = function(e, r) {
|
|
598
|
-
return r ||
|
|
598
|
+
return r || T(e, 4, this.length), ve(this, e, !0, 23, 4);
|
|
599
599
|
};
|
|
600
600
|
a.prototype.readFloatBE = function(e, r) {
|
|
601
|
-
return r ||
|
|
601
|
+
return r || T(e, 4, this.length), ve(this, e, !1, 23, 4);
|
|
602
602
|
};
|
|
603
603
|
a.prototype.readDoubleLE = function(e, r) {
|
|
604
|
-
return r ||
|
|
604
|
+
return r || T(e, 8, this.length), ve(this, e, !0, 52, 8);
|
|
605
605
|
};
|
|
606
606
|
a.prototype.readDoubleBE = function(e, r) {
|
|
607
|
-
return r ||
|
|
607
|
+
return r || T(e, 8, this.length), ve(this, e, !1, 52, 8);
|
|
608
608
|
};
|
|
609
609
|
function D(t, e, r, n, i, o) {
|
|
610
610
|
if (!$(t)) throw new TypeError('"buffer" argument must be a Buffer instance');
|
|
@@ -634,16 +634,16 @@ a.prototype.writeUIntBE = function(e, r, n, i) {
|
|
|
634
634
|
a.prototype.writeUInt8 = function(e, r, n) {
|
|
635
635
|
return e = +e, r = r | 0, n || D(this, e, r, 1, 255, 0), a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)), this[r] = e & 255, r + 1;
|
|
636
636
|
};
|
|
637
|
-
function
|
|
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
642
|
a.prototype.writeUInt16LE = function(e, r, n) {
|
|
643
|
-
return e = +e, r = r | 0, n || D(this, e, r, 2, 65535, 0), a.TYPED_ARRAY_SUPPORT ? (this[r] = e & 255, this[r + 1] = e >>> 8) :
|
|
643
|
+
return e = +e, r = r | 0, n || D(this, e, r, 2, 65535, 0), a.TYPED_ARRAY_SUPPORT ? (this[r] = e & 255, this[r + 1] = e >>> 8) : be(this, e, r, !0), r + 2;
|
|
644
644
|
};
|
|
645
645
|
a.prototype.writeUInt16BE = function(e, r, n) {
|
|
646
|
-
return e = +e, r = r | 0, n || D(this, e, r, 2, 65535, 0), a.TYPED_ARRAY_SUPPORT ? (this[r] = e >>> 8, this[r + 1] = e & 255) :
|
|
646
|
+
return e = +e, r = r | 0, n || D(this, e, r, 2, 65535, 0), a.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);
|
|
@@ -680,10 +680,10 @@ a.prototype.writeInt8 = function(e, r, n) {
|
|
|
680
680
|
return e = +e, r = r | 0, n || D(this, e, r, 1, 127, -128), a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)), e < 0 && (e = 255 + e + 1), this[r] = e & 255, r + 1;
|
|
681
681
|
};
|
|
682
682
|
a.prototype.writeInt16LE = function(e, r, n) {
|
|
683
|
-
return e = +e, r = r | 0, n || D(this, e, r, 2, 32767, -32768), a.TYPED_ARRAY_SUPPORT ? (this[r] = e & 255, this[r + 1] = e >>> 8) :
|
|
683
|
+
return e = +e, r = r | 0, n || D(this, e, r, 2, 32767, -32768), a.TYPED_ARRAY_SUPPORT ? (this[r] = e & 255, this[r + 1] = e >>> 8) : be(this, e, r, !0), r + 2;
|
|
684
684
|
};
|
|
685
685
|
a.prototype.writeInt16BE = function(e, r, n) {
|
|
686
|
-
return e = +e, r = r | 0, n || D(this, e, r, 2, 32767, -32768), a.TYPED_ARRAY_SUPPORT ? (this[r] = e >>> 8, this[r + 1] = e & 255) :
|
|
686
|
+
return e = +e, r = r | 0, n || D(this, e, r, 2, 32767, -32768), a.TYPED_ARRAY_SUPPORT ? (this[r] = e >>> 8, this[r + 1] = e & 255) : be(this, e, r, !1), r + 2;
|
|
687
687
|
};
|
|
688
688
|
a.prototype.writeInt32LE = function(e, r, n) {
|
|
689
689
|
return e = +e, r = r | 0, n || D(this, e, r, 4, 2147483647, -2147483648), a.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;
|
|
@@ -695,23 +695,23 @@ function yt(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
|
|
698
|
+
function vt(t, e, r, n, i) {
|
|
699
699
|
return i || yt(t, e, r, 4), ht(t, e, r, n, 23, 4), r + 4;
|
|
700
700
|
}
|
|
701
701
|
a.prototype.writeFloatLE = function(e, r, n) {
|
|
702
|
-
return
|
|
702
|
+
return vt(this, e, r, !0, n);
|
|
703
703
|
};
|
|
704
704
|
a.prototype.writeFloatBE = function(e, r, n) {
|
|
705
|
-
return
|
|
705
|
+
return vt(this, e, r, !1, n);
|
|
706
706
|
};
|
|
707
|
-
function
|
|
707
|
+
function bt(t, e, r, n, i) {
|
|
708
708
|
return i || yt(t, e, r, 8), ht(t, e, r, n, 52, 8), r + 8;
|
|
709
709
|
}
|
|
710
710
|
a.prototype.writeDoubleLE = function(e, r, n) {
|
|
711
|
-
return
|
|
711
|
+
return bt(this, e, r, !0, n);
|
|
712
712
|
};
|
|
713
713
|
a.prototype.writeDoubleBE = function(e, r, n) {
|
|
714
|
-
return
|
|
714
|
+
return bt(this, e, r, !1, n);
|
|
715
715
|
};
|
|
716
716
|
a.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;
|
|
@@ -772,7 +772,7 @@ function wr(t) {
|
|
|
772
772
|
function yr(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) {
|
|
@@ -825,7 +825,7 @@ function we(t, e) {
|
|
|
825
825
|
}
|
|
826
826
|
return o;
|
|
827
827
|
}
|
|
828
|
-
function
|
|
828
|
+
function br(t) {
|
|
829
829
|
for (var e = [], r = 0; r < t.length; ++r)
|
|
830
830
|
e.push(t.charCodeAt(r) & 255);
|
|
831
831
|
return e;
|
|
@@ -859,27 +859,27 @@ var Oe;
|
|
|
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 p() {
|
|
863
|
+
p.init.call(this);
|
|
864
|
+
}
|
|
865
|
+
p.EventEmitter = p;
|
|
866
|
+
p.usingDomains = !1;
|
|
867
|
+
p.prototype.domain = void 0;
|
|
868
|
+
p.prototype._events = void 0;
|
|
869
|
+
p.prototype._maxListeners = void 0;
|
|
870
|
+
p.defaultMaxListeners = 10;
|
|
871
|
+
p.init = function() {
|
|
872
|
+
this.domain = null, p.usingDomains && Oe.active && !(this instanceof Oe.Domain) && (this.domain = Oe.active), (!this._events || this._events === Object.getPrototypeOf(this)._events) && (this._events = new H(), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;
|
|
873
|
+
};
|
|
874
|
+
p.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 St(t) {
|
|
880
|
-
return t._maxListeners === void 0 ?
|
|
880
|
+
return t._maxListeners === void 0 ? p.defaultMaxListeners : t._maxListeners;
|
|
881
881
|
}
|
|
882
|
-
|
|
882
|
+
p.prototype.getMaxListeners = function() {
|
|
883
883
|
return St(this);
|
|
884
884
|
};
|
|
885
885
|
function Rr(t, e, r) {
|
|
@@ -903,21 +903,21 @@ function Or(t, e, r, n, i) {
|
|
|
903
903
|
for (var o = t.length, s = ae(t, o), f = 0; f < o; ++f)
|
|
904
904
|
s[f].call(r, n, i);
|
|
905
905
|
}
|
|
906
|
-
function
|
|
906
|
+
function Cr(t, e, r, n, i, o) {
|
|
907
907
|
if (e)
|
|
908
908
|
t.call(r, n, i, o);
|
|
909
909
|
else
|
|
910
910
|
for (var s = t.length, f = ae(t, s), u = 0; u < s; ++u)
|
|
911
911
|
f[u].call(r, n, i, o);
|
|
912
912
|
}
|
|
913
|
-
function
|
|
913
|
+
function Ar(t, e, r, n) {
|
|
914
914
|
if (e)
|
|
915
915
|
t.apply(r, n);
|
|
916
916
|
else
|
|
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
|
-
|
|
920
|
+
p.prototype.emit = function(e) {
|
|
921
921
|
var r, n, i, o, s, f, u, l = e === "error";
|
|
922
922
|
if (f = this._events, f)
|
|
923
923
|
l = l && f.error == null;
|
|
@@ -949,13 +949,13 @@ m.prototype.emit = function(e) {
|
|
|
949
949
|
Or(n, c, this, arguments[1], arguments[2]);
|
|
950
950
|
break;
|
|
951
951
|
case 4:
|
|
952
|
-
|
|
952
|
+
Cr(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
|
+
Ar(n, c, this, o);
|
|
959
959
|
}
|
|
960
960
|
return !0;
|
|
961
961
|
};
|
|
@@ -979,11 +979,11 @@ function Rt(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
|
+
p.prototype.addListener = function(e, r) {
|
|
983
983
|
return Rt(this, e, r, !1);
|
|
984
984
|
};
|
|
985
|
-
|
|
986
|
-
|
|
985
|
+
p.prototype.on = p.prototype.addListener;
|
|
986
|
+
p.prototype.prependListener = function(e, r) {
|
|
987
987
|
return Rt(this, e, r, !0);
|
|
988
988
|
};
|
|
989
989
|
function It(t, e, r) {
|
|
@@ -993,17 +993,17 @@ function It(t, e, r) {
|
|
|
993
993
|
}
|
|
994
994
|
return i.listener = r, i;
|
|
995
995
|
}
|
|
996
|
-
|
|
996
|
+
p.prototype.once = function(e, r) {
|
|
997
997
|
if (typeof r != "function")
|
|
998
998
|
throw new TypeError('"listener" argument must be a function');
|
|
999
999
|
return this.on(e, It(this, e, r)), this;
|
|
1000
1000
|
};
|
|
1001
|
-
|
|
1001
|
+
p.prototype.prependOnceListener = function(e, r) {
|
|
1002
1002
|
if (typeof r != "function")
|
|
1003
1003
|
throw new TypeError('"listener" argument must be a function');
|
|
1004
1004
|
return this.prependListener(e, It(this, e, r)), this;
|
|
1005
1005
|
};
|
|
1006
|
-
|
|
1006
|
+
p.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 @@ m.prototype.removeListener = function(e, r) {
|
|
|
1031
1031
|
}
|
|
1032
1032
|
return this;
|
|
1033
1033
|
};
|
|
1034
|
-
|
|
1034
|
+
p.prototype.removeAllListeners = function(e) {
|
|
1035
1035
|
var r, n;
|
|
1036
1036
|
if (n = this._events, !n)
|
|
1037
1037
|
return this;
|
|
@@ -1050,14 +1050,14 @@ m.prototype.removeAllListeners = function(e) {
|
|
|
1050
1050
|
while (r[0]);
|
|
1051
1051
|
return this;
|
|
1052
1052
|
};
|
|
1053
|
-
|
|
1053
|
+
p.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
|
+
p.listenerCount = function(t, e) {
|
|
1058
1058
|
return typeof t.listenerCount == "function" ? t.listenerCount(e) : Ot.call(t, e);
|
|
1059
1059
|
};
|
|
1060
|
-
|
|
1060
|
+
p.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
|
+
p.prototype.eventNames = function() {
|
|
1073
1073
|
return this._eventsCount > 0 ? Reflect.ownKeys(this._events) : [];
|
|
1074
1074
|
};
|
|
1075
1075
|
function Lr(t, e) {
|
|
@@ -1087,19 +1087,19 @@ function Nr(t) {
|
|
|
1087
1087
|
e[r] = t[r].listener || t[r];
|
|
1088
1088
|
return e;
|
|
1089
1089
|
}
|
|
1090
|
-
function
|
|
1090
|
+
function Ct() {
|
|
1091
1091
|
throw new Error("setTimeout has not been defined");
|
|
1092
1092
|
}
|
|
1093
|
-
function
|
|
1093
|
+
function At() {
|
|
1094
1094
|
throw new Error("clearTimeout has not been defined");
|
|
1095
1095
|
}
|
|
1096
|
-
var Y =
|
|
1096
|
+
var Y = Ct, W = At;
|
|
1097
1097
|
typeof ie.setTimeout == "function" && (Y = setTimeout);
|
|
1098
1098
|
typeof ie.clearTimeout == "function" && (W = clearTimeout);
|
|
1099
1099
|
function Tt(t) {
|
|
1100
1100
|
if (Y === setTimeout)
|
|
1101
1101
|
return setTimeout(t, 0);
|
|
1102
|
-
if ((Y ===
|
|
1102
|
+
if ((Y === Ct || !Y) && setTimeout)
|
|
1103
1103
|
return Y = setTimeout, setTimeout(t, 0);
|
|
1104
1104
|
try {
|
|
1105
1105
|
return Y(t, 0);
|
|
@@ -1114,7 +1114,7 @@ function Tt(t) {
|
|
|
1114
1114
|
function Dr(t) {
|
|
1115
1115
|
if (W === clearTimeout)
|
|
1116
1116
|
return clearTimeout(t);
|
|
1117
|
-
if ((W ===
|
|
1117
|
+
if ((W === At || !W) && clearTimeout)
|
|
1118
1118
|
return W = clearTimeout, clearTimeout(t);
|
|
1119
1119
|
try {
|
|
1120
1120
|
return W(t);
|
|
@@ -1221,10 +1221,10 @@ function Dt(t, e) {
|
|
|
1221
1221
|
}
|
|
1222
1222
|
return n;
|
|
1223
1223
|
}
|
|
1224
|
-
var pe = {},
|
|
1224
|
+
var pe = {}, Ce;
|
|
1225
1225
|
function kr(t) {
|
|
1226
|
-
if (Q(
|
|
1227
|
-
if (new RegExp("\\b" + t + "\\b", "i").test(
|
|
1226
|
+
if (Q(Ce) && (Ce = me.env.NODE_DEBUG || ""), t = t.toUpperCase(), !pe[t])
|
|
1227
|
+
if (new RegExp("\\b" + t + "\\b", "i").test(Ce)) {
|
|
1228
1228
|
var e = 0;
|
|
1229
1229
|
pe[t] = function() {
|
|
1230
1230
|
var r = Ur.apply(null, arguments);
|
|
@@ -1293,7 +1293,7 @@ function ye(t, e, r) {
|
|
|
1293
1293
|
return i;
|
|
1294
1294
|
var o = Object.keys(e), s = jr(o);
|
|
1295
1295
|
if (t.showHidden && (o = Object.getOwnPropertyNames(e)), Le(e) && (o.indexOf("message") >= 0 || o.indexOf("description") >= 0))
|
|
1296
|
-
return
|
|
1296
|
+
return Ae(e);
|
|
1297
1297
|
if (o.length === 0) {
|
|
1298
1298
|
if (Ne(e)) {
|
|
1299
1299
|
var f = e.name ? ": " + e.name : "";
|
|
@@ -1304,22 +1304,22 @@ function ye(t, e, r) {
|
|
|
1304
1304
|
if (Xe(e))
|
|
1305
1305
|
return t.stylize(Date.prototype.toString.call(e), "date");
|
|
1306
1306
|
if (Le(e))
|
|
1307
|
-
return
|
|
1307
|
+
return Ae(e);
|
|
1308
1308
|
}
|
|
1309
1309
|
var u = "", l = !1, h = ["{", "}"];
|
|
1310
1310
|
if (Jr(e) && (l = !0, h = ["[", "]"]), Ne(e)) {
|
|
1311
1311
|
var c = e.name ? ": " + e.name : "";
|
|
1312
1312
|
u = " [Function" + c + "]";
|
|
1313
1313
|
}
|
|
1314
|
-
if (Te(e) && (u = " " + RegExp.prototype.toString.call(e)), Xe(e) && (u = " " + Date.prototype.toUTCString.call(e)), Le(e) && (u = " " +
|
|
1314
|
+
if (Te(e) && (u = " " + RegExp.prototype.toString.call(e)), Xe(e) && (u = " " + Date.prototype.toUTCString.call(e)), Le(e) && (u = " " + Ae(e)), o.length === 0 && (!l || e.length == 0))
|
|
1315
1315
|
return h[0] + u + h[1];
|
|
1316
1316
|
if (r < 0)
|
|
1317
1317
|
return Te(e) ? t.stylize(RegExp.prototype.toString.call(e), "regexp") : t.stylize("[Object]", "special");
|
|
1318
1318
|
t.seen.push(e);
|
|
1319
|
-
var
|
|
1320
|
-
return l ?
|
|
1321
|
-
return ke(t, e, r, s,
|
|
1322
|
-
}), t.seen.pop(), Vr(
|
|
1319
|
+
var g;
|
|
1320
|
+
return l ? g = zr(t, e, r, s, o) : g = o.map(function(y) {
|
|
1321
|
+
return ke(t, e, r, s, y, l);
|
|
1322
|
+
}), t.seen.pop(), Vr(g, u, h);
|
|
1323
1323
|
}
|
|
1324
1324
|
function qr(t, e) {
|
|
1325
1325
|
if (Q(e))
|
|
@@ -1335,7 +1335,7 @@ function qr(t, e) {
|
|
|
1335
1335
|
if (ze(e))
|
|
1336
1336
|
return t.stylize("null", "null");
|
|
1337
1337
|
}
|
|
1338
|
-
function
|
|
1338
|
+
function Ae(t) {
|
|
1339
1339
|
return "[" + Error.prototype.toString.call(t) + "]";
|
|
1340
1340
|
}
|
|
1341
1341
|
function zr(t, e, r, n, i) {
|
|
@@ -1565,9 +1565,9 @@ function Zr(t) {
|
|
|
1565
1565
|
function Xr(t) {
|
|
1566
1566
|
this.charReceived = t.length % 3, this.charLength = this.charReceived ? 3 : 0;
|
|
1567
1567
|
}
|
|
1568
|
-
|
|
1569
|
-
var
|
|
1570
|
-
oe(
|
|
1568
|
+
I.ReadableState = Bt;
|
|
1569
|
+
var b = kr("stream");
|
|
1570
|
+
oe(I, p);
|
|
1571
1571
|
function Kr(t, e, r) {
|
|
1572
1572
|
if (typeof t.prependListener == "function")
|
|
1573
1573
|
return t.prependListener(e, r);
|
|
@@ -1581,19 +1581,19 @@ function Bt(t, e) {
|
|
|
1581
1581
|
var r = t.highWaterMark, n = this.objectMode ? 16 : 16 * 1024;
|
|
1582
1582
|
this.highWaterMark = r || r === 0 ? r : n, this.highWaterMark = ~~this.highWaterMark, this.buffer = new te(), this.length = 0, this.pipes = null, this.pipesCount = 0, this.flowing = null, this.ended = !1, this.endEmitted = !1, this.reading = !1, this.sync = !0, this.needReadable = !1, this.emittedReadable = !1, this.readableListening = !1, this.resumeScheduled = !1, this.defaultEncoding = t.defaultEncoding || "utf8", this.ranOut = !1, this.awaitDrain = 0, this.readingMore = !1, this.decoder = null, this.encoding = null, t.encoding && (this.decoder = new le(t.encoding), this.encoding = t.encoding);
|
|
1583
1583
|
}
|
|
1584
|
-
function
|
|
1585
|
-
if (!(this instanceof
|
|
1586
|
-
this._readableState = new Bt(t, this), this.readable = !0, t && typeof t.read == "function" && (this._read = t.read),
|
|
1584
|
+
function I(t) {
|
|
1585
|
+
if (!(this instanceof I)) return new I(t);
|
|
1586
|
+
this._readableState = new Bt(t, this), this.readable = !0, t && typeof t.read == "function" && (this._read = t.read), p.call(this);
|
|
1587
1587
|
}
|
|
1588
|
-
|
|
1588
|
+
I.prototype.push = function(t, e) {
|
|
1589
1589
|
var r = this._readableState;
|
|
1590
1590
|
return !r.objectMode && typeof t == "string" && (e = e || r.defaultEncoding, e !== r.encoding && (t = a.from(t, e), e = "")), Ut(this, r, t, e, !1);
|
|
1591
1591
|
};
|
|
1592
|
-
|
|
1592
|
+
I.prototype.unshift = function(t) {
|
|
1593
1593
|
var e = this._readableState;
|
|
1594
1594
|
return Ut(this, e, t, "", !0);
|
|
1595
1595
|
};
|
|
1596
|
-
|
|
1596
|
+
I.prototype.isPaused = function() {
|
|
1597
1597
|
return this._readableState.flowing === !1;
|
|
1598
1598
|
};
|
|
1599
1599
|
function Ut(t, e, r, n, i) {
|
|
@@ -1619,7 +1619,7 @@ function Ut(t, e, r, n, i) {
|
|
|
1619
1619
|
function tn(t) {
|
|
1620
1620
|
return !t.ended && (t.needReadable || t.length < t.highWaterMark || t.length === 0);
|
|
1621
1621
|
}
|
|
1622
|
-
|
|
1622
|
+
I.prototype.setEncoding = function(t) {
|
|
1623
1623
|
return this._readableState.decoder = new le(t), this._readableState.encoding = t, this;
|
|
1624
1624
|
};
|
|
1625
1625
|
var Ke = 8388608;
|
|
@@ -1629,15 +1629,15 @@ function rn(t) {
|
|
|
1629
1629
|
function et(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 = rn(t)), t <= e.length ? t : e.ended ? e.length : (e.needReadable = !0, 0));
|
|
1631
1631
|
}
|
|
1632
|
-
|
|
1633
|
-
|
|
1632
|
+
I.prototype.read = function(t) {
|
|
1633
|
+
b("read", t), t = parseInt(t, 10);
|
|
1634
1634
|
var e = this._readableState, r = t;
|
|
1635
1635
|
if (t !== 0 && (e.emittedReadable = !1), t === 0 && e.needReadable && (e.length >= e.highWaterMark || e.ended))
|
|
1636
|
-
return
|
|
1636
|
+
return b("read: emitReadable", e.length, e.ended), e.length === 0 && e.ended ? De(this) : Se(this), null;
|
|
1637
1637
|
if (t = et(t, e), t === 0 && e.ended)
|
|
1638
1638
|
return e.length === 0 && De(this), null;
|
|
1639
1639
|
var n = e.needReadable;
|
|
1640
|
-
|
|
1640
|
+
b("need readable", n), (e.length === 0 || e.length - t < e.highWaterMark) && (n = !0, b("length less than watermark", n)), e.ended || e.reading ? (n = !1, b("reading or ended", n)) : n && (b("do read"), e.reading = !0, e.sync = !0, e.length === 0 && (e.needReadable = !0), this._read(e.highWaterMark), e.sync = !1, e.reading || (t = et(r, e)));
|
|
1641
1641
|
var i;
|
|
1642
1642
|
return t > 0 ? i = kt(t, e) : i = null, i === null ? (e.needReadable = !0, t = 0) : e.length -= t, e.length === 0 && (e.ended || (e.needReadable = !0), r !== t && e.ended && De(this)), i !== null && this.emit("data", i), i;
|
|
1643
1643
|
};
|
|
@@ -1656,23 +1656,23 @@ function on(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 || (b("emitReadable", e.flowing), e.emittedReadable = !0, e.sync ? B(tt, t) : tt(t));
|
|
1660
1660
|
}
|
|
1661
1661
|
function tt(t) {
|
|
1662
|
-
|
|
1662
|
+
b("emit readable"), t.emit("readable"), Ye(t);
|
|
1663
1663
|
}
|
|
1664
1664
|
function sn(t, e) {
|
|
1665
1665
|
e.readingMore || (e.readingMore = !0, B(fn, t, e));
|
|
1666
1666
|
}
|
|
1667
1667
|
function fn(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 && (b("maybeReadMore read 0"), t.read(0), r !== e.length); )
|
|
1669
1669
|
r = e.length;
|
|
1670
1670
|
e.readingMore = !1;
|
|
1671
1671
|
}
|
|
1672
|
-
|
|
1672
|
+
I.prototype._read = function(t) {
|
|
1673
1673
|
this.emit("error", new Error("not implemented"));
|
|
1674
1674
|
};
|
|
1675
|
-
|
|
1675
|
+
I.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 @@ S.prototype.pipe = function(t, e) {
|
|
|
1685
1685
|
n.pipes.push(t);
|
|
1686
1686
|
break;
|
|
1687
1687
|
}
|
|
1688
|
-
n.pipesCount += 1,
|
|
1688
|
+
n.pipesCount += 1, b("pipe count=%d opts=%j", n.pipesCount, e);
|
|
1689
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(S) {
|
|
1692
|
+
b("onunpipe"), S === r && h();
|
|
1693
1693
|
}
|
|
1694
1694
|
function f() {
|
|
1695
|
-
|
|
1695
|
+
b("onend"), t.end();
|
|
1696
1696
|
}
|
|
1697
1697
|
var u = an(r);
|
|
1698
1698
|
t.on("drain", u);
|
|
1699
1699
|
var l = !1;
|
|
1700
1700
|
function h() {
|
|
1701
|
-
|
|
1701
|
+
b("cleanup"), t.removeListener("close", C), t.removeListener("finish", E), t.removeListener("drain", u), t.removeListener("error", y), t.removeListener("unpipe", s), r.removeListener("end", f), r.removeListener("end", h), r.removeListener("data", g), l = !0, n.awaitDrain && (!t._writableState || t._writableState.needDrain) && u();
|
|
1702
1702
|
}
|
|
1703
1703
|
var c = !1;
|
|
1704
|
-
r.on("data",
|
|
1705
|
-
function
|
|
1706
|
-
|
|
1707
|
-
var
|
|
1708
|
-
|
|
1704
|
+
r.on("data", g);
|
|
1705
|
+
function g(S) {
|
|
1706
|
+
b("ondata"), c = !1;
|
|
1707
|
+
var w = t.write(S);
|
|
1708
|
+
w === !1 && !c && ((n.pipesCount === 1 && n.pipes === t || n.pipesCount > 1 && Pt(n.pipes, t) !== -1) && !l && (b("false write response, pause", r._readableState.awaitDrain), r._readableState.awaitDrain++, c = !0), r.pause());
|
|
1709
1709
|
}
|
|
1710
|
-
function
|
|
1711
|
-
|
|
1710
|
+
function y(S) {
|
|
1711
|
+
b("onerror", S), x(), t.removeListener("error", y), en(t, "error") === 0 && t.emit("error", S);
|
|
1712
1712
|
}
|
|
1713
|
-
Kr(t, "error",
|
|
1714
|
-
function
|
|
1715
|
-
t.removeListener("finish",
|
|
1713
|
+
Kr(t, "error", y);
|
|
1714
|
+
function C() {
|
|
1715
|
+
t.removeListener("finish", E), x();
|
|
1716
1716
|
}
|
|
1717
|
-
t.once("close",
|
|
1718
|
-
function
|
|
1719
|
-
|
|
1717
|
+
t.once("close", C);
|
|
1718
|
+
function E() {
|
|
1719
|
+
b("onfinish"), t.removeListener("close", C), x();
|
|
1720
1720
|
}
|
|
1721
|
-
t.once("finish",
|
|
1722
|
-
function
|
|
1723
|
-
|
|
1721
|
+
t.once("finish", E);
|
|
1722
|
+
function x() {
|
|
1723
|
+
b("unpipe"), r.unpipe(t);
|
|
1724
1724
|
}
|
|
1725
|
-
return t.emit("pipe", r), n.flowing || (
|
|
1725
|
+
return t.emit("pipe", r), n.flowing || (b("pipe resume"), r.resume()), t;
|
|
1726
1726
|
};
|
|
1727
1727
|
function an(t) {
|
|
1728
1728
|
return function() {
|
|
1729
1729
|
var e = t._readableState;
|
|
1730
|
-
|
|
1730
|
+
b("pipeOnDrain", e.awaitDrain), e.awaitDrain && e.awaitDrain--, e.awaitDrain === 0 && t.listeners("data").length && (e.flowing = !0, Ye(t));
|
|
1731
1731
|
};
|
|
1732
1732
|
}
|
|
1733
|
-
|
|
1733
|
+
I.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,8 +1745,8 @@ S.prototype.unpipe = function(t) {
|
|
|
1745
1745
|
var o = Pt(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
|
+
I.prototype.on = function(t, e) {
|
|
1749
|
+
var r = p.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") {
|
|
@@ -1755,38 +1755,38 @@ S.prototype.on = function(t, e) {
|
|
|
1755
1755
|
}
|
|
1756
1756
|
return r;
|
|
1757
1757
|
};
|
|
1758
|
-
|
|
1758
|
+
I.prototype.addListener = I.prototype.on;
|
|
1759
1759
|
function un(t) {
|
|
1760
|
-
|
|
1760
|
+
b("readable nexttick read 0"), t.read(0);
|
|
1761
1761
|
}
|
|
1762
|
-
|
|
1762
|
+
I.prototype.resume = function() {
|
|
1763
1763
|
var t = this._readableState;
|
|
1764
|
-
return t.flowing || (
|
|
1764
|
+
return t.flowing || (b("resume"), t.flowing = !0, ln(this, t)), this;
|
|
1765
1765
|
};
|
|
1766
1766
|
function ln(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 || (b("resume read 0"), t.read(0)), e.resumeScheduled = !1, e.awaitDrain = 0, t.emit("resume"), Ye(t), e.flowing && !e.reading && t.read(0);
|
|
1771
1771
|
}
|
|
1772
|
-
|
|
1773
|
-
return
|
|
1772
|
+
I.prototype.pause = function() {
|
|
1773
|
+
return b("call pause flowing=%j", this._readableState.flowing), this._readableState.flowing !== !1 && (b("pause"), this._readableState.flowing = !1, this.emit("pause")), this;
|
|
1774
1774
|
};
|
|
1775
1775
|
function Ye(t) {
|
|
1776
1776
|
var e = t._readableState;
|
|
1777
|
-
for (
|
|
1777
|
+
for (b("flow", e.flowing); e.flowing && t.read() !== null; )
|
|
1778
1778
|
;
|
|
1779
1779
|
}
|
|
1780
|
-
|
|
1780
|
+
I.prototype.wrap = function(t) {
|
|
1781
1781
|
var e = this._readableState, r = !1, n = this;
|
|
1782
1782
|
t.on("end", function() {
|
|
1783
|
-
if (
|
|
1783
|
+
if (b("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 (b("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 @@ S.prototype.wrap = function(t) {
|
|
|
1801
1801
|
return mn(o, function(s) {
|
|
1802
1802
|
t.on(s, n.emit.bind(n, s));
|
|
1803
1803
|
}), n._read = function(s) {
|
|
1804
|
-
|
|
1804
|
+
b("wrapped _read", s), r && (r = !1, t.resume());
|
|
1805
1805
|
}, n;
|
|
1806
1806
|
};
|
|
1807
|
-
|
|
1807
|
+
I._fromList = kt;
|
|
1808
1808
|
function kt(t, e) {
|
|
1809
1809
|
if (e.length === 0) return null;
|
|
1810
1810
|
var r;
|
|
@@ -1855,8 +1855,8 @@ function Pt(t, e) {
|
|
|
1855
1855
|
if (t[r] === e) return r;
|
|
1856
1856
|
return -1;
|
|
1857
1857
|
}
|
|
1858
|
-
|
|
1859
|
-
oe(
|
|
1858
|
+
L.WritableState = We;
|
|
1859
|
+
oe(L, p);
|
|
1860
1860
|
function _n() {
|
|
1861
1861
|
}
|
|
1862
1862
|
function wn(t, e, r) {
|
|
@@ -1880,42 +1880,42 @@ We.prototype.getBuffer = function() {
|
|
|
1880
1880
|
r.push(e), e = e.next;
|
|
1881
1881
|
return r;
|
|
1882
1882
|
};
|
|
1883
|
-
function
|
|
1884
|
-
if (!(this instanceof
|
|
1885
|
-
this._writableState = new We(t, this), this.writable = !0, t && (typeof t.write == "function" && (this._write = t.write), typeof t.writev == "function" && (this._writev = t.writev)),
|
|
1883
|
+
function L(t) {
|
|
1884
|
+
if (!(this instanceof L) && !(this instanceof M)) return new L(t);
|
|
1885
|
+
this._writableState = new We(t, this), this.writable = !0, t && (typeof t.write == "function" && (this._write = t.write), typeof t.writev == "function" && (this._writev = t.writev)), p.call(this);
|
|
1886
1886
|
}
|
|
1887
|
-
|
|
1887
|
+
L.prototype.pipe = function() {
|
|
1888
1888
|
this.emit("error", new Error("Cannot pipe, not readable"));
|
|
1889
1889
|
};
|
|
1890
1890
|
function yn(t, e) {
|
|
1891
1891
|
var r = new Error("write after end");
|
|
1892
1892
|
t.emit("error", r), B(e, r);
|
|
1893
1893
|
}
|
|
1894
|
-
function
|
|
1894
|
+
function 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") : !a.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
|
+
L.prototype.write = function(t, e, r) {
|
|
1899
1899
|
var n = this._writableState, i = !1;
|
|
1900
|
-
return typeof e == "function" && (r = e, e = null), a.isBuffer(t) ? e = "buffer" : e || (e = n.defaultEncoding), typeof r != "function" && (r = _n), n.ended ? yn(this, r) :
|
|
1900
|
+
return typeof e == "function" && (r = e, e = null), a.isBuffer(t) ? e = "buffer" : e || (e = n.defaultEncoding), typeof r != "function" && (r = _n), n.ended ? yn(this, r) : vn(this, n, t, r) && (n.pendingcb++, i = En(this, n, t, e, r)), i;
|
|
1901
1901
|
};
|
|
1902
|
-
|
|
1902
|
+
L.prototype.cork = function() {
|
|
1903
1903
|
var t = this._writableState;
|
|
1904
1904
|
t.corked++;
|
|
1905
1905
|
};
|
|
1906
|
-
|
|
1906
|
+
L.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 && $t(this, t));
|
|
1909
1909
|
};
|
|
1910
|
-
|
|
1910
|
+
L.prototype.setDefaultEncoding = function(e) {
|
|
1911
1911
|
if (typeof e == "string" && (e = e.toLowerCase()), !(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((e + "").toLowerCase()) > -1)) throw new TypeError("Unknown encoding: " + e);
|
|
1912
1912
|
return this._writableState.defaultEncoding = e, this;
|
|
1913
1913
|
};
|
|
1914
|
-
function
|
|
1914
|
+
function bn(t, e, r) {
|
|
1915
1915
|
return !t.objectMode && t.decodeStrings !== !1 && typeof e == "string" && (e = a.from(e, r)), e;
|
|
1916
1916
|
}
|
|
1917
1917
|
function En(t, e, r, n, i) {
|
|
1918
|
-
r =
|
|
1918
|
+
r = bn(e, r, n), a.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;
|
|
@@ -1968,11 +1968,11 @@ function $t(t, e) {
|
|
|
1968
1968
|
}
|
|
1969
1969
|
e.bufferedRequestCount = 0, e.bufferedRequest = r, e.bufferProcessing = !1;
|
|
1970
1970
|
}
|
|
1971
|
-
|
|
1971
|
+
L.prototype._write = function(t, e, r) {
|
|
1972
1972
|
r(new Error("not implemented"));
|
|
1973
1973
|
};
|
|
1974
|
-
|
|
1975
|
-
|
|
1974
|
+
L.prototype._writev = null;
|
|
1975
|
+
L.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
|
};
|
|
@@ -2000,20 +2000,20 @@ function zt(t) {
|
|
|
2000
2000
|
t.corkedRequestsFree ? t.corkedRequestsFree.next = e : t.corkedRequestsFree = e;
|
|
2001
2001
|
};
|
|
2002
2002
|
}
|
|
2003
|
-
oe(M,
|
|
2004
|
-
var it = Object.keys(
|
|
2003
|
+
oe(M, I);
|
|
2004
|
+
var it = Object.keys(L.prototype);
|
|
2005
2005
|
for (var Fe = 0; Fe < it.length; Fe++) {
|
|
2006
2006
|
var Me = it[Fe];
|
|
2007
|
-
M.prototype[Me] || (M.prototype[Me] =
|
|
2007
|
+
M.prototype[Me] || (M.prototype[Me] = L.prototype[Me]);
|
|
2008
2008
|
}
|
|
2009
2009
|
function M(t) {
|
|
2010
2010
|
if (!(this instanceof M)) return new M(t);
|
|
2011
|
-
|
|
2011
|
+
I.call(this, t), L.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", Cn);
|
|
2012
2012
|
}
|
|
2013
|
-
function
|
|
2014
|
-
this.allowHalfOpen || this._writableState.ended || B(
|
|
2013
|
+
function Cn() {
|
|
2014
|
+
this.allowHalfOpen || this._writableState.ended || B(An, this);
|
|
2015
2015
|
}
|
|
2016
|
-
function
|
|
2016
|
+
function An(t) {
|
|
2017
2017
|
t.end();
|
|
2018
2018
|
}
|
|
2019
2019
|
oe(k, M);
|
|
@@ -2073,15 +2073,15 @@ 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 =
|
|
2078
|
-
V.Writable =
|
|
2076
|
+
oe(V, p);
|
|
2077
|
+
V.Readable = I;
|
|
2078
|
+
V.Writable = L;
|
|
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
|
+
p.call(this);
|
|
2085
2085
|
}
|
|
2086
2086
|
V.prototype.pipe = function(t, e) {
|
|
2087
2087
|
var r = this;
|
|
@@ -2101,7 +2101,7 @@ V.prototype.pipe = function(t, e) {
|
|
|
2101
2101
|
o || (o = !0, typeof t.destroy == "function" && t.destroy());
|
|
2102
2102
|
}
|
|
2103
2103
|
function u(h) {
|
|
2104
|
-
if (l(),
|
|
2104
|
+
if (l(), p.listenerCount(this, "error") === 0)
|
|
2105
2105
|
throw h;
|
|
2106
2106
|
}
|
|
2107
2107
|
r.on("error", u), t.on("error", u);
|
|
@@ -2113,9 +2113,9 @@ V.prototype.pipe = function(t, e) {
|
|
|
2113
2113
|
const Vt = function(t) {
|
|
2114
2114
|
return typeof t == "object" && t !== null && !Array.isArray(t);
|
|
2115
2115
|
};
|
|
2116
|
-
class
|
|
2116
|
+
class _ extends Error {
|
|
2117
2117
|
constructor(e, r, n, ...i) {
|
|
2118
|
-
Array.isArray(r) && (r = r.join(" ").trim()), super(r), Error.captureStackTrace !== void 0 && Error.captureStackTrace(this,
|
|
2118
|
+
Array.isArray(r) && (r = r.join(" ").trim()), super(r), Error.captureStackTrace !== void 0 && Error.captureStackTrace(this, _), this.code = e;
|
|
2119
2119
|
for (const o of i)
|
|
2120
2120
|
for (const s in o) {
|
|
2121
2121
|
const f = o[s];
|
|
@@ -2133,14 +2133,14 @@ const Jt = function(t) {
|
|
|
2133
2133
|
e[r] = { name: i };
|
|
2134
2134
|
else if (Vt(i)) {
|
|
2135
2135
|
if (typeof i.name != "string")
|
|
2136
|
-
throw new
|
|
2136
|
+
throw new _("CSV_OPTION_COLUMNS_MISSING_NAME", [
|
|
2137
2137
|
"Option columns missing name:",
|
|
2138
2138
|
`property "name" is required at position ${r}`,
|
|
2139
2139
|
"when column is an object literal"
|
|
2140
2140
|
]);
|
|
2141
2141
|
e[r] = i;
|
|
2142
2142
|
} else
|
|
2143
|
-
throw new
|
|
2143
|
+
throw new _("CSV_INVALID_COLUMN_DEFINITION", [
|
|
2144
2144
|
"Invalid column definition:",
|
|
2145
2145
|
"expect a string or a literal object,",
|
|
2146
2146
|
`got ${JSON.stringify(i)} at position ${r}`
|
|
@@ -2246,7 +2246,7 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2246
2246
|
else if (e.encoding === null || e.encoding === !1)
|
|
2247
2247
|
e.encoding = null;
|
|
2248
2248
|
else if (typeof e.encoding != "string" && e.encoding !== null)
|
|
2249
|
-
throw new
|
|
2249
|
+
throw new _(
|
|
2250
2250
|
"CSV_INVALID_OPTION_ENCODING",
|
|
2251
2251
|
[
|
|
2252
2252
|
"Invalid option encoding:",
|
|
@@ -2258,7 +2258,7 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2258
2258
|
if (e.bom === void 0 || e.bom === null || e.bom === !1)
|
|
2259
2259
|
e.bom = !1;
|
|
2260
2260
|
else if (e.bom !== !0)
|
|
2261
|
-
throw new
|
|
2261
|
+
throw new _(
|
|
2262
2262
|
"CSV_INVALID_OPTION_BOM",
|
|
2263
2263
|
[
|
|
2264
2264
|
"Invalid option bom:",
|
|
@@ -2272,7 +2272,7 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2272
2272
|
else if (typeof e.cast == "function")
|
|
2273
2273
|
e.cast_function = e.cast, e.cast = !0;
|
|
2274
2274
|
else if (e.cast !== !0)
|
|
2275
|
-
throw new
|
|
2275
|
+
throw new _(
|
|
2276
2276
|
"CSV_INVALID_OPTION_CAST",
|
|
2277
2277
|
[
|
|
2278
2278
|
"Invalid option cast:",
|
|
@@ -2289,7 +2289,7 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2289
2289
|
return isNaN(i) ? n : new Date(i);
|
|
2290
2290
|
};
|
|
2291
2291
|
else if (typeof e.cast_date != "function")
|
|
2292
|
-
throw new
|
|
2292
|
+
throw new _(
|
|
2293
2293
|
"CSV_INVALID_OPTION_CAST_DATE",
|
|
2294
2294
|
[
|
|
2295
2295
|
"Invalid option cast_date:",
|
|
@@ -2307,7 +2307,7 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2307
2307
|
else if (e.columns === void 0 || e.columns === null || e.columns === !1)
|
|
2308
2308
|
e.columns = !1;
|
|
2309
2309
|
else
|
|
2310
|
-
throw new
|
|
2310
|
+
throw new _(
|
|
2311
2311
|
"CSV_INVALID_OPTION_COLUMNS",
|
|
2312
2312
|
[
|
|
2313
2313
|
"Invalid option columns:",
|
|
@@ -2320,7 +2320,7 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2320
2320
|
e.group_columns_by_name = !1;
|
|
2321
2321
|
else {
|
|
2322
2322
|
if (e.group_columns_by_name !== !0)
|
|
2323
|
-
throw new
|
|
2323
|
+
throw new _(
|
|
2324
2324
|
"CSV_INVALID_OPTION_GROUP_COLUMNS_BY_NAME",
|
|
2325
2325
|
[
|
|
2326
2326
|
"Invalid option group_columns_by_name:",
|
|
@@ -2330,7 +2330,7 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2330
2330
|
e
|
|
2331
2331
|
);
|
|
2332
2332
|
if (e.columns === !1)
|
|
2333
|
-
throw new
|
|
2333
|
+
throw new _(
|
|
2334
2334
|
"CSV_INVALID_OPTION_GROUP_COLUMNS_BY_NAME",
|
|
2335
2335
|
[
|
|
2336
2336
|
"Invalid option group_columns_by_name:",
|
|
@@ -2342,7 +2342,7 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2342
2342
|
if (e.comment === void 0 || e.comment === null || e.comment === !1 || e.comment === "")
|
|
2343
2343
|
e.comment = null;
|
|
2344
2344
|
else if (typeof e.comment == "string" && (e.comment = a.from(e.comment, e.encoding)), !N(e.comment))
|
|
2345
|
-
throw new
|
|
2345
|
+
throw new _(
|
|
2346
2346
|
"CSV_INVALID_OPTION_COMMENT",
|
|
2347
2347
|
[
|
|
2348
2348
|
"Invalid option comment:",
|
|
@@ -2354,7 +2354,7 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2354
2354
|
if (e.comment_no_infix === void 0 || e.comment_no_infix === null || e.comment_no_infix === !1)
|
|
2355
2355
|
e.comment_no_infix = !1;
|
|
2356
2356
|
else if (e.comment_no_infix !== !0)
|
|
2357
|
-
throw new
|
|
2357
|
+
throw new _(
|
|
2358
2358
|
"CSV_INVALID_OPTION_COMMENT",
|
|
2359
2359
|
[
|
|
2360
2360
|
"Invalid option comment_no_infix:",
|
|
@@ -2365,7 +2365,7 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2365
2365
|
);
|
|
2366
2366
|
const r = JSON.stringify(e.delimiter);
|
|
2367
2367
|
if (Array.isArray(e.delimiter) || (e.delimiter = [e.delimiter]), e.delimiter.length === 0)
|
|
2368
|
-
throw new
|
|
2368
|
+
throw new _(
|
|
2369
2369
|
"CSV_INVALID_OPTION_DELIMITER",
|
|
2370
2370
|
[
|
|
2371
2371
|
"Invalid option delimiter:",
|
|
@@ -2378,7 +2378,7 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2378
2378
|
if (n == null || n === !1)
|
|
2379
2379
|
return a.from(",", e.encoding);
|
|
2380
2380
|
if (typeof n == "string" && (n = a.from(n, e.encoding)), !N(n) || n.length === 0)
|
|
2381
|
-
throw new
|
|
2381
|
+
throw new _(
|
|
2382
2382
|
"CSV_INVALID_OPTION_DELIMITER",
|
|
2383
2383
|
[
|
|
2384
2384
|
"Invalid option delimiter:",
|
|
@@ -2419,7 +2419,7 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2419
2419
|
else if (typeof e.ignore_last_delimiters == "number")
|
|
2420
2420
|
e.ignore_last_delimiters = Math.floor(e.ignore_last_delimiters), e.ignore_last_delimiters === 0 && (e.ignore_last_delimiters = !1);
|
|
2421
2421
|
else if (typeof e.ignore_last_delimiters != "boolean")
|
|
2422
|
-
throw new
|
|
2422
|
+
throw new _(
|
|
2423
2423
|
"CSV_INVALID_OPTION_IGNORE_LAST_DELIMITERS",
|
|
2424
2424
|
[
|
|
2425
2425
|
"Invalid option `ignore_last_delimiters`:",
|
|
@@ -2429,7 +2429,7 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2429
2429
|
e
|
|
2430
2430
|
);
|
|
2431
2431
|
if (e.ignore_last_delimiters === !0 && e.columns === !1)
|
|
2432
|
-
throw new
|
|
2432
|
+
throw new _(
|
|
2433
2433
|
"CSV_IGNORE_LAST_DELIMITERS_REQUIRES_COLUMNS",
|
|
2434
2434
|
[
|
|
2435
2435
|
"The option `ignore_last_delimiters`",
|
|
@@ -2477,7 +2477,7 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2477
2477
|
if (e.on_record === void 0 || e.on_record === null)
|
|
2478
2478
|
e.on_record = void 0;
|
|
2479
2479
|
else if (typeof e.on_record != "function")
|
|
2480
|
-
throw new
|
|
2480
|
+
throw new _(
|
|
2481
2481
|
"CSV_INVALID_OPTION_ON_RECORD",
|
|
2482
2482
|
[
|
|
2483
2483
|
"Invalid option `on_record`:",
|
|
@@ -2506,7 +2506,7 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2506
2506
|
e.record_delimiter = [];
|
|
2507
2507
|
else if (typeof e.record_delimiter == "string" || N(e.record_delimiter)) {
|
|
2508
2508
|
if (e.record_delimiter.length === 0)
|
|
2509
|
-
throw new
|
|
2509
|
+
throw new _(
|
|
2510
2510
|
"CSV_INVALID_OPTION_RECORD_DELIMITER",
|
|
2511
2511
|
[
|
|
2512
2512
|
"Invalid option `record_delimiter`:",
|
|
@@ -2517,7 +2517,7 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2517
2517
|
);
|
|
2518
2518
|
e.record_delimiter = [e.record_delimiter];
|
|
2519
2519
|
} else if (!Array.isArray(e.record_delimiter))
|
|
2520
|
-
throw new
|
|
2520
|
+
throw new _(
|
|
2521
2521
|
"CSV_INVALID_OPTION_RECORD_DELIMITER",
|
|
2522
2522
|
[
|
|
2523
2523
|
"Invalid option `record_delimiter`:",
|
|
@@ -2528,7 +2528,7 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2528
2528
|
);
|
|
2529
2529
|
if (e.record_delimiter = e.record_delimiter.map(function(n, i) {
|
|
2530
2530
|
if (typeof n != "string" && !N(n))
|
|
2531
|
-
throw new
|
|
2531
|
+
throw new _(
|
|
2532
2532
|
"CSV_INVALID_OPTION_RECORD_DELIMITER",
|
|
2533
2533
|
[
|
|
2534
2534
|
"Invalid option `record_delimiter`:",
|
|
@@ -2539,7 +2539,7 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2539
2539
|
e
|
|
2540
2540
|
);
|
|
2541
2541
|
if (n.length === 0)
|
|
2542
|
-
throw new
|
|
2542
|
+
throw new _(
|
|
2543
2543
|
"CSV_INVALID_OPTION_RECORD_DELIMITER",
|
|
2544
2544
|
[
|
|
2545
2545
|
"Invalid option `record_delimiter`:",
|
|
@@ -2665,7 +2665,7 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2665
2665
|
state: Un(r),
|
|
2666
2666
|
__needMoreData: function(n, i, o) {
|
|
2667
2667
|
if (o) return !1;
|
|
2668
|
-
const { encoding: s, escape: f, quote: u } = this.options, { quoting: l, needMoreDataSize: h, recordDelimiterMaxLength: c } = this.state,
|
|
2668
|
+
const { encoding: s, escape: f, quote: u } = this.options, { quoting: l, needMoreDataSize: h, recordDelimiterMaxLength: c } = this.state, g = i - n - 1, y = Math.max(
|
|
2669
2669
|
h,
|
|
2670
2670
|
// Skip if the remaining buffer smaller than record delimiter
|
|
2671
2671
|
// If "record_delimiter" is yet to be discovered:
|
|
@@ -2680,7 +2680,7 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2680
2680
|
// Skip if remaining buffer can be record delimiter following the closing quote
|
|
2681
2681
|
l ? u.length + c : 0
|
|
2682
2682
|
);
|
|
2683
|
-
return
|
|
2683
|
+
return g < y;
|
|
2684
2684
|
},
|
|
2685
2685
|
// Central parser implementation
|
|
2686
2686
|
parse: function(n, i, o, s) {
|
|
@@ -2690,15 +2690,15 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2690
2690
|
encoding: l,
|
|
2691
2691
|
from_line: h,
|
|
2692
2692
|
ltrim: c,
|
|
2693
|
-
max_record_size:
|
|
2694
|
-
raw:
|
|
2695
|
-
relax_quotes:
|
|
2696
|
-
rtrim:
|
|
2697
|
-
skip_empty_lines:
|
|
2698
|
-
to:
|
|
2699
|
-
to_line:
|
|
2693
|
+
max_record_size: g,
|
|
2694
|
+
raw: y,
|
|
2695
|
+
relax_quotes: C,
|
|
2696
|
+
rtrim: E,
|
|
2697
|
+
skip_empty_lines: x,
|
|
2698
|
+
to: S,
|
|
2699
|
+
to_line: w
|
|
2700
2700
|
} = this.options;
|
|
2701
|
-
let { comment:
|
|
2701
|
+
let { comment: m, escape: R, quote: U, record_delimiter: Re } = this.options;
|
|
2702
2702
|
const { bomSkipped: Yt, previousBuf: he, rawBuffer: Wt, escapeIsQuote: Qt } = this.state;
|
|
2703
2703
|
let v;
|
|
2704
2704
|
if (he === void 0)
|
|
@@ -2717,17 +2717,17 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2717
2717
|
return;
|
|
2718
2718
|
}
|
|
2719
2719
|
} else {
|
|
2720
|
-
for (const
|
|
2721
|
-
if (re[
|
|
2722
|
-
const J = re[
|
|
2720
|
+
for (const O in re)
|
|
2721
|
+
if (re[O].compare(v, 0, re[O].length) === 0) {
|
|
2722
|
+
const J = re[O].length;
|
|
2723
2723
|
this.state.bufBytesStart += J, v = v.slice(J);
|
|
2724
2724
|
const ce = ft({
|
|
2725
2725
|
...this.original_options,
|
|
2726
|
-
encoding:
|
|
2726
|
+
encoding: O
|
|
2727
2727
|
});
|
|
2728
|
-
for (const
|
|
2729
|
-
this.options[
|
|
2730
|
-
({ comment:
|
|
2728
|
+
for (const A in ce)
|
|
2729
|
+
this.options[A] = ce[A];
|
|
2730
|
+
({ comment: m, escape: R, quote: U } = this.options);
|
|
2731
2731
|
break;
|
|
2732
2732
|
}
|
|
2733
2733
|
this.state.bomSkipped = !0;
|
|
@@ -2735,7 +2735,7 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2735
2735
|
const Ie = v.length;
|
|
2736
2736
|
let d;
|
|
2737
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),
|
|
2738
|
+
if (this.state.wasRowDelimiter === !0 && (this.info.lines++, this.state.wasRowDelimiter = !1), w !== -1 && this.info.lines > w) {
|
|
2739
2739
|
this.state.stop = !0, s();
|
|
2740
2740
|
return;
|
|
2741
2741
|
}
|
|
@@ -2743,39 +2743,39 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2743
2743
|
v,
|
|
2744
2744
|
d
|
|
2745
2745
|
) && (Re = this.options.record_delimiter);
|
|
2746
|
-
const
|
|
2747
|
-
if (
|
|
2746
|
+
const O = v[d];
|
|
2747
|
+
if (y === !0 && Wt.append(O), (O === Pn || O === $n) && 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 (R !== null && this.state.quoting === !0 && this.__isEscape(v, d, O) && d + R.length < Ie)
|
|
2751
2751
|
if (Qt) {
|
|
2752
|
-
if (this.__isQuote(v, d +
|
|
2753
|
-
this.state.escaping = !0, d +=
|
|
2752
|
+
if (this.__isQuote(v, d + R.length)) {
|
|
2753
|
+
this.state.escaping = !0, d += R.length - 1;
|
|
2754
2754
|
continue;
|
|
2755
2755
|
}
|
|
2756
2756
|
} else {
|
|
2757
|
-
this.state.escaping = !0, d +=
|
|
2757
|
+
this.state.escaping = !0, d += R.length - 1;
|
|
2758
2758
|
continue;
|
|
2759
2759
|
}
|
|
2760
2760
|
if (this.state.commenting === !1 && this.__isQuote(v, d))
|
|
2761
2761
|
if (this.state.quoting === !0) {
|
|
2762
|
-
const
|
|
2762
|
+
const A = v[d + U.length], Z = E && this.__isCharTrimable(v, d + U.length), j = m !== null && this.__compareBytes(m, v, d + U.length, A), X = this.__isDelimiter(
|
|
2763
2763
|
v,
|
|
2764
2764
|
d + U.length,
|
|
2765
|
-
|
|
2766
|
-
), de = Re.length === 0 ? this.__autoDiscoverRecordDelimiter(v, d + U.length) : this.__isRecordDelimiter(
|
|
2767
|
-
if (
|
|
2768
|
-
d +=
|
|
2769
|
-
else if (!
|
|
2765
|
+
A
|
|
2766
|
+
), de = Re.length === 0 ? this.__autoDiscoverRecordDelimiter(v, d + U.length) : this.__isRecordDelimiter(A, v, d + U.length);
|
|
2767
|
+
if (R !== null && this.__isEscape(v, d, O) && this.__isQuote(v, d + R.length))
|
|
2768
|
+
d += R.length - 1;
|
|
2769
|
+
else if (!A || X || de || j || Z) {
|
|
2770
2770
|
this.state.quoting = !1, this.state.wasQuoting = !0, d += U.length - 1;
|
|
2771
2771
|
continue;
|
|
2772
|
-
} else if (
|
|
2772
|
+
} else if (C === !1) {
|
|
2773
2773
|
const Qe = this.__error(
|
|
2774
|
-
new
|
|
2774
|
+
new _(
|
|
2775
2775
|
"CSV_INVALID_CLOSING_QUOTE",
|
|
2776
2776
|
[
|
|
2777
2777
|
"Invalid Closing Quote:",
|
|
2778
|
-
`got "${String.fromCharCode(
|
|
2778
|
+
`got "${String.fromCharCode(A)}"`,
|
|
2779
2779
|
`at line ${this.info.lines}`,
|
|
2780
2780
|
"instead of delimiter, record delimiter, trimable character",
|
|
2781
2781
|
"(if activated) or comment"
|
|
@@ -2788,19 +2788,19 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2788
2788
|
} else
|
|
2789
2789
|
this.state.quoting = !1, this.state.wasQuoting = !0, this.state.field.prepend(U), d += U.length - 1;
|
|
2790
2790
|
} else if (this.state.field.length !== 0) {
|
|
2791
|
-
if (
|
|
2792
|
-
const
|
|
2791
|
+
if (C === !1) {
|
|
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(
|
|
2795
|
-
new
|
|
2795
|
+
new _(
|
|
2796
2796
|
"INVALID_OPENING_QUOTE",
|
|
2797
2797
|
[
|
|
2798
2798
|
"Invalid Opening Quote:",
|
|
2799
|
-
`a quote is found on field ${JSON.stringify(
|
|
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,
|
|
2803
|
-
|
|
2803
|
+
A,
|
|
2804
2804
|
{
|
|
2805
2805
|
field: this.state.field
|
|
2806
2806
|
}
|
|
@@ -2813,44 +2813,44 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2813
2813
|
continue;
|
|
2814
2814
|
}
|
|
2815
2815
|
if (this.state.quoting === !1) {
|
|
2816
|
-
const
|
|
2817
|
-
|
|
2816
|
+
const A = this.__isRecordDelimiter(
|
|
2817
|
+
O,
|
|
2818
2818
|
v,
|
|
2819
2819
|
d
|
|
2820
2820
|
);
|
|
2821
|
-
if (
|
|
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
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 +=
|
|
2826
|
+
this.state.enabled = !0, this.__resetField(), this.__resetRecord(), d += A - 1;
|
|
2827
2827
|
continue;
|
|
2828
2828
|
}
|
|
2829
|
-
if (
|
|
2830
|
-
this.info.empty_lines++, d +=
|
|
2829
|
+
if (x === !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
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 + d +
|
|
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 (S !== -1 && this.info.records >= S) {
|
|
2840
2840
|
this.state.stop = !0, s();
|
|
2841
2841
|
return;
|
|
2842
2842
|
}
|
|
2843
2843
|
}
|
|
2844
|
-
this.state.commenting = !1, d +=
|
|
2844
|
+
this.state.commenting = !1, d += A - 1;
|
|
2845
2845
|
continue;
|
|
2846
2846
|
}
|
|
2847
2847
|
if (this.state.commenting)
|
|
2848
2848
|
continue;
|
|
2849
|
-
if (
|
|
2849
|
+
if (m !== null && (u === !1 || this.state.record.length === 0 && this.state.field.length === 0) && this.__compareBytes(m, v, d, O) !== 0) {
|
|
2850
2850
|
this.state.commenting = !0;
|
|
2851
2851
|
continue;
|
|
2852
2852
|
}
|
|
2853
|
-
const Z = this.__isDelimiter(v, d,
|
|
2853
|
+
const Z = this.__isDelimiter(v, d, O);
|
|
2854
2854
|
if (Z !== 0) {
|
|
2855
2855
|
this.info.bytes = this.state.bufBytesStart + d;
|
|
2856
2856
|
const j = this.__onField();
|
|
@@ -2860,27 +2860,27 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2860
2860
|
}
|
|
2861
2861
|
}
|
|
2862
2862
|
}
|
|
2863
|
-
if (this.state.commenting === !1 &&
|
|
2863
|
+
if (this.state.commenting === !1 && g !== 0 && this.state.record_length + this.state.field.length > g)
|
|
2864
2864
|
return this.__error(
|
|
2865
|
-
new
|
|
2865
|
+
new _(
|
|
2866
2866
|
"CSV_MAX_RECORD_SIZE",
|
|
2867
2867
|
[
|
|
2868
2868
|
"Max Record Size:",
|
|
2869
2869
|
"record exceed the maximum number of tolerated bytes",
|
|
2870
|
-
`of ${
|
|
2870
|
+
`of ${g}`,
|
|
2871
2871
|
`at line ${this.info.lines}`
|
|
2872
2872
|
],
|
|
2873
2873
|
this.options,
|
|
2874
2874
|
this.__infoField()
|
|
2875
2875
|
)
|
|
2876
2876
|
);
|
|
2877
|
-
const J = c === !1 || this.state.quoting === !0 || this.state.field.length !== 0 || !this.__isCharTrimable(v, d), ce =
|
|
2877
|
+
const J = c === !1 || this.state.quoting === !0 || this.state.field.length !== 0 || !this.__isCharTrimable(v, d), ce = E === !1 || this.state.wasQuoting === !1;
|
|
2878
2878
|
if (J === !0 && ce === !0)
|
|
2879
|
-
this.state.field.append(
|
|
2879
|
+
this.state.field.append(O);
|
|
2880
2880
|
else {
|
|
2881
|
-
if (
|
|
2881
|
+
if (E === !0 && !this.__isCharTrimable(v, d))
|
|
2882
2882
|
return this.__error(
|
|
2883
|
-
new
|
|
2883
|
+
new _(
|
|
2884
2884
|
"CSV_NON_TRIMABLE_CHAR_AFTER_CLOSING_QUOTE",
|
|
2885
2885
|
[
|
|
2886
2886
|
"Invalid Closing Quote:",
|
|
@@ -2897,8 +2897,8 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2897
2897
|
}
|
|
2898
2898
|
if (i === !0)
|
|
2899
2899
|
if (this.state.quoting === !0) {
|
|
2900
|
-
const
|
|
2901
|
-
new
|
|
2900
|
+
const O = this.__error(
|
|
2901
|
+
new _(
|
|
2902
2902
|
"CSV_QUOTE_NOT_CLOSED",
|
|
2903
2903
|
[
|
|
2904
2904
|
"Quote Not Closed:",
|
|
@@ -2908,11 +2908,11 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = 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
2913
|
this.info.bytes = this.state.bufBytesStart + d;
|
|
2914
|
-
const
|
|
2915
|
-
if (
|
|
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++;
|
|
@@ -2930,54 +2930,54 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2930
2930
|
relax_column_count: l,
|
|
2931
2931
|
relax_column_count_less: h,
|
|
2932
2932
|
relax_column_count_more: c,
|
|
2933
|
-
raw:
|
|
2934
|
-
skip_records_with_empty_values:
|
|
2935
|
-
} = this.options, { enabled:
|
|
2936
|
-
if (
|
|
2933
|
+
raw: g,
|
|
2934
|
+
skip_records_with_empty_values: y
|
|
2935
|
+
} = this.options, { enabled: C, record: E } = this.state;
|
|
2936
|
+
if (C === !1)
|
|
2937
2937
|
return this.__resetRecord();
|
|
2938
|
-
const
|
|
2938
|
+
const x = E.length;
|
|
2939
2939
|
if (i === !0) {
|
|
2940
|
-
if (
|
|
2940
|
+
if (y === !0 && at(E)) {
|
|
2941
2941
|
this.__resetRecord();
|
|
2942
2942
|
return;
|
|
2943
2943
|
}
|
|
2944
|
-
return this.__firstLineToColumns(
|
|
2944
|
+
return this.__firstLineToColumns(E);
|
|
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 = x), x !== this.state.expectedRecordLength) {
|
|
2947
|
+
const S = i === !1 ? new _(
|
|
2948
2948
|
"CSV_RECORD_INCONSISTENT_FIELDS_LENGTH",
|
|
2949
2949
|
[
|
|
2950
2950
|
"Invalid Record Length:",
|
|
2951
2951
|
`expect ${this.state.expectedRecordLength},`,
|
|
2952
|
-
`got ${
|
|
2952
|
+
`got ${x} on line ${this.info.lines}`
|
|
2953
2953
|
],
|
|
2954
2954
|
this.options,
|
|
2955
2955
|
this.__infoField(),
|
|
2956
2956
|
{
|
|
2957
|
-
record:
|
|
2957
|
+
record: E
|
|
2958
2958
|
}
|
|
2959
|
-
) : new
|
|
2959
|
+
) : new _(
|
|
2960
2960
|
"CSV_RECORD_INCONSISTENT_COLUMNS",
|
|
2961
2961
|
[
|
|
2962
2962
|
"Invalid Record Length:",
|
|
2963
2963
|
`columns length is ${i.length},`,
|
|
2964
2964
|
// rename columns
|
|
2965
|
-
`got ${
|
|
2965
|
+
`got ${x} on line ${this.info.lines}`
|
|
2966
2966
|
],
|
|
2967
2967
|
this.options,
|
|
2968
2968
|
this.__infoField(),
|
|
2969
2969
|
{
|
|
2970
|
-
record:
|
|
2970
|
+
record: E
|
|
2971
2971
|
}
|
|
2972
2972
|
);
|
|
2973
|
-
if (l === !0 || h === !0 &&
|
|
2974
|
-
this.info.invalid_field_length++, this.state.error =
|
|
2973
|
+
if (l === !0 || h === !0 && x < this.state.expectedRecordLength || c === !0 && x > this.state.expectedRecordLength)
|
|
2974
|
+
this.info.invalid_field_length++, this.state.error = S;
|
|
2975
2975
|
else {
|
|
2976
|
-
const
|
|
2977
|
-
if (
|
|
2976
|
+
const w = this.__error(S);
|
|
2977
|
+
if (w) return w;
|
|
2978
2978
|
}
|
|
2979
2979
|
}
|
|
2980
|
-
if (
|
|
2980
|
+
if (y === !0 && at(E)) {
|
|
2981
2981
|
this.__resetRecord();
|
|
2982
2982
|
return;
|
|
2983
2983
|
}
|
|
@@ -2986,48 +2986,48 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2986
2986
|
return;
|
|
2987
2987
|
}
|
|
2988
2988
|
if (this.info.records++, u === 1 || this.info.records >= u) {
|
|
2989
|
-
const { objname:
|
|
2989
|
+
const { objname: S } = this.options;
|
|
2990
2990
|
if (i !== !1) {
|
|
2991
|
-
const
|
|
2992
|
-
for (let
|
|
2993
|
-
i[
|
|
2994
|
-
if (
|
|
2995
|
-
const
|
|
2996
|
-
{ record:
|
|
2997
|
-
|
|
2991
|
+
const w = {};
|
|
2992
|
+
for (let m = 0, R = E.length; m < R; m++)
|
|
2993
|
+
i[m] === void 0 || i[m].disabled || (o === !0 && w[i[m].name] !== void 0 ? Array.isArray(w[i[m].name]) ? w[i[m].name] = w[i[m].name].concat(E[m]) : w[i[m].name] = [w[i[m].name], E[m]] : w[i[m].name] = E[m]);
|
|
2994
|
+
if (g === !0 || f === !0) {
|
|
2995
|
+
const m = Object.assign(
|
|
2996
|
+
{ record: w },
|
|
2997
|
+
g === !0 ? { raw: this.state.rawBuffer.toString(s) } : {},
|
|
2998
2998
|
f === !0 ? { info: this.__infoRecord() } : {}
|
|
2999
|
-
),
|
|
3000
|
-
|
|
2999
|
+
), R = this.__push(
|
|
3000
|
+
S === void 0 ? m : [w[S], m],
|
|
3001
3001
|
n
|
|
3002
3002
|
);
|
|
3003
|
-
if (
|
|
3004
|
-
return
|
|
3003
|
+
if (R)
|
|
3004
|
+
return R;
|
|
3005
3005
|
} else {
|
|
3006
|
-
const
|
|
3007
|
-
|
|
3006
|
+
const m = this.__push(
|
|
3007
|
+
S === void 0 ? w : [w[S], w],
|
|
3008
3008
|
n
|
|
3009
3009
|
);
|
|
3010
|
-
if (
|
|
3011
|
-
return
|
|
3010
|
+
if (m)
|
|
3011
|
+
return m;
|
|
3012
3012
|
}
|
|
3013
|
-
} else if (
|
|
3014
|
-
const
|
|
3015
|
-
{ record:
|
|
3016
|
-
|
|
3013
|
+
} else if (g === !0 || f === !0) {
|
|
3014
|
+
const w = Object.assign(
|
|
3015
|
+
{ record: E },
|
|
3016
|
+
g === !0 ? { raw: this.state.rawBuffer.toString(s) } : {},
|
|
3017
3017
|
f === !0 ? { info: this.__infoRecord() } : {}
|
|
3018
|
-
),
|
|
3019
|
-
|
|
3018
|
+
), m = this.__push(
|
|
3019
|
+
S === void 0 ? w : [E[S], w],
|
|
3020
3020
|
n
|
|
3021
3021
|
);
|
|
3022
|
-
if (
|
|
3023
|
-
return
|
|
3022
|
+
if (m)
|
|
3023
|
+
return m;
|
|
3024
3024
|
} else {
|
|
3025
|
-
const
|
|
3026
|
-
|
|
3025
|
+
const w = this.__push(
|
|
3026
|
+
S === void 0 ? E : [E[S], E],
|
|
3027
3027
|
n
|
|
3028
3028
|
);
|
|
3029
|
-
if (
|
|
3030
|
-
return
|
|
3029
|
+
if (w)
|
|
3030
|
+
return w;
|
|
3031
3031
|
}
|
|
3032
3032
|
}
|
|
3033
3033
|
this.__resetRecord();
|
|
@@ -3038,7 +3038,7 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
3038
3038
|
const o = i === void 0 ? n : i.call(null, n);
|
|
3039
3039
|
if (!Array.isArray(o))
|
|
3040
3040
|
return this.__error(
|
|
3041
|
-
new
|
|
3041
|
+
new _(
|
|
3042
3042
|
"CSV_INVALID_COLUMN_MAPPING",
|
|
3043
3043
|
[
|
|
3044
3044
|
"Invalid Column Mapping:",
|
|
@@ -3303,7 +3303,7 @@ const ut = function() {
|
|
|
3303
3303
|
else if (r === void 0 && s === "function")
|
|
3304
3304
|
r = o;
|
|
3305
3305
|
else
|
|
3306
|
-
throw new
|
|
3306
|
+
throw new _(
|
|
3307
3307
|
"CSV_INVALID_ARGUMENT",
|
|
3308
3308
|
["Invalid argument:", `got ${JSON.stringify(o)} at index ${i}`],
|
|
3309
3309
|
e || {}
|
|
@@ -3382,46 +3382,48 @@ class Zn {
|
|
|
3382
3382
|
/** Parse stream. */
|
|
3383
3383
|
async parseStream(e, r, n, i, o) {
|
|
3384
3384
|
return new Promise((s, f) => {
|
|
3385
|
-
let u, l, h = !1,
|
|
3386
|
-
const
|
|
3387
|
-
if (
|
|
3388
|
-
|
|
3389
|
-
const
|
|
3390
|
-
u = void 0,
|
|
3391
|
-
|
|
3392
|
-
|
|
3385
|
+
let u, l, h, c = !1, g = !1;
|
|
3386
|
+
const y = () => {
|
|
3387
|
+
if (g) return;
|
|
3388
|
+
g = !0;
|
|
3389
|
+
const x = u;
|
|
3390
|
+
u = void 0, h = void 0, x != null && (this.ignoreErrors(() => x.removeAllListeners()), this.ignoreErrors(() => x.end())), this.ignoreErrors(() => {
|
|
3391
|
+
l?.cancel();
|
|
3392
|
+
}), l = void 0;
|
|
3393
|
+
}, C = (x) => {
|
|
3394
|
+
c || (c = !0, y(), i.signal.aborted || i.abort(x), f(x));
|
|
3393
3395
|
};
|
|
3394
|
-
i.signal.addEventListener("abort",
|
|
3395
|
-
u = ut(r),
|
|
3396
|
+
i.signal.addEventListener("abort", y, { once: !0 }), (async () => {
|
|
3397
|
+
u = ut(r), h = this.constructRowBuffer({ chunk: o, chunkSize: e.chunkSize ?? Hn }), u.on("readable", () => {
|
|
3396
3398
|
try {
|
|
3397
|
-
if (u == null ||
|
|
3398
|
-
let
|
|
3399
|
-
for (; (
|
|
3400
|
-
if (
|
|
3401
|
-
i.signal.throwIfAborted(),
|
|
3399
|
+
if (u == null || h == null) return;
|
|
3400
|
+
let R;
|
|
3401
|
+
for (; (R = u.read()) != null; ) {
|
|
3402
|
+
if (c) return;
|
|
3403
|
+
i.signal.throwIfAborted(), h.push(R);
|
|
3402
3404
|
}
|
|
3403
|
-
} catch (
|
|
3404
|
-
|
|
3405
|
-
}
|
|
3406
|
-
}), u.on("error", (g) => w(g)), u.on("end", () => {
|
|
3407
|
-
h || (l?.flush(), s(this.constructSummary(u)));
|
|
3408
|
-
});
|
|
3409
|
-
const p = await fetch(encodeURI(n), { signal: i.signal });
|
|
3410
|
-
if (!p.ok || p.body == null)
|
|
3411
|
-
throw await Yn(p, `Failed to fetch '${n}' file.`, "datapos-connector-file-store-emulator|Connector|retrieve");
|
|
3412
|
-
const T = p.body.pipeThrough(new TextDecoderStream(e.encodingId)), x = new WritableStream({
|
|
3413
|
-
write: (g) => {
|
|
3414
|
-
h || g.length !== 0 && (i.signal.throwIfAborted(), u?.write(g));
|
|
3415
|
-
},
|
|
3416
|
-
close: () => {
|
|
3417
|
-
h || u?.end();
|
|
3418
|
-
},
|
|
3419
|
-
abort: (g) => {
|
|
3420
|
-
h || w(g);
|
|
3405
|
+
} catch (R) {
|
|
3406
|
+
C(R);
|
|
3421
3407
|
}
|
|
3408
|
+
}), u.on("error", (R) => C(R)), u.on("end", () => {
|
|
3409
|
+
c || (h?.flush(), s(this.constructSummary(u)));
|
|
3422
3410
|
});
|
|
3423
|
-
await
|
|
3424
|
-
|
|
3411
|
+
const x = await fetch(encodeURI(n), { signal: i.signal });
|
|
3412
|
+
if (!x.ok || x.body == null)
|
|
3413
|
+
throw await Yn(x, `Failed to fetch '${n}' file.`, "datapos-connector-file-store-emulator|Connector|retrieve");
|
|
3414
|
+
l = x.body.getReader();
|
|
3415
|
+
const S = new TextDecoder(e.encodingId);
|
|
3416
|
+
let w = await l.read();
|
|
3417
|
+
for (; !w.done; ) {
|
|
3418
|
+
if (c) return;
|
|
3419
|
+
i.signal.throwIfAborted();
|
|
3420
|
+
const R = S.decode(w.value, { stream: !0 });
|
|
3421
|
+
R.length > 0 && u?.write(R), w = await l.read();
|
|
3422
|
+
}
|
|
3423
|
+
if (c) return;
|
|
3424
|
+
const m = S.decode();
|
|
3425
|
+
m.length > 0 && u?.write(m), u?.end();
|
|
3426
|
+
})().catch((x) => C(x));
|
|
3425
3427
|
});
|
|
3426
3428
|
}
|
|
3427
3429
|
/** Parse string. */
|