@datapos/datapos-tool-csv-parse 0.0.82 → 0.0.84
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 +216 -225
- package/dist/types/src/index.d.ts +4 -5
- package/package.json +5 -5
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
var ie = typeof global < "u" ? global : typeof self < "u" ? self : typeof window < "u" ? window : {}, P = [],
|
|
1
|
+
var ie = typeof global < "u" ? global : typeof self < "u" ? self : typeof window < "u" ? window : {}, P = [], M = [], Gt = typeof Uint8Array < "u" ? Uint8Array : Array, qe = !1;
|
|
2
2
|
function ct() {
|
|
3
3
|
qe = !0;
|
|
4
4
|
for (var t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", e = 0, r = t.length; e < r; ++e)
|
|
5
|
-
P[e] = t[e],
|
|
6
|
-
|
|
5
|
+
P[e] = t[e], M[t.charCodeAt(e)] = e;
|
|
6
|
+
M[45] = 62, M[95] = 63;
|
|
7
7
|
}
|
|
8
8
|
function Zt(t) {
|
|
9
9
|
qe || ct();
|
|
@@ -13,8 +13,8 @@ function Zt(t) {
|
|
|
13
13
|
o = t[f - 2] === "=" ? 2 : t[f - 1] === "=" ? 1 : 0, s = new Gt(f * 3 / 4 - o), n = o > 0 ? f - 4 : f;
|
|
14
14
|
var a = 0;
|
|
15
15
|
for (e = 0, r = 0; e < n; e += 4, r += 3)
|
|
16
|
-
i =
|
|
17
|
-
return o === 2 ? (i =
|
|
16
|
+
i = M[t.charCodeAt(e)] << 18 | M[t.charCodeAt(e + 1)] << 12 | M[t.charCodeAt(e + 2)] << 6 | M[t.charCodeAt(e + 3)], s[a++] = i >> 16 & 255, s[a++] = i >> 8 & 255, s[a++] = i & 255;
|
|
17
|
+
return o === 2 ? (i = M[t.charCodeAt(e)] << 2 | M[t.charCodeAt(e + 1)] >> 4, s[a++] = i & 255) : o === 1 && (i = M[t.charCodeAt(e)] << 10 | M[t.charCodeAt(e + 1)] << 4 | M[t.charCodeAt(e + 2)] >> 2, s[a++] = i >> 8 & 255, s[a++] = i & 255), s;
|
|
18
18
|
}
|
|
19
19
|
function Xt(t) {
|
|
20
20
|
return P[t >> 18 & 63] + P[t >> 12 & 63] + P[t >> 6 & 63] + P[t & 63];
|
|
@@ -30,7 +30,7 @@ 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
|
|
33
|
+
function ve(t, e, r, n, i) {
|
|
34
34
|
var o, s, f = i * 8 - n - 1, a = (1 << f) - 1, l = a >> 1, h = -7, c = r ? i - 1 : 0, p = r ? -1 : 1, m = t[e + c];
|
|
35
35
|
for (c += p, o = m & (1 << -h) - 1, m >>= -h, h += f; h > 0; o = o * 256 + t[e + c], c += p, h -= 8)
|
|
36
36
|
;
|
|
@@ -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 ze(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 ze(t, e) {
|
|
107
|
+
if (mt(e), t = q(t, e < 0 ? 0 : Ve(e) | 0), !u.TYPED_ARRAY_SUPPORT)
|
|
108
108
|
for (var r = 0; r < e; ++r)
|
|
109
109
|
t[r] = 0;
|
|
110
110
|
return t;
|
|
111
111
|
}
|
|
112
112
|
u.allocUnsafe = function(t) {
|
|
113
|
-
return
|
|
113
|
+
return ze(null, t);
|
|
114
114
|
};
|
|
115
115
|
u.allocUnsafeSlow = function(t) {
|
|
116
|
-
return
|
|
116
|
+
return ze(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 : Ve(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 = Ve(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 Ve(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;
|
|
@@ -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 += br(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 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
|
u.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
|
u.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
|
u.prototype.readUInt8 = function(e, r) {
|
|
552
|
-
return r ||
|
|
552
|
+
return r || T(e, 1, this.length), this[e];
|
|
553
553
|
};
|
|
554
554
|
u.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
|
u.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
|
u.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
|
u.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
|
u.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
|
u.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
|
u.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
|
u.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
|
u.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
|
u.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
|
u.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
|
u.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
|
u.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
|
u.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
|
u.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 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 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
|
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) : be(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) : 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 @@ 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) : be(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) : be(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 vt(t, e, r, n, i, o) {
|
|
695
695
|
if (r + n > t.length) throw new RangeError("Index out of range");
|
|
696
696
|
if (r < 0) throw new RangeError("Index out of range");
|
|
697
697
|
}
|
|
698
|
-
function
|
|
699
|
-
return i ||
|
|
698
|
+
function bt(t, e, r, n, i) {
|
|
699
|
+
return i || vt(t, e, r, 4), ht(t, e, r, n, 23, 4), r + 4;
|
|
700
700
|
}
|
|
701
701
|
u.prototype.writeFloatLE = function(e, r, n) {
|
|
702
|
-
return
|
|
702
|
+
return bt(this, e, r, !0, n);
|
|
703
703
|
};
|
|
704
704
|
u.prototype.writeFloatBE = function(e, r, n) {
|
|
705
|
-
return
|
|
705
|
+
return bt(this, e, r, !1, n);
|
|
706
706
|
};
|
|
707
707
|
function Et(t, e, r, n, i) {
|
|
708
|
-
return i ||
|
|
708
|
+
return i || vt(t, e, r, 8), ht(t, e, r, n, 52, 8), r + 8;
|
|
709
709
|
}
|
|
710
710
|
u.prototype.writeDoubleLE = function(e, r, n) {
|
|
711
711
|
return Et(this, e, r, !0, n);
|
|
@@ -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 = vr(t).replace(wr, ""), t.length < 2) return "";
|
|
768
768
|
for (; t.length % 4 !== 0; )
|
|
769
769
|
t = t + "=";
|
|
770
770
|
return t;
|
|
771
771
|
}
|
|
772
|
-
function
|
|
772
|
+
function vr(t) {
|
|
773
773
|
return t.trim ? t.trim() : t.replace(/^\s+|\s+$/g, "");
|
|
774
774
|
}
|
|
775
|
-
function
|
|
775
|
+
function br(t) {
|
|
776
776
|
return t < 16 ? "0" + t.toString(16) : t.toString(16);
|
|
777
777
|
}
|
|
778
778
|
function we(t, e) {
|
|
@@ -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 Tr(t, e, r, n) {
|
|
914
914
|
if (e)
|
|
915
915
|
t.apply(r, n);
|
|
916
916
|
else
|
|
@@ -955,7 +955,7 @@ g.prototype.emit = function(e) {
|
|
|
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
|
+
Tr(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, Lr(f);
|
|
976
976
|
}
|
|
977
977
|
return t;
|
|
978
978
|
}
|
|
979
|
-
function
|
|
979
|
+
function Lr(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 Tt() {
|
|
1094
1094
|
throw new Error("clearTimeout has not been defined");
|
|
1095
1095
|
}
|
|
1096
|
-
var Y = At, W =
|
|
1096
|
+
var Y = At, W = Tt;
|
|
1097
1097
|
typeof ie.setTimeout == "function" && (Y = setTimeout);
|
|
1098
1098
|
typeof ie.clearTimeout == "function" && (W = clearTimeout);
|
|
1099
|
-
function
|
|
1099
|
+
function Lt(t) {
|
|
1100
1100
|
if (Y === setTimeout)
|
|
1101
1101
|
return setTimeout(t, 0);
|
|
1102
1102
|
if ((Y === At || !Y) && setTimeout)
|
|
@@ -1114,7 +1114,7 @@ function Tt(t) {
|
|
|
1114
1114
|
function Fr(t) {
|
|
1115
1115
|
if (W === clearTimeout)
|
|
1116
1116
|
return clearTimeout(t);
|
|
1117
|
-
if ((W ===
|
|
1117
|
+
if ((W === Tt || !W) && clearTimeout)
|
|
1118
1118
|
return W = clearTimeout, clearTimeout(t);
|
|
1119
1119
|
try {
|
|
1120
1120
|
return W(t);
|
|
@@ -1126,28 +1126,28 @@ function Fr(t) {
|
|
|
1126
1126
|
}
|
|
1127
1127
|
}
|
|
1128
1128
|
}
|
|
1129
|
-
var
|
|
1129
|
+
var z = [], ne = !1, ee, me = -1;
|
|
1130
1130
|
function Mr() {
|
|
1131
|
-
!ne || !ee || (ne = !1, ee.length ?
|
|
1131
|
+
!ne || !ee || (ne = !1, ee.length ? z = ee.concat(z) : me = -1, z.length && Dt());
|
|
1132
1132
|
}
|
|
1133
1133
|
function Dt() {
|
|
1134
1134
|
if (!ne) {
|
|
1135
|
-
var t =
|
|
1135
|
+
var t = Lt(Mr);
|
|
1136
1136
|
ne = !0;
|
|
1137
|
-
for (var e =
|
|
1138
|
-
for (ee =
|
|
1137
|
+
for (var e = z.length; e; ) {
|
|
1138
|
+
for (ee = z, z = []; ++me < e; )
|
|
1139
1139
|
ee && ee[me].run();
|
|
1140
|
-
me = -1, e =
|
|
1140
|
+
me = -1, e = z.length;
|
|
1141
1141
|
}
|
|
1142
1142
|
ee = null, ne = !1, Fr(t);
|
|
1143
1143
|
}
|
|
1144
1144
|
}
|
|
1145
|
-
function
|
|
1145
|
+
function U(t) {
|
|
1146
1146
|
var e = new Array(arguments.length - 1);
|
|
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
|
+
z.push(new Nt(t, e)), z.length === 1 && !ne && Lt(Dt);
|
|
1151
1151
|
}
|
|
1152
1152
|
function Nt(t, e) {
|
|
1153
1153
|
this.fun = t, this.array = e;
|
|
@@ -1288,22 +1288,22 @@ 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 = zr(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)), Le(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 (Te(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 (Le(e))
|
|
1307
1307
|
return Ae(e);
|
|
1308
1308
|
}
|
|
1309
1309
|
var a = "", l = !1, h = ["{", "}"];
|
|
@@ -1311,17 +1311,17 @@ function ye(t, e, r) {
|
|
|
1311
1311
|
var c = e.name ? ": " + e.name : "";
|
|
1312
1312
|
a = " [Function" + c + "]";
|
|
1313
1313
|
}
|
|
1314
|
-
if (
|
|
1314
|
+
if (Te(e) && (a = " " + RegExp.prototype.toString.call(e)), et(e) && (a = " " + Date.prototype.toUTCString.call(e)), Le(e) && (a = " " + Ae(e)), o.length === 0 && (!l || e.length == 0))
|
|
1315
1315
|
return h[0] + a + h[1];
|
|
1316
1316
|
if (r < 0)
|
|
1317
|
-
return
|
|
1317
|
+
return Te(e) ? t.stylize(RegExp.prototype.toString.call(e), "regexp") : t.stylize("[Object]", "special");
|
|
1318
1318
|
t.seen.push(e);
|
|
1319
1319
|
var p;
|
|
1320
|
-
return l ? p =
|
|
1320
|
+
return l ? p = Vr(t, e, r, s, o) : p = o.map(function(m) {
|
|
1321
1321
|
return Pe(t, e, r, s, m, l);
|
|
1322
1322
|
}), t.seen.pop(), Jr(p, a, h);
|
|
1323
1323
|
}
|
|
1324
|
-
function
|
|
1324
|
+
function zr(t, e) {
|
|
1325
1325
|
if (Q(e))
|
|
1326
1326
|
return t.stylize("undefined", "undefined");
|
|
1327
1327
|
if (Ye(e)) {
|
|
@@ -1338,7 +1338,7 @@ function Vr(t, e) {
|
|
|
1338
1338
|
function Ae(t) {
|
|
1339
1339
|
return "[" + Error.prototype.toString.call(t) + "]";
|
|
1340
1340
|
}
|
|
1341
|
-
function
|
|
1341
|
+
function Vr(t, e, r, n, i) {
|
|
1342
1342
|
for (var o = [], s = 0, f = e.length; s < f; ++s)
|
|
1343
1343
|
Bt(e, String(s)) ? o.push(Pe(
|
|
1344
1344
|
t,
|
|
@@ -1405,7 +1405,7 @@ function Ye(t) {
|
|
|
1405
1405
|
function Q(t) {
|
|
1406
1406
|
return t === void 0;
|
|
1407
1407
|
}
|
|
1408
|
-
function
|
|
1408
|
+
function Te(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 Le(t) {
|
|
1418
1418
|
return ue(t) && (We(t) === "[object Error]" || t instanceof Error);
|
|
1419
1419
|
}
|
|
1420
1420
|
function De(t) {
|
|
@@ -1577,7 +1577,7 @@ function tn(t, e) {
|
|
|
1577
1577
|
return t.listeners(e).length;
|
|
1578
1578
|
}
|
|
1579
1579
|
function Ut(t, e) {
|
|
1580
|
-
t = t || {}, this.objectMode = !!t.objectMode, e instanceof
|
|
1580
|
+
t = t || {}, this.objectMode = !!t.objectMode, e instanceof B && (this.objectMode = this.objectMode || !!t.readableObjectMode);
|
|
1581
1581
|
var r = t.highWaterMark, n = this.objectMode ? 16 : 16 * 1024;
|
|
1582
1582
|
this.highWaterMark = r || r === 0 ? r : n, this.highWaterMark = ~~this.highWaterMark, this.buffer = new te(), this.length = 0, this.pipes = null, this.pipesCount = 0, this.flowing = null, this.ended = !1, this.endEmitted = !1, this.reading = !1, this.sync = !0, this.needReadable = !1, this.emittedReadable = !1, this.readableListening = !1, this.resumeScheduled = !1, this.defaultEncoding = t.defaultEncoding || "utf8", this.ranOut = !1, this.awaitDrain = 0, this.readingMore = !1, this.decoder = null, this.encoding = null, t.encoding && (this.decoder = new le(t.encoding), this.encoding = t.encoding);
|
|
1583
1583
|
}
|
|
@@ -1656,13 +1656,13 @@ function sn(t, e) {
|
|
|
1656
1656
|
}
|
|
1657
1657
|
function Se(t) {
|
|
1658
1658
|
var e = t._readableState;
|
|
1659
|
-
e.needReadable = !1, e.emittedReadable || (E("emitReadable", e.flowing), e.emittedReadable = !0, e.sync ?
|
|
1659
|
+
e.needReadable = !1, e.emittedReadable || (E("emitReadable", e.flowing), e.emittedReadable = !0, e.sync ? U(nt, t) : nt(t));
|
|
1660
1660
|
}
|
|
1661
1661
|
function nt(t) {
|
|
1662
1662
|
E("emit readable"), t.emit("readable"), Qe(t);
|
|
1663
1663
|
}
|
|
1664
1664
|
function fn(t, e) {
|
|
1665
|
-
e.readingMore || (e.readingMore = !0,
|
|
1665
|
+
e.readingMore || (e.readingMore = !0, U(an, t, e));
|
|
1666
1666
|
}
|
|
1667
1667
|
function an(t, e) {
|
|
1668
1668
|
for (var r = e.length; !e.reading && !e.flowing && !e.ended && e.length < e.highWaterMark && (E("maybeReadMore read 0"), t.read(0), r !== e.length); )
|
|
@@ -1687,9 +1687,9 @@ C.prototype.pipe = function(t, e) {
|
|
|
1687
1687
|
}
|
|
1688
1688
|
n.pipesCount += 1, E("pipe count=%d opts=%j", n.pipesCount, e);
|
|
1689
1689
|
var i = !e || e.end !== !1, o = i ? f : h;
|
|
1690
|
-
n.endEmitted ?
|
|
1691
|
-
function s(
|
|
1692
|
-
E("onunpipe"),
|
|
1690
|
+
n.endEmitted ? U(o) : r.once("end", o), t.on("unpipe", s);
|
|
1691
|
+
function s(I) {
|
|
1692
|
+
E("onunpipe"), I === r && h();
|
|
1693
1693
|
}
|
|
1694
1694
|
function f() {
|
|
1695
1695
|
E("onend"), t.end();
|
|
@@ -1702,13 +1702,13 @@ C.prototype.pipe = function(t, e) {
|
|
|
1702
1702
|
}
|
|
1703
1703
|
var c = !1;
|
|
1704
1704
|
r.on("data", p);
|
|
1705
|
-
function p(
|
|
1705
|
+
function p(I) {
|
|
1706
1706
|
E("ondata"), c = !1;
|
|
1707
|
-
var
|
|
1708
|
-
|
|
1707
|
+
var v = t.write(I);
|
|
1708
|
+
v === !1 && !c && ((n.pipesCount === 1 && n.pipes === t || n.pipesCount > 1 && $t(n.pipes, t) !== -1) && !l && (E("false write response, pause", r._readableState.awaitDrain), r._readableState.awaitDrain++, c = !0), r.pause());
|
|
1709
1709
|
}
|
|
1710
|
-
function m(
|
|
1711
|
-
E("onerror",
|
|
1710
|
+
function m(I) {
|
|
1711
|
+
E("onerror", I), S(), t.removeListener("error", m), tn(t, "error") === 0 && t.emit("error", I);
|
|
1712
1712
|
}
|
|
1713
1713
|
en(t, "error", m);
|
|
1714
1714
|
function x() {
|
|
@@ -1751,7 +1751,7 @@ C.prototype.on = function(t, e) {
|
|
|
1751
1751
|
this._readableState.flowing !== !1 && this.resume();
|
|
1752
1752
|
else if (t === "readable") {
|
|
1753
1753
|
var n = this._readableState;
|
|
1754
|
-
!n.endEmitted && !n.readableListening && (n.readableListening = n.needReadable = !0, n.emittedReadable = !1, n.reading ? n.length && Se(this) :
|
|
1754
|
+
!n.endEmitted && !n.readableListening && (n.readableListening = n.needReadable = !0, n.emittedReadable = !1, n.reading ? n.length && Se(this) : U(ln, this));
|
|
1755
1755
|
}
|
|
1756
1756
|
return r;
|
|
1757
1757
|
};
|
|
@@ -1764,7 +1764,7 @@ C.prototype.resume = function() {
|
|
|
1764
1764
|
return t.flowing || (E("resume"), t.flowing = !0, cn(this, t)), this;
|
|
1765
1765
|
};
|
|
1766
1766
|
function cn(t, e) {
|
|
1767
|
-
e.resumeScheduled || (e.resumeScheduled = !0,
|
|
1767
|
+
e.resumeScheduled || (e.resumeScheduled = !0, U(hn, t, e));
|
|
1768
1768
|
}
|
|
1769
1769
|
function hn(t, e) {
|
|
1770
1770
|
e.reading || (E("resume read 0"), t.read(0)), e.resumeScheduled = !1, e.awaitDrain = 0, t.emit("resume"), Qe(t), e.flowing && !e.reading && t.read(0);
|
|
@@ -1841,7 +1841,7 @@ function mn(t, e) {
|
|
|
1841
1841
|
function Ne(t) {
|
|
1842
1842
|
var e = t._readableState;
|
|
1843
1843
|
if (e.length > 0) throw new Error('"endReadable()" called on non-empty stream');
|
|
1844
|
-
e.endEmitted || (e.ended = !0,
|
|
1844
|
+
e.endEmitted || (e.ended = !0, U(gn, e, t));
|
|
1845
1845
|
}
|
|
1846
1846
|
function gn(t, e) {
|
|
1847
1847
|
!t.endEmitted && t.length === 0 && (t.endEmitted = !0, e.readable = !1, e.emit("end"));
|
|
@@ -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
|
+
L.WritableState = He;
|
|
1859
|
+
oe(L, g);
|
|
1860
1860
|
function wn() {
|
|
1861
1861
|
}
|
|
1862
1862
|
function yn(t, e, r) {
|
|
@@ -1867,47 +1867,47 @@ function He(t, e) {
|
|
|
1867
1867
|
get: Ft(function() {
|
|
1868
1868
|
return this.getBuffer();
|
|
1869
1869
|
}, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")
|
|
1870
|
-
}), t = t || {}, this.objectMode = !!t.objectMode, e instanceof
|
|
1870
|
+
}), t = t || {}, this.objectMode = !!t.objectMode, e instanceof B && (this.objectMode = this.objectMode || !!t.writableObjectMode);
|
|
1871
1871
|
var r = t.highWaterMark, n = this.objectMode ? 16 : 16 * 1024;
|
|
1872
1872
|
this.highWaterMark = r || r === 0 ? r : n, this.highWaterMark = ~~this.highWaterMark, this.needDrain = !1, this.ending = !1, this.ended = !1, this.finished = !1;
|
|
1873
1873
|
var i = t.decodeStrings === !1;
|
|
1874
1874
|
this.decodeStrings = !i, this.defaultEncoding = t.defaultEncoding || "utf8", this.length = 0, this.writing = !1, this.corked = 0, this.sync = !0, this.bufferProcessing = !1, this.onwrite = function(o) {
|
|
1875
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 Vt(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 L(t) {
|
|
1884
|
+
if (!(this instanceof L) && !(this instanceof B)) return new L(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
|
+
L.prototype.pipe = function() {
|
|
1888
1888
|
this.emit("error", new Error("Cannot pipe, not readable"));
|
|
1889
1889
|
};
|
|
1890
|
-
function
|
|
1890
|
+
function vn(t, e) {
|
|
1891
1891
|
var r = new Error("write after end");
|
|
1892
|
-
t.emit("error", r),
|
|
1892
|
+
t.emit("error", r), U(e, r);
|
|
1893
1893
|
}
|
|
1894
|
-
function
|
|
1894
|
+
function bn(t, e, r, n) {
|
|
1895
1895
|
var i = !0, o = !1;
|
|
1896
|
-
return r === null ? o = new TypeError("May not write null values to stream") : !u.isBuffer(r) && typeof r != "string" && r !== void 0 && !e.objectMode && (o = new TypeError("Invalid non-string/buffer chunk")), o && (t.emit("error", o),
|
|
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
|
+
L.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 ? vn(this, r) : bn(this, n, t, r) && (n.pendingcb++, i = xn(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 && jt(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
|
};
|
|
@@ -1930,7 +1930,7 @@ function $e(t, e, r, n, i, o, s) {
|
|
|
1930
1930
|
e.writelen = n, e.writecb = s, e.writing = !0, e.sync = !0, r ? t._writev(i, e.onwrite) : t._write(i, o, e.onwrite), e.sync = !1;
|
|
1931
1931
|
}
|
|
1932
1932
|
function Sn(t, e, r, n, i) {
|
|
1933
|
-
--e.pendingcb, r ?
|
|
1933
|
+
--e.pendingcb, r ? U(i, n) : i(n), t._writableState.errorEmitted = !0, t.emit("error", n);
|
|
1934
1934
|
}
|
|
1935
1935
|
function Rn(t) {
|
|
1936
1936
|
t.writing = !1, t.writecb = null, t.length -= t.writelen, t.writelen = 0;
|
|
@@ -1940,11 +1940,11 @@ function In(t, e) {
|
|
|
1940
1940
|
if (Rn(r), e) Sn(t, r, n, e, i);
|
|
1941
1941
|
else {
|
|
1942
1942
|
var o = qt(r);
|
|
1943
|
-
!o && !r.corked && !r.bufferProcessing && r.bufferedRequest && jt(t, r), n ?
|
|
1943
|
+
!o && !r.corked && !r.bufferProcessing && r.bufferedRequest && jt(t, r), n ? U(it, t, r, o, i) : it(t, r, o, i);
|
|
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(), zt(t, e);
|
|
1948
1948
|
}
|
|
1949
1949
|
function Cn(t, e) {
|
|
1950
1950
|
e.length === 0 && e.needDrain && (e.needDrain = !1, t.emit("drain"));
|
|
@@ -1957,7 +1957,7 @@ 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 Vt(e);
|
|
1961
1961
|
} else {
|
|
1962
1962
|
for (; r; ) {
|
|
1963
1963
|
var f = r.chunk, a = r.encoding, l = r.callback, h = e.objectMode ? 1 : f.length;
|
|
@@ -1968,11 +1968,11 @@ function jt(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
|
};
|
|
@@ -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 zt(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, zt(t, e), r && (e.finished ? U(r) : t.once("finish", r)), e.ended = !0, t.writable = !1;
|
|
1991
1991
|
}
|
|
1992
|
-
function
|
|
1992
|
+
function Vt(t) {
|
|
1993
1993
|
var e = this;
|
|
1994
1994
|
this.next = null, this.entry = null, this.finish = function(r) {
|
|
1995
1995
|
var n = e.entry;
|
|
@@ -2000,24 +2000,24 @@ function zt(t) {
|
|
|
2000
2000
|
t.corkedRequestsFree ? t.corkedRequestsFree.next = e : t.corkedRequestsFree = e;
|
|
2001
2001
|
};
|
|
2002
2002
|
}
|
|
2003
|
-
oe(
|
|
2004
|
-
var st = Object.keys(
|
|
2003
|
+
oe(B, C);
|
|
2004
|
+
var st = Object.keys(L.prototype);
|
|
2005
2005
|
for (var Fe = 0; Fe < st.length; Fe++) {
|
|
2006
2006
|
var Me = st[Fe];
|
|
2007
|
-
|
|
2007
|
+
B.prototype[Me] || (B.prototype[Me] = L.prototype[Me]);
|
|
2008
2008
|
}
|
|
2009
|
-
function
|
|
2010
|
-
if (!(this instanceof
|
|
2011
|
-
C.call(this, t),
|
|
2009
|
+
function B(t) {
|
|
2010
|
+
if (!(this instanceof B)) return new B(t);
|
|
2011
|
+
C.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", An);
|
|
2012
2012
|
}
|
|
2013
2013
|
function An() {
|
|
2014
|
-
this.allowHalfOpen || this._writableState.ended ||
|
|
2014
|
+
this.allowHalfOpen || this._writableState.ended || U(Tn, this);
|
|
2015
2015
|
}
|
|
2016
|
-
function
|
|
2016
|
+
function Tn(t) {
|
|
2017
2017
|
t.end();
|
|
2018
2018
|
}
|
|
2019
|
-
oe(k,
|
|
2020
|
-
function
|
|
2019
|
+
oe(k, B);
|
|
2020
|
+
function Ln(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
|
-
|
|
2036
|
+
B.call(this, t), this._transformState = new Ln(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) {
|
|
@@ -2042,7 +2042,7 @@ function k(t) {
|
|
|
2042
2042
|
});
|
|
2043
2043
|
}
|
|
2044
2044
|
k.prototype.push = function(t, e) {
|
|
2045
|
-
return this._transformState.needTransform = !1,
|
|
2045
|
+
return this._transformState.needTransform = !1, B.prototype.push.call(this, t, e);
|
|
2046
2046
|
};
|
|
2047
2047
|
k.prototype._transform = function(t, e, r) {
|
|
2048
2048
|
throw new Error("Not implemented");
|
|
@@ -2073,17 +2073,17 @@ 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(V, g);
|
|
2077
|
+
V.Readable = C;
|
|
2078
|
+
V.Writable = L;
|
|
2079
|
+
V.Duplex = B;
|
|
2080
|
+
V.Transform = k;
|
|
2081
|
+
V.PassThrough = fe;
|
|
2082
|
+
V.Stream = V;
|
|
2083
|
+
function V() {
|
|
2084
2084
|
g.call(this);
|
|
2085
2085
|
}
|
|
2086
|
-
|
|
2086
|
+
V.prototype.pipe = function(t, e) {
|
|
2087
2087
|
var r = this;
|
|
2088
2088
|
function n(h) {
|
|
2089
2089
|
t.writable && t.write(h) === !1 && r.pause && r.pause();
|
|
@@ -2695,79 +2695,79 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
2695
2695
|
relax_quotes: x,
|
|
2696
2696
|
rtrim: y,
|
|
2697
2697
|
skip_empty_lines: S,
|
|
2698
|
-
to:
|
|
2699
|
-
to_line:
|
|
2698
|
+
to: I,
|
|
2699
|
+
to_line: v
|
|
2700
2700
|
} = this.options;
|
|
2701
|
-
let { comment: _, escape:
|
|
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 b;
|
|
2704
2704
|
if (ce === void 0)
|
|
2705
2705
|
if (n === void 0) {
|
|
2706
2706
|
s();
|
|
2707
2707
|
return;
|
|
2708
2708
|
} else
|
|
2709
|
-
|
|
2710
|
-
else ce !== void 0 && n === void 0 ?
|
|
2709
|
+
b = n;
|
|
2710
|
+
else ce !== void 0 && n === void 0 ? b = ce : b = u.concat([ce, n]);
|
|
2711
2711
|
if (Wt === !1)
|
|
2712
2712
|
if (f === !1)
|
|
2713
2713
|
this.state.bomSkipped = !0;
|
|
2714
|
-
else if (
|
|
2714
|
+
else if (b.length < 3) {
|
|
2715
2715
|
if (i === !1) {
|
|
2716
|
-
this.state.previousBuf =
|
|
2716
|
+
this.state.previousBuf = b;
|
|
2717
2717
|
return;
|
|
2718
2718
|
}
|
|
2719
2719
|
} else {
|
|
2720
2720
|
for (const O in re)
|
|
2721
|
-
if (re[O].compare(
|
|
2721
|
+
if (re[O].compare(b, 0, re[O].length) === 0) {
|
|
2722
2722
|
const J = re[O].length;
|
|
2723
|
-
this.state.bufBytesStart += J,
|
|
2723
|
+
this.state.bufBytesStart += J, b = b.slice(J);
|
|
2724
2724
|
const he = ut({
|
|
2725
2725
|
...this.original_options,
|
|
2726
2726
|
encoding: O
|
|
2727
2727
|
});
|
|
2728
2728
|
for (const A in he)
|
|
2729
2729
|
this.options[A] = he[A];
|
|
2730
|
-
({ comment: _, escape:
|
|
2730
|
+
({ comment: _, escape: R, quote: F } = this.options);
|
|
2731
2731
|
break;
|
|
2732
2732
|
}
|
|
2733
2733
|
this.state.bomSkipped = !0;
|
|
2734
2734
|
}
|
|
2735
|
-
const Ie =
|
|
2735
|
+
const Ie = b.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), v !== -1 && this.info.lines > v) {
|
|
2739
2739
|
this.state.stop = !0, s();
|
|
2740
2740
|
return;
|
|
2741
2741
|
}
|
|
2742
2742
|
this.state.quoting === !1 && Re.length === 0 && this.__autoDiscoverRecordDelimiter(
|
|
2743
|
-
|
|
2743
|
+
b,
|
|
2744
2744
|
d
|
|
2745
2745
|
) && (Re = this.options.record_delimiter);
|
|
2746
|
-
const O =
|
|
2746
|
+
const O = b[d];
|
|
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 (
|
|
2750
|
+
if (R !== null && this.state.quoting === !0 && this.__isEscape(b, d, O) && d + R.length < Ie)
|
|
2751
2751
|
if (Ht) {
|
|
2752
|
-
if (this.__isQuote(
|
|
2753
|
-
this.state.escaping = !0, d +=
|
|
2752
|
+
if (this.__isQuote(b, 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
|
-
if (this.state.commenting === !1 && this.__isQuote(
|
|
2760
|
+
if (this.state.commenting === !1 && this.__isQuote(b, d))
|
|
2761
2761
|
if (this.state.quoting === !0) {
|
|
2762
|
-
const A =
|
|
2763
|
-
|
|
2764
|
-
d +
|
|
2762
|
+
const A = b[d + F.length], Z = y && this.__isCharTrimable(b, d + F.length), j = _ !== null && this.__compareBytes(_, b, d + F.length, A), X = this.__isDelimiter(
|
|
2763
|
+
b,
|
|
2764
|
+
d + F.length,
|
|
2765
2765
|
A
|
|
2766
|
-
), de = Re.length === 0 ? this.__autoDiscoverRecordDelimiter(
|
|
2767
|
-
if (
|
|
2768
|
-
d +=
|
|
2766
|
+
), de = Re.length === 0 ? this.__autoDiscoverRecordDelimiter(b, d + F.length) : this.__isRecordDelimiter(A, b, d + F.length);
|
|
2767
|
+
if (R !== null && this.__isEscape(b, d, O) && this.__isQuote(b, d + R.length))
|
|
2768
|
+
d += R.length - 1;
|
|
2769
2769
|
else if (!A || X || de || j || Z) {
|
|
2770
|
-
this.state.quoting = !1, this.state.wasQuoting = !0, d +=
|
|
2770
|
+
this.state.quoting = !1, this.state.wasQuoting = !0, d += F.length - 1;
|
|
2771
2771
|
continue;
|
|
2772
2772
|
} else if (x === !1) {
|
|
2773
2773
|
const Ge = this.__error(
|
|
@@ -2786,7 +2786,7 @@ 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(
|
|
2789
|
+
this.state.quoting = !1, this.state.wasQuoting = !0, this.state.field.prepend(F), d += F.length - 1;
|
|
2790
2790
|
} else if (this.state.field.length !== 0) {
|
|
2791
2791
|
if (x === !1) {
|
|
2792
2792
|
const A = this.__infoField(), Z = Object.keys(re).map(
|
|
@@ -2809,13 +2809,13 @@ 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, d +=
|
|
2812
|
+
this.state.quoting = !0, d += 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
|
-
|
|
2818
|
+
b,
|
|
2819
2819
|
d
|
|
2820
2820
|
);
|
|
2821
2821
|
if (A !== 0) {
|
|
@@ -2836,7 +2836,7 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
2836
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 (I !== -1 && this.info.records >= I) {
|
|
2840
2840
|
this.state.stop = !0, s();
|
|
2841
2841
|
return;
|
|
2842
2842
|
}
|
|
@@ -2846,11 +2846,11 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
2846
2846
|
}
|
|
2847
2847
|
if (this.state.commenting)
|
|
2848
2848
|
continue;
|
|
2849
|
-
if (_ !== null && (a === !1 || this.state.record.length === 0 && this.state.field.length === 0) && this.__compareBytes(_,
|
|
2849
|
+
if (_ !== null && (a === !1 || this.state.record.length === 0 && this.state.field.length === 0) && this.__compareBytes(_, b, d, O) !== 0) {
|
|
2850
2850
|
this.state.commenting = !0;
|
|
2851
2851
|
continue;
|
|
2852
2852
|
}
|
|
2853
|
-
const Z = this.__isDelimiter(
|
|
2853
|
+
const Z = this.__isDelimiter(b, d, O);
|
|
2854
2854
|
if (Z !== 0) {
|
|
2855
2855
|
this.info.bytes = this.state.bufBytesStart + d;
|
|
2856
2856
|
const j = this.__onField();
|
|
@@ -2874,11 +2874,11 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
2874
2874
|
this.__infoField()
|
|
2875
2875
|
)
|
|
2876
2876
|
);
|
|
2877
|
-
const J = c === !1 || this.state.quoting === !0 || this.state.field.length !== 0 || !this.__isCharTrimable(
|
|
2877
|
+
const J = c === !1 || this.state.quoting === !0 || this.state.field.length !== 0 || !this.__isCharTrimable(b, d), he = y === !1 || this.state.wasQuoting === !1;
|
|
2878
2878
|
if (J === !0 && he === !0)
|
|
2879
2879
|
this.state.field.append(O);
|
|
2880
2880
|
else {
|
|
2881
|
-
if (y === !0 && !this.__isCharTrimable(
|
|
2881
|
+
if (y === !0 && !this.__isCharTrimable(b, d))
|
|
2882
2882
|
return this.__error(
|
|
2883
2883
|
new w(
|
|
2884
2884
|
"CSV_NON_TRIMABLE_CHAR_AFTER_CLOSING_QUOTE",
|
|
@@ -2891,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 && (d += this.__isCharTrimable(
|
|
2894
|
+
J === !1 && (d += this.__isCharTrimable(b, d) - 1);
|
|
2895
2895
|
continue;
|
|
2896
2896
|
}
|
|
2897
2897
|
}
|
|
@@ -2917,7 +2917,7 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
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 += d, this.state.previousBuf =
|
|
2920
|
+
this.state.bufBytesStart += d, this.state.previousBuf = b.slice(d);
|
|
2921
2921
|
this.state.wasRowDelimiter === !0 && (this.info.lines++, this.state.wasRowDelimiter = !1);
|
|
2922
2922
|
},
|
|
2923
2923
|
__onRecord: function(n) {
|
|
@@ -2944,7 +2944,7 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
2944
2944
|
return this.__firstLineToColumns(y);
|
|
2945
2945
|
}
|
|
2946
2946
|
if (i === !1 && this.info.records === 0 && (this.state.expectedRecordLength = S), S !== this.state.expectedRecordLength) {
|
|
2947
|
-
const
|
|
2947
|
+
const I = i === !1 ? new w(
|
|
2948
2948
|
"CSV_RECORD_INCONSISTENT_FIELDS_LENGTH",
|
|
2949
2949
|
[
|
|
2950
2950
|
"Invalid Record Length:",
|
|
@@ -2971,10 +2971,10 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
2971
2971
|
}
|
|
2972
2972
|
);
|
|
2973
2973
|
if (l === !0 || h === !0 && S < this.state.expectedRecordLength || c === !0 && S > this.state.expectedRecordLength)
|
|
2974
|
-
this.info.invalid_field_length++, this.state.error =
|
|
2974
|
+
this.info.invalid_field_length++, this.state.error = I;
|
|
2975
2975
|
else {
|
|
2976
|
-
const
|
|
2977
|
-
if (
|
|
2976
|
+
const v = this.__error(I);
|
|
2977
|
+
if (v) return v;
|
|
2978
2978
|
}
|
|
2979
2979
|
}
|
|
2980
2980
|
if (m === !0 && lt(y)) {
|
|
@@ -2986,48 +2986,48 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
2986
2986
|
return;
|
|
2987
2987
|
}
|
|
2988
2988
|
if (this.info.records++, a === 1 || this.info.records >= a) {
|
|
2989
|
-
const { objname:
|
|
2989
|
+
const { objname: I } = this.options;
|
|
2990
2990
|
if (i !== !1) {
|
|
2991
|
-
const
|
|
2992
|
-
for (let _ = 0,
|
|
2993
|
-
i[_] === void 0 || i[_].disabled || (o === !0 &&
|
|
2991
|
+
const v = {};
|
|
2992
|
+
for (let _ = 0, R = y.length; _ < R; _++)
|
|
2993
|
+
i[_] === void 0 || i[_].disabled || (o === !0 && v[i[_].name] !== void 0 ? Array.isArray(v[i[_].name]) ? v[i[_].name] = v[i[_].name].concat(y[_]) : v[i[_].name] = [v[i[_].name], y[_]] : v[i[_].name] = y[_]);
|
|
2994
2994
|
if (p === !0 || f === !0) {
|
|
2995
2995
|
const _ = Object.assign(
|
|
2996
|
-
{ record:
|
|
2996
|
+
{ record: v },
|
|
2997
2997
|
p === !0 ? { raw: this.state.rawBuffer.toString(s) } : {},
|
|
2998
2998
|
f === !0 ? { info: this.__infoRecord() } : {}
|
|
2999
|
-
),
|
|
3000
|
-
|
|
2999
|
+
), R = this.__push(
|
|
3000
|
+
I === void 0 ? _ : [v[I], _],
|
|
3001
3001
|
n
|
|
3002
3002
|
);
|
|
3003
|
-
if (
|
|
3004
|
-
return
|
|
3003
|
+
if (R)
|
|
3004
|
+
return R;
|
|
3005
3005
|
} else {
|
|
3006
3006
|
const _ = this.__push(
|
|
3007
|
-
|
|
3007
|
+
I === void 0 ? v : [v[I], v],
|
|
3008
3008
|
n
|
|
3009
3009
|
);
|
|
3010
3010
|
if (_)
|
|
3011
3011
|
return _;
|
|
3012
3012
|
}
|
|
3013
3013
|
} else if (p === !0 || f === !0) {
|
|
3014
|
-
const
|
|
3014
|
+
const v = Object.assign(
|
|
3015
3015
|
{ record: y },
|
|
3016
3016
|
p === !0 ? { raw: this.state.rawBuffer.toString(s) } : {},
|
|
3017
3017
|
f === !0 ? { info: this.__infoRecord() } : {}
|
|
3018
3018
|
), _ = this.__push(
|
|
3019
|
-
|
|
3019
|
+
I === void 0 ? v : [y[I], v],
|
|
3020
3020
|
n
|
|
3021
3021
|
);
|
|
3022
3022
|
if (_)
|
|
3023
3023
|
return _;
|
|
3024
3024
|
} else {
|
|
3025
|
-
const
|
|
3026
|
-
|
|
3025
|
+
const v = this.__push(
|
|
3026
|
+
I === void 0 ? y : [y[I], y],
|
|
3027
3027
|
n
|
|
3028
3028
|
);
|
|
3029
|
-
if (
|
|
3030
|
-
return
|
|
3029
|
+
if (v)
|
|
3030
|
+
return v;
|
|
3031
3031
|
}
|
|
3032
3032
|
}
|
|
3033
3033
|
this.__resetRecord();
|
|
@@ -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 zn 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 zn(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 Vn extends Error {
|
|
3334
3334
|
locator;
|
|
3335
3335
|
/** Logical source of the error. */
|
|
3336
3336
|
constructor(e, r, n) {
|
|
3337
3337
|
super(e, n), this.name = new.target.name, this.locator = r;
|
|
3338
3338
|
}
|
|
3339
3339
|
}
|
|
3340
|
-
class Jn extends
|
|
3340
|
+
class Jn extends Vn {
|
|
3341
3341
|
}
|
|
3342
3342
|
class Yn extends Jn {
|
|
3343
3343
|
body;
|
|
@@ -3389,20 +3389,8 @@ class ri {
|
|
|
3389
3389
|
* Determine schema configuration.
|
|
3390
3390
|
*/
|
|
3391
3391
|
async determineSchemaConfig(e, r, n) {
|
|
3392
|
-
const i = Xn(r), { records: o, valueDelimiterId: s } = await Kn(r, n)
|
|
3393
|
-
|
|
3394
|
-
const c = e.parseRecord(a, h, !0);
|
|
3395
|
-
f.push(c);
|
|
3396
|
-
}
|
|
3397
|
-
const l = f[0];
|
|
3398
|
-
if (l) {
|
|
3399
|
-
const h = f.length;
|
|
3400
|
-
for (let c = 0; c < h; c++) {
|
|
3401
|
-
const p = l[c]?.originalValue ?? `Column ${c}`, m = a[c];
|
|
3402
|
-
m != null && (m.label = { en: p });
|
|
3403
|
-
}
|
|
3404
|
-
}
|
|
3405
|
-
return { columnConfigs: a, recordDelimiterId: i, records: f, valueDelimiterId: s };
|
|
3392
|
+
const i = Xn(r), { records: o, valueDelimiterId: s } = await Kn(r, n);
|
|
3393
|
+
return { columnConfigs: [], recordDelimiterId: i, records: [], valueDelimiterId: s };
|
|
3406
3394
|
}
|
|
3407
3395
|
/**
|
|
3408
3396
|
* Parse stream.
|
|
@@ -3423,34 +3411,37 @@ class ri {
|
|
|
3423
3411
|
c || (c = !0, m(), i.signal.aborted || i.abort(S), f(S));
|
|
3424
3412
|
};
|
|
3425
3413
|
(async () => {
|
|
3426
|
-
a = je(
|
|
3414
|
+
a = je({
|
|
3415
|
+
...r,
|
|
3416
|
+
cast: (R, F) => ({ value: R, isQuoted: F.quoting })
|
|
3417
|
+
}), h = ei({ chunk: o, chunkSize: e.chunkSize ?? Gn }), a.on("readable", () => {
|
|
3427
3418
|
try {
|
|
3428
3419
|
if (a == null || h == null) return;
|
|
3429
|
-
let
|
|
3430
|
-
for (; (
|
|
3420
|
+
let R;
|
|
3421
|
+
for (; (R = a.read()) != null; ) {
|
|
3431
3422
|
if (c) return;
|
|
3432
|
-
i.signal.throwIfAborted(), h.push(
|
|
3423
|
+
i.signal.throwIfAborted(), h.push(R);
|
|
3433
3424
|
}
|
|
3434
|
-
} catch (
|
|
3435
|
-
x(
|
|
3425
|
+
} catch (R) {
|
|
3426
|
+
x(R);
|
|
3436
3427
|
}
|
|
3437
|
-
}), a.on("error", (
|
|
3428
|
+
}), a.on("error", (R) => x(R)), a.on("end", () => {
|
|
3438
3429
|
c || (h?.flush(), s(ti(a)));
|
|
3439
3430
|
});
|
|
3440
3431
|
const S = await fetch(encodeURI(n), { signal: i.signal });
|
|
3441
3432
|
if (!S.ok || S.body == null)
|
|
3442
3433
|
throw await Wn(S, `Failed to fetch '${n}' file.`, "datapos-connector-file-store-emulator|Connector|retrieve");
|
|
3443
3434
|
l = S.body.getReader();
|
|
3444
|
-
const
|
|
3445
|
-
let
|
|
3446
|
-
for (; !
|
|
3435
|
+
const I = new TextDecoder(e.encodingId);
|
|
3436
|
+
let v = await l.read();
|
|
3437
|
+
for (; !v.done; ) {
|
|
3447
3438
|
if (c) return;
|
|
3448
3439
|
i.signal.throwIfAborted();
|
|
3449
|
-
const
|
|
3450
|
-
|
|
3440
|
+
const R = I.decode(v.value, { stream: !0 });
|
|
3441
|
+
R.length > 0 && a.write(R), v = await l.read();
|
|
3451
3442
|
}
|
|
3452
3443
|
if (c) return;
|
|
3453
|
-
const _ =
|
|
3444
|
+
const _ = I.decode();
|
|
3454
3445
|
_.length > 0 && a.write(_), a.end();
|
|
3455
3446
|
})().catch((S) => x(S));
|
|
3456
3447
|
});
|
|
@@ -3485,7 +3476,7 @@ async function Kn(t, e) {
|
|
|
3485
3476
|
}
|
|
3486
3477
|
}), c.on("error", () => p()), c.on("end", () => {
|
|
3487
3478
|
const x = f / l;
|
|
3488
|
-
|
|
3479
|
+
(!i || h <= i) && (!n || x > n) && (r = s, n = x, i = h, o = [...m]), p();
|
|
3489
3480
|
}), c.write(t), c.end();
|
|
3490
3481
|
} catch {
|
|
3491
3482
|
p();
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { Options as ParseOptions, Parser } from 'csv-parse/browser/esm';
|
|
2
2
|
import { EngineUtilities } from '@datapos/datapos-shared/engine';
|
|
3
3
|
import { ConnectionColumnConfig, RetrieveRecordsOptions, RetrieveRecordsSummary } from '@datapos/datapos-shared/component/connector';
|
|
4
|
-
import {
|
|
5
|
-
type StreamParsedRecord = string[];
|
|
4
|
+
import { ParseRecord, RecordDelimiterId, ValueDelimiterId } from '@datapos/datapos-shared/component/dataView';
|
|
6
5
|
/**
|
|
7
6
|
* Schema configuration.
|
|
8
7
|
*/
|
|
9
8
|
interface SchemaConfig {
|
|
10
9
|
columnConfigs: ConnectionColumnConfig[];
|
|
11
10
|
recordDelimiterId: RecordDelimiterId;
|
|
12
|
-
records:
|
|
11
|
+
records: ParseRecord[][];
|
|
13
12
|
valueDelimiterId: ValueDelimiterId;
|
|
14
13
|
}
|
|
15
14
|
/** Tool. */
|
|
@@ -23,7 +22,7 @@ declare class Tool {
|
|
|
23
22
|
/**
|
|
24
23
|
* Parse stream.
|
|
25
24
|
*/
|
|
26
|
-
parseStream(retrieveRecordsOptions: RetrieveRecordsOptions, parseOptions: ParseOptions, url: string, abortController: AbortController, chunk: (records:
|
|
25
|
+
parseStream(retrieveRecordsOptions: RetrieveRecordsOptions, parseOptions: ParseOptions, url: string, abortController: AbortController, chunk: (records: ParseRecord[]) => void): Promise<RetrieveRecordsSummary>;
|
|
27
26
|
}
|
|
28
27
|
export type { Options as ParseOptions, Parser } from 'csv-parse/browser/esm';
|
|
29
|
-
export { type
|
|
28
|
+
export { type SchemaConfig, Tool };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datapos/datapos-tool-csv-parse",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.84",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"private": false,
|
|
@@ -26,15 +26,15 @@
|
|
|
26
26
|
],
|
|
27
27
|
"prettier": "@datapos/datapos-development/prettierrc",
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@datapos/datapos-shared": "^0.3.
|
|
29
|
+
"@datapos/datapos-shared": "^0.3.465",
|
|
30
30
|
"csv-parse": "^6.1.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@datapos/datapos-development": "^0.3.438",
|
|
34
34
|
"@datapos/eslint-config-datapos": "^1.0.35",
|
|
35
35
|
"@types/node": "^25.0.3",
|
|
36
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
37
|
-
"@typescript-eslint/parser": "^8.
|
|
36
|
+
"@typescript-eslint/eslint-plugin": "^8.52.0",
|
|
37
|
+
"@typescript-eslint/parser": "^8.52.0",
|
|
38
38
|
"eslint": "^9.39.2",
|
|
39
39
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
40
40
|
"eslint-plugin-import": "^2.32.0",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"license-report": "^6.8.1",
|
|
47
47
|
"license-report-check": "^0.1.2",
|
|
48
48
|
"license-report-recursive": "^6.8.2",
|
|
49
|
-
"npm-check-updates": "^19.3.
|
|
49
|
+
"npm-check-updates": "^19.3.1",
|
|
50
50
|
"owasp-dependency-check": "^1.0.0",
|
|
51
51
|
"prettier": "^3.7.4",
|
|
52
52
|
"rollup-plugin-visualizer": "^6.0.5",
|