@datapos/datapos-tool-csv-parse 0.0.92 → 0.0.93
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 +260 -256
- package/package.json +2 -2
|
@@ -30,9 +30,9 @@ function Ze(t) {
|
|
|
30
30
|
o.push(Kt(t, f, f + s > a ? a : f + s));
|
|
31
31
|
return n === 1 ? (e = t[r - 1], i += P[e >> 2], i += P[e << 4 & 63], i += "==") : n === 2 && (e = (t[r - 2] << 8) + t[r - 1], i += P[e >> 10], i += P[e >> 4 & 63], i += P[e << 2 & 63], i += "="), o.push(i), o.join("");
|
|
32
32
|
}
|
|
33
|
-
function
|
|
34
|
-
var o, s, f = i * 8 - n - 1, a = (1 << f) - 1, l = a >> 1, h = -7, c = r ? i - 1 : 0, d = r ? -1 : 1,
|
|
35
|
-
for (c += d, o =
|
|
33
|
+
function ve(t, e, r, n, i) {
|
|
34
|
+
var o, s, f = i * 8 - n - 1, a = (1 << f) - 1, l = a >> 1, h = -7, c = r ? i - 1 : 0, d = r ? -1 : 1, g = t[e + c];
|
|
35
|
+
for (c += d, o = g & (1 << -h) - 1, g >>= -h, h += f; h > 0; o = o * 256 + t[e + c], c += d, h -= 8)
|
|
36
36
|
;
|
|
37
37
|
for (s = o & (1 << -h) - 1, o >>= -h, h += n; h > 0; s = s * 256 + t[e + c], c += d, h -= 8)
|
|
38
38
|
;
|
|
@@ -40,18 +40,18 @@ function be(t, e, r, n, i) {
|
|
|
40
40
|
o = 1 - l;
|
|
41
41
|
else {
|
|
42
42
|
if (o === a)
|
|
43
|
-
return s ? NaN : (
|
|
43
|
+
return s ? NaN : (g ? -1 : 1) * (1 / 0);
|
|
44
44
|
s = s + Math.pow(2, n), o = o - l;
|
|
45
45
|
}
|
|
46
|
-
return (
|
|
46
|
+
return (g ? -1 : 1) * s * Math.pow(2, o - n);
|
|
47
47
|
}
|
|
48
48
|
function ht(t, e, r, n, i, o) {
|
|
49
|
-
var s, f, a, l = o * 8 - i - 1, h = (1 << l) - 1, c = h >> 1, d = i === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0,
|
|
50
|
-
for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (f = isNaN(e) ? 1 : 0, s = h) : (s = Math.floor(Math.log(e) / Math.LN2), e * (a = Math.pow(2, -s)) < 1 && (s--, a *= 2), s + c >= 1 ? e += d / a : e += d * Math.pow(2, 1 - c), e * a >= 2 && (s++, a /= 2), s + c >= h ? (f = 0, s = h) : s + c >= 1 ? (f = (e * a - 1) * Math.pow(2, i), s = s + c) : (f = e * Math.pow(2, c - 1) * Math.pow(2, i), s = 0)); i >= 8; t[r +
|
|
49
|
+
var s, f, a, l = o * 8 - i - 1, h = (1 << l) - 1, c = h >> 1, d = i === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, g = n ? 0 : o - 1, x = n ? 1 : -1, _ = e < 0 || e === 0 && 1 / e < 0 ? 1 : 0;
|
|
50
|
+
for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (f = isNaN(e) ? 1 : 0, s = h) : (s = Math.floor(Math.log(e) / Math.LN2), e * (a = Math.pow(2, -s)) < 1 && (s--, a *= 2), s + c >= 1 ? e += d / a : e += d * Math.pow(2, 1 - c), e * a >= 2 && (s++, a /= 2), s + c >= h ? (f = 0, s = h) : s + c >= 1 ? (f = (e * a - 1) * Math.pow(2, i), s = s + c) : (f = e * Math.pow(2, c - 1) * Math.pow(2, i), s = 0)); i >= 8; t[r + g] = f & 255, g += x, 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 + g] = s & 255, g += x, s /= 256, l -= 8)
|
|
53
53
|
;
|
|
54
|
-
t[r +
|
|
54
|
+
t[r + g - x] |= _ * 128;
|
|
55
55
|
}
|
|
56
56
|
var er = {}.toString, dt = Array.isArray || function(t) {
|
|
57
57
|
return er.call(t) == "[object Array]";
|
|
@@ -91,20 +91,20 @@ u.from = function(t, e, r) {
|
|
|
91
91
|
return pt(null, t, e, r);
|
|
92
92
|
};
|
|
93
93
|
u.TYPED_ARRAY_SUPPORT && (u.prototype.__proto__ = Uint8Array.prototype, u.__proto__ = Uint8Array, typeof Symbol < "u" && Symbol.species && u[Symbol.species]);
|
|
94
|
-
function
|
|
94
|
+
function gt(t) {
|
|
95
95
|
if (typeof t != "number")
|
|
96
96
|
throw new TypeError('"size" argument must be a number');
|
|
97
97
|
if (t < 0)
|
|
98
98
|
throw new RangeError('"size" argument must not be negative');
|
|
99
99
|
}
|
|
100
100
|
function rr(t, e, r, n) {
|
|
101
|
-
return
|
|
101
|
+
return gt(e), e <= 0 ? q(t, e) : r !== void 0 ? typeof n == "string" ? q(t, e).fill(r, n) : q(t, e).fill(r) : q(t, e);
|
|
102
102
|
}
|
|
103
103
|
u.alloc = function(t, e, r) {
|
|
104
104
|
return rr(null, t, e, r);
|
|
105
105
|
};
|
|
106
106
|
function Ve(t, e) {
|
|
107
|
-
if (
|
|
107
|
+
if (gt(e), t = q(t, e < 0 ? 0 : ze(e) | 0), !u.TYPED_ARRAY_SUPPORT)
|
|
108
108
|
for (var r = 0; r < e; ++r)
|
|
109
109
|
t[r] = 0;
|
|
110
110
|
return t;
|
|
@@ -118,7 +118,7 @@ u.allocUnsafeSlow = function(t) {
|
|
|
118
118
|
function nr(t, e, r) {
|
|
119
119
|
if ((typeof r != "string" || r === "") && (r = "utf8"), !u.isEncoding(r))
|
|
120
120
|
throw new TypeError('"encoding" must be a valid string encoding');
|
|
121
|
-
var n =
|
|
121
|
+
var n = mt(e, r) | 0;
|
|
122
122
|
t = q(t, n);
|
|
123
123
|
var i = t.write(e, r);
|
|
124
124
|
return i !== n && (t = t.slice(0, i)), t;
|
|
@@ -206,7 +206,7 @@ u.concat = function(e, r) {
|
|
|
206
206
|
}
|
|
207
207
|
return i;
|
|
208
208
|
};
|
|
209
|
-
function
|
|
209
|
+
function mt(t, e) {
|
|
210
210
|
if ($(t))
|
|
211
211
|
return t.length;
|
|
212
212
|
if (typeof ArrayBuffer < "u" && typeof ArrayBuffer.isView == "function" && (ArrayBuffer.isView(t) || t instanceof ArrayBuffer))
|
|
@@ -238,7 +238,7 @@ function gt(t, e) {
|
|
|
238
238
|
e = ("" + e).toLowerCase(), n = !0;
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
|
-
u.byteLength =
|
|
241
|
+
u.byteLength = mt;
|
|
242
242
|
function sr(t, e, r) {
|
|
243
243
|
var n = !1;
|
|
244
244
|
if ((e === void 0 || e < 0) && (e = 0), e > this.length || ((r === void 0 || r > this.length) && (r = this.length), r <= 0) || (r >>>= 0, e >>>= 0, r <= e))
|
|
@@ -246,7 +246,7 @@ function sr(t, e, r) {
|
|
|
246
246
|
for (t || (t = "utf8"); ; )
|
|
247
247
|
switch (t) {
|
|
248
248
|
case "hex":
|
|
249
|
-
return
|
|
249
|
+
return mr(this, e, r);
|
|
250
250
|
case "utf8":
|
|
251
251
|
case "utf-8":
|
|
252
252
|
return yt(this, e, r);
|
|
@@ -254,7 +254,7 @@ function sr(t, e, r) {
|
|
|
254
254
|
return pr(this, e, r);
|
|
255
255
|
case "latin1":
|
|
256
256
|
case "binary":
|
|
257
|
-
return
|
|
257
|
+
return gr(this, e, r);
|
|
258
258
|
case "base64":
|
|
259
259
|
return hr(this, e, r);
|
|
260
260
|
case "ucs2":
|
|
@@ -348,8 +348,8 @@ function Xe(t, e, r, n, i) {
|
|
|
348
348
|
return -1;
|
|
349
349
|
o = 2, s /= 2, f /= 2, r /= 2;
|
|
350
350
|
}
|
|
351
|
-
function a(
|
|
352
|
-
return o === 1 ?
|
|
351
|
+
function a(g, x) {
|
|
352
|
+
return o === 1 ? g[x] : g.readUInt16BE(x * o);
|
|
353
353
|
}
|
|
354
354
|
var l;
|
|
355
355
|
if (i) {
|
|
@@ -499,18 +499,18 @@ function pr(t, e, r) {
|
|
|
499
499
|
n += String.fromCharCode(t[i] & 127);
|
|
500
500
|
return n;
|
|
501
501
|
}
|
|
502
|
-
function
|
|
502
|
+
function gr(t, e, r) {
|
|
503
503
|
var n = "";
|
|
504
504
|
r = Math.min(t.length, r);
|
|
505
505
|
for (var i = e; i < r; ++i)
|
|
506
506
|
n += String.fromCharCode(t[i]);
|
|
507
507
|
return n;
|
|
508
508
|
}
|
|
509
|
-
function
|
|
509
|
+
function mr(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) {
|
|
@@ -595,16 +595,16 @@ u.prototype.readInt32BE = function(e, r) {
|
|
|
595
595
|
return r || L(e, 4, this.length), this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3];
|
|
596
596
|
};
|
|
597
597
|
u.prototype.readFloatLE = function(e, r) {
|
|
598
|
-
return r || L(e, 4, this.length),
|
|
598
|
+
return r || L(e, 4, this.length), ve(this, e, !0, 23, 4);
|
|
599
599
|
};
|
|
600
600
|
u.prototype.readFloatBE = function(e, r) {
|
|
601
|
-
return r || L(e, 4, this.length),
|
|
601
|
+
return r || L(e, 4, this.length), ve(this, e, !1, 23, 4);
|
|
602
602
|
};
|
|
603
603
|
u.prototype.readDoubleLE = function(e, r) {
|
|
604
|
-
return r || L(e, 8, this.length),
|
|
604
|
+
return r || L(e, 8, this.length), ve(this, e, !0, 52, 8);
|
|
605
605
|
};
|
|
606
606
|
u.prototype.readDoubleBE = function(e, r) {
|
|
607
|
-
return r || L(e, 8, this.length),
|
|
607
|
+
return r || L(e, 8, this.length), ve(this, e, !1, 52, 8);
|
|
608
608
|
};
|
|
609
609
|
function N(t, e, r, n, i, o) {
|
|
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) {
|
|
@@ -859,27 +859,27 @@ var Ce;
|
|
|
859
859
|
function H() {
|
|
860
860
|
}
|
|
861
861
|
H.prototype = /* @__PURE__ */ Object.create(null);
|
|
862
|
-
function
|
|
863
|
-
|
|
864
|
-
}
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
this.domain = null,
|
|
873
|
-
};
|
|
874
|
-
|
|
862
|
+
function m() {
|
|
863
|
+
m.init.call(this);
|
|
864
|
+
}
|
|
865
|
+
m.EventEmitter = m;
|
|
866
|
+
m.usingDomains = !1;
|
|
867
|
+
m.prototype.domain = void 0;
|
|
868
|
+
m.prototype._events = void 0;
|
|
869
|
+
m.prototype._maxListeners = void 0;
|
|
870
|
+
m.defaultMaxListeners = 10;
|
|
871
|
+
m.init = function() {
|
|
872
|
+
this.domain = null, m.usingDomains && Ce.active && !(this instanceof Ce.Domain) && (this.domain = Ce.active), (!this._events || this._events === Object.getPrototypeOf(this)._events) && (this._events = new H(), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;
|
|
873
|
+
};
|
|
874
|
+
m.prototype.setMaxListeners = function(e) {
|
|
875
875
|
if (typeof e != "number" || e < 0 || isNaN(e))
|
|
876
876
|
throw new TypeError('"n" argument must be a positive number');
|
|
877
877
|
return this._maxListeners = e, this;
|
|
878
878
|
};
|
|
879
879
|
function Rt(t) {
|
|
880
|
-
return t._maxListeners === void 0 ?
|
|
880
|
+
return t._maxListeners === void 0 ? m.defaultMaxListeners : t._maxListeners;
|
|
881
881
|
}
|
|
882
|
-
|
|
882
|
+
m.prototype.getMaxListeners = function() {
|
|
883
883
|
return Rt(this);
|
|
884
884
|
};
|
|
885
885
|
function Ir(t, e, r) {
|
|
@@ -917,7 +917,7 @@ function Lr(t, e, r, n) {
|
|
|
917
917
|
for (var i = t.length, o = ae(t, i), s = 0; s < i; ++s)
|
|
918
918
|
o[s].apply(r, n);
|
|
919
919
|
}
|
|
920
|
-
|
|
920
|
+
m.prototype.emit = function(e) {
|
|
921
921
|
var r, n, i, o, s, f, a, l = e === "error";
|
|
922
922
|
if (f = this._events, f)
|
|
923
923
|
l = l && f.error == null;
|
|
@@ -979,11 +979,11 @@ function It(t, e, r, n) {
|
|
|
979
979
|
function Tr(t) {
|
|
980
980
|
typeof console.warn == "function" ? console.warn(t) : console.log(t);
|
|
981
981
|
}
|
|
982
|
-
|
|
982
|
+
m.prototype.addListener = function(e, r) {
|
|
983
983
|
return It(this, e, r, !1);
|
|
984
984
|
};
|
|
985
|
-
|
|
986
|
-
|
|
985
|
+
m.prototype.on = m.prototype.addListener;
|
|
986
|
+
m.prototype.prependListener = function(e, r) {
|
|
987
987
|
return It(this, e, r, !0);
|
|
988
988
|
};
|
|
989
989
|
function Ct(t, e, r) {
|
|
@@ -993,17 +993,17 @@ function Ct(t, e, r) {
|
|
|
993
993
|
}
|
|
994
994
|
return i.listener = r, i;
|
|
995
995
|
}
|
|
996
|
-
|
|
996
|
+
m.prototype.once = function(e, r) {
|
|
997
997
|
if (typeof r != "function")
|
|
998
998
|
throw new TypeError('"listener" argument must be a function');
|
|
999
999
|
return this.on(e, Ct(this, e, r)), this;
|
|
1000
1000
|
};
|
|
1001
|
-
|
|
1001
|
+
m.prototype.prependOnceListener = function(e, r) {
|
|
1002
1002
|
if (typeof r != "function")
|
|
1003
1003
|
throw new TypeError('"listener" argument must be a function');
|
|
1004
1004
|
return this.prependListener(e, Ct(this, e, r)), this;
|
|
1005
1005
|
};
|
|
1006
|
-
|
|
1006
|
+
m.prototype.removeListener = function(e, r) {
|
|
1007
1007
|
var n, i, o, s, f;
|
|
1008
1008
|
if (typeof r != "function")
|
|
1009
1009
|
throw new TypeError('"listener" argument must be a function');
|
|
@@ -1031,7 +1031,7 @@ g.prototype.removeListener = function(e, r) {
|
|
|
1031
1031
|
}
|
|
1032
1032
|
return this;
|
|
1033
1033
|
};
|
|
1034
|
-
|
|
1034
|
+
m.prototype.removeAllListeners = function(e) {
|
|
1035
1035
|
var r, n;
|
|
1036
1036
|
if (n = this._events, !n)
|
|
1037
1037
|
return this;
|
|
@@ -1050,14 +1050,14 @@ g.prototype.removeAllListeners = function(e) {
|
|
|
1050
1050
|
while (r[0]);
|
|
1051
1051
|
return this;
|
|
1052
1052
|
};
|
|
1053
|
-
|
|
1053
|
+
m.prototype.listeners = function(e) {
|
|
1054
1054
|
var r, n, i = this._events;
|
|
1055
1055
|
return i ? (r = i[e], r ? typeof r == "function" ? n = [r.listener || r] : n = Nr(r) : n = []) : n = [], n;
|
|
1056
1056
|
};
|
|
1057
|
-
|
|
1057
|
+
m.listenerCount = function(t, e) {
|
|
1058
1058
|
return typeof t.listenerCount == "function" ? t.listenerCount(e) : Ot.call(t, e);
|
|
1059
1059
|
};
|
|
1060
|
-
|
|
1060
|
+
m.prototype.listenerCount = Ot;
|
|
1061
1061
|
function Ot(t) {
|
|
1062
1062
|
var e = this._events;
|
|
1063
1063
|
if (e) {
|
|
@@ -1069,7 +1069,7 @@ function Ot(t) {
|
|
|
1069
1069
|
}
|
|
1070
1070
|
return 0;
|
|
1071
1071
|
}
|
|
1072
|
-
|
|
1072
|
+
m.prototype.eventNames = function() {
|
|
1073
1073
|
return this._eventsCount > 0 ? Reflect.ownKeys(this._events) : [];
|
|
1074
1074
|
};
|
|
1075
1075
|
function Dr(t, e) {
|
|
@@ -1126,18 +1126,18 @@ function Fr(t) {
|
|
|
1126
1126
|
}
|
|
1127
1127
|
}
|
|
1128
1128
|
}
|
|
1129
|
-
var V = [], ne = !1, ee,
|
|
1129
|
+
var V = [], ne = !1, ee, ge = -1;
|
|
1130
1130
|
function Mr() {
|
|
1131
|
-
!ne || !ee || (ne = !1, ee.length ? V = ee.concat(V) :
|
|
1131
|
+
!ne || !ee || (ne = !1, ee.length ? V = ee.concat(V) : ge = -1, V.length && Dt());
|
|
1132
1132
|
}
|
|
1133
1133
|
function Dt() {
|
|
1134
1134
|
if (!ne) {
|
|
1135
1135
|
var t = Tt(Mr);
|
|
1136
1136
|
ne = !0;
|
|
1137
1137
|
for (var e = V.length; e; ) {
|
|
1138
|
-
for (ee = V, V = []; ++
|
|
1139
|
-
ee && ee[
|
|
1140
|
-
|
|
1138
|
+
for (ee = V, V = []; ++ge < e; )
|
|
1139
|
+
ee && ee[ge].run();
|
|
1140
|
+
ge = -1, e = V.length;
|
|
1141
1141
|
}
|
|
1142
1142
|
ee = null, ne = !1, Fr(t);
|
|
1143
1143
|
}
|
|
@@ -1157,7 +1157,7 @@ Nt.prototype.run = function() {
|
|
|
1157
1157
|
};
|
|
1158
1158
|
var Br = {}, se = ie.performance || {};
|
|
1159
1159
|
se.now || se.mozNow || se.msNow || se.oNow || se.webkitNow;
|
|
1160
|
-
var
|
|
1160
|
+
var me = {
|
|
1161
1161
|
env: Br
|
|
1162
1162
|
}, ke;
|
|
1163
1163
|
typeof Object.create == "function" ? ke = function(e, r) {
|
|
@@ -1208,14 +1208,14 @@ function Ft(t, e) {
|
|
|
1208
1208
|
return function() {
|
|
1209
1209
|
return Ft(t, e).apply(this, arguments);
|
|
1210
1210
|
};
|
|
1211
|
-
if (
|
|
1211
|
+
if (me.noDeprecation === !0)
|
|
1212
1212
|
return t;
|
|
1213
1213
|
var r = !1;
|
|
1214
1214
|
function n() {
|
|
1215
1215
|
if (!r) {
|
|
1216
|
-
if (
|
|
1216
|
+
if (me.throwDeprecation)
|
|
1217
1217
|
throw new Error(e);
|
|
1218
|
-
|
|
1218
|
+
me.traceDeprecation ? console.trace(e) : console.error(e), r = !0;
|
|
1219
1219
|
}
|
|
1220
1220
|
return t.apply(this, arguments);
|
|
1221
1221
|
}
|
|
@@ -1223,7 +1223,7 @@ function Ft(t, e) {
|
|
|
1223
1223
|
}
|
|
1224
1224
|
var pe = {}, Oe;
|
|
1225
1225
|
function Pr(t) {
|
|
1226
|
-
if (Q(Oe) && (Oe =
|
|
1226
|
+
if (Q(Oe) && (Oe = me.env.NODE_DEBUG || ""), t = t.toUpperCase(), !pe[t])
|
|
1227
1227
|
if (new RegExp("\\b" + t + "\\b", "i").test(Oe)) {
|
|
1228
1228
|
var e = 0;
|
|
1229
1229
|
pe[t] = function() {
|
|
@@ -1317,8 +1317,8 @@ function ye(t, e, r) {
|
|
|
1317
1317
|
return Le(e) ? t.stylize(RegExp.prototype.toString.call(e), "regexp") : t.stylize("[Object]", "special");
|
|
1318
1318
|
t.seen.push(e);
|
|
1319
1319
|
var d;
|
|
1320
|
-
return l ? d = zr(t, e, r, s, o) : d = o.map(function(
|
|
1321
|
-
return Pe(t, e, r, s,
|
|
1320
|
+
return l ? d = zr(t, e, r, s, o) : d = o.map(function(g) {
|
|
1321
|
+
return Pe(t, e, r, s, g, l);
|
|
1322
1322
|
}), t.seen.pop(), Jr(d, a, h);
|
|
1323
1323
|
}
|
|
1324
1324
|
function Vr(t, e) {
|
|
@@ -1566,8 +1566,8 @@ function Kr(t) {
|
|
|
1566
1566
|
this.charReceived = t.length % 3, this.charLength = this.charReceived ? 3 : 0;
|
|
1567
1567
|
}
|
|
1568
1568
|
C.ReadableState = Ut;
|
|
1569
|
-
var
|
|
1570
|
-
oe(C,
|
|
1569
|
+
var E = Pr("stream");
|
|
1570
|
+
oe(C, m);
|
|
1571
1571
|
function en(t, e, r) {
|
|
1572
1572
|
if (typeof t.prependListener == "function")
|
|
1573
1573
|
return t.prependListener(e, r);
|
|
@@ -1583,7 +1583,7 @@ function Ut(t, e) {
|
|
|
1583
1583
|
}
|
|
1584
1584
|
function C(t) {
|
|
1585
1585
|
if (!(this instanceof C)) return new C(t);
|
|
1586
|
-
this._readableState = new Ut(t, this), this.readable = !0, t && typeof t.read == "function" && (this._read = t.read),
|
|
1586
|
+
this._readableState = new Ut(t, this), this.readable = !0, t && typeof t.read == "function" && (this._read = t.read), m.call(this);
|
|
1587
1587
|
}
|
|
1588
1588
|
C.prototype.push = function(t, e) {
|
|
1589
1589
|
var r = this._readableState;
|
|
@@ -1630,14 +1630,14 @@ function rt(t, e) {
|
|
|
1630
1630
|
return t <= 0 || e.length === 0 && e.ended ? 0 : e.objectMode ? 1 : t !== t ? e.flowing && e.length ? e.buffer.head.data.length : e.length : (t > e.highWaterMark && (e.highWaterMark = nn(t)), t <= e.length ? t : e.ended ? e.length : (e.needReadable = !0, 0));
|
|
1631
1631
|
}
|
|
1632
1632
|
C.prototype.read = function(t) {
|
|
1633
|
-
|
|
1633
|
+
E("read", t), t = parseInt(t, 10);
|
|
1634
1634
|
var e = this._readableState, r = t;
|
|
1635
1635
|
if (t !== 0 && (e.emittedReadable = !1), t === 0 && e.needReadable && (e.length >= e.highWaterMark || e.ended))
|
|
1636
|
-
return
|
|
1636
|
+
return E("read: emitReadable", e.length, e.ended), e.length === 0 && e.ended ? Ne(this) : Se(this), null;
|
|
1637
1637
|
if (t = rt(t, e), t === 0 && e.ended)
|
|
1638
1638
|
return e.length === 0 && Ne(this), null;
|
|
1639
1639
|
var n = e.needReadable;
|
|
1640
|
-
|
|
1640
|
+
E("need readable", n), (e.length === 0 || e.length - t < e.highWaterMark) && (n = !0, E("length less than watermark", n)), e.ended || e.reading ? (n = !1, E("reading or ended", n)) : n && (E("do read"), e.reading = !0, e.sync = !0, e.length === 0 && (e.needReadable = !0), this._read(e.highWaterMark), e.sync = !1, e.reading || (t = rt(r, e)));
|
|
1641
1641
|
var i;
|
|
1642
1642
|
return t > 0 ? i = Pt(t, e) : i = null, i === null ? (e.needReadable = !0, t = 0) : e.length -= t, e.length === 0 && (e.ended || (e.needReadable = !0), r !== t && e.ended && Ne(this)), i !== null && this.emit("data", i), i;
|
|
1643
1643
|
};
|
|
@@ -1656,16 +1656,16 @@ function sn(t, e) {
|
|
|
1656
1656
|
}
|
|
1657
1657
|
function Se(t) {
|
|
1658
1658
|
var e = t._readableState;
|
|
1659
|
-
e.needReadable = !1, e.emittedReadable || (
|
|
1659
|
+
e.needReadable = !1, e.emittedReadable || (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
1665
|
e.readingMore || (e.readingMore = !0, U(an, t, e));
|
|
1666
1666
|
}
|
|
1667
1667
|
function an(t, e) {
|
|
1668
|
-
for (var r = e.length; !e.reading && !e.flowing && !e.ended && e.length < e.highWaterMark && (
|
|
1668
|
+
for (var r = e.length; !e.reading && !e.flowing && !e.ended && e.length < e.highWaterMark && (E("maybeReadMore read 0"), t.read(0), r !== e.length); )
|
|
1669
1669
|
r = e.length;
|
|
1670
1670
|
e.readingMore = !1;
|
|
1671
1671
|
}
|
|
@@ -1685,49 +1685,49 @@ C.prototype.pipe = function(t, e) {
|
|
|
1685
1685
|
n.pipes.push(t);
|
|
1686
1686
|
break;
|
|
1687
1687
|
}
|
|
1688
|
-
n.pipesCount += 1,
|
|
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
1690
|
n.endEmitted ? U(o) : r.once("end", o), t.on("unpipe", s);
|
|
1691
1691
|
function s(I) {
|
|
1692
|
-
|
|
1692
|
+
E("onunpipe"), I === r && h();
|
|
1693
1693
|
}
|
|
1694
1694
|
function f() {
|
|
1695
|
-
|
|
1695
|
+
E("onend"), t.end();
|
|
1696
1696
|
}
|
|
1697
1697
|
var a = un(r);
|
|
1698
1698
|
t.on("drain", a);
|
|
1699
1699
|
var l = !1;
|
|
1700
1700
|
function h() {
|
|
1701
|
-
|
|
1701
|
+
E("cleanup"), t.removeListener("close", x), t.removeListener("finish", _), t.removeListener("drain", a), t.removeListener("error", g), t.removeListener("unpipe", s), r.removeListener("end", f), r.removeListener("end", h), r.removeListener("data", d), l = !0, n.awaitDrain && (!t._writableState || t._writableState.needDrain) && a();
|
|
1702
1702
|
}
|
|
1703
1703
|
var c = !1;
|
|
1704
1704
|
r.on("data", d);
|
|
1705
1705
|
function d(I) {
|
|
1706
|
-
|
|
1707
|
-
var
|
|
1708
|
-
|
|
1706
|
+
E("ondata"), c = !1;
|
|
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
|
|
1711
|
-
|
|
1710
|
+
function g(I) {
|
|
1711
|
+
E("onerror", I), S(), t.removeListener("error", g), tn(t, "error") === 0 && t.emit("error", I);
|
|
1712
1712
|
}
|
|
1713
|
-
en(t, "error",
|
|
1714
|
-
function
|
|
1715
|
-
t.removeListener("finish",
|
|
1713
|
+
en(t, "error", g);
|
|
1714
|
+
function x() {
|
|
1715
|
+
t.removeListener("finish", _), S();
|
|
1716
1716
|
}
|
|
1717
|
-
t.once("close",
|
|
1718
|
-
function
|
|
1719
|
-
|
|
1717
|
+
t.once("close", x);
|
|
1718
|
+
function _() {
|
|
1719
|
+
E("onfinish"), t.removeListener("close", x), S();
|
|
1720
1720
|
}
|
|
1721
|
-
t.once("finish",
|
|
1721
|
+
t.once("finish", _);
|
|
1722
1722
|
function S() {
|
|
1723
|
-
|
|
1723
|
+
E("unpipe"), r.unpipe(t);
|
|
1724
1724
|
}
|
|
1725
|
-
return t.emit("pipe", r), n.flowing || (
|
|
1725
|
+
return t.emit("pipe", r), n.flowing || (E("pipe resume"), r.resume()), t;
|
|
1726
1726
|
};
|
|
1727
1727
|
function un(t) {
|
|
1728
1728
|
return function() {
|
|
1729
1729
|
var e = t._readableState;
|
|
1730
|
-
|
|
1730
|
+
E("pipeOnDrain", e.awaitDrain), e.awaitDrain && e.awaitDrain--, e.awaitDrain === 0 && t.listeners("data").length && (e.flowing = !0, Qe(t));
|
|
1731
1731
|
};
|
|
1732
1732
|
}
|
|
1733
1733
|
C.prototype.unpipe = function(t) {
|
|
@@ -1746,7 +1746,7 @@ C.prototype.unpipe = function(t) {
|
|
|
1746
1746
|
return o === -1 ? this : (e.pipes.splice(o, 1), e.pipesCount -= 1, e.pipesCount === 1 && (e.pipes = e.pipes[0]), t.emit("unpipe", this), this);
|
|
1747
1747
|
};
|
|
1748
1748
|
C.prototype.on = function(t, e) {
|
|
1749
|
-
var r =
|
|
1749
|
+
var r = m.prototype.on.call(this, t, e);
|
|
1750
1750
|
if (t === "data")
|
|
1751
1751
|
this._readableState.flowing !== !1 && this.resume();
|
|
1752
1752
|
else if (t === "readable") {
|
|
@@ -1757,36 +1757,36 @@ C.prototype.on = function(t, e) {
|
|
|
1757
1757
|
};
|
|
1758
1758
|
C.prototype.addListener = C.prototype.on;
|
|
1759
1759
|
function ln(t) {
|
|
1760
|
-
|
|
1760
|
+
E("readable nexttick read 0"), t.read(0);
|
|
1761
1761
|
}
|
|
1762
1762
|
C.prototype.resume = function() {
|
|
1763
1763
|
var t = this._readableState;
|
|
1764
|
-
return t.flowing || (
|
|
1764
|
+
return t.flowing || (E("resume"), t.flowing = !0, cn(this, t)), this;
|
|
1765
1765
|
};
|
|
1766
1766
|
function cn(t, e) {
|
|
1767
1767
|
e.resumeScheduled || (e.resumeScheduled = !0, U(hn, t, e));
|
|
1768
1768
|
}
|
|
1769
1769
|
function hn(t, e) {
|
|
1770
|
-
e.reading || (
|
|
1770
|
+
e.reading || (E("resume read 0"), t.read(0)), e.resumeScheduled = !1, e.awaitDrain = 0, t.emit("resume"), Qe(t), e.flowing && !e.reading && t.read(0);
|
|
1771
1771
|
}
|
|
1772
1772
|
C.prototype.pause = function() {
|
|
1773
|
-
return
|
|
1773
|
+
return E("call pause flowing=%j", this._readableState.flowing), this._readableState.flowing !== !1 && (E("pause"), this._readableState.flowing = !1, this.emit("pause")), this;
|
|
1774
1774
|
};
|
|
1775
1775
|
function Qe(t) {
|
|
1776
1776
|
var e = t._readableState;
|
|
1777
|
-
for (
|
|
1777
|
+
for (E("flow", e.flowing); e.flowing && t.read() !== null; )
|
|
1778
1778
|
;
|
|
1779
1779
|
}
|
|
1780
1780
|
C.prototype.wrap = function(t) {
|
|
1781
1781
|
var e = this._readableState, r = !1, n = this;
|
|
1782
1782
|
t.on("end", function() {
|
|
1783
|
-
if (
|
|
1783
|
+
if (E("wrapped end"), e.decoder && !e.ended) {
|
|
1784
1784
|
var s = e.decoder.end();
|
|
1785
1785
|
s && s.length && n.push(s);
|
|
1786
1786
|
}
|
|
1787
1787
|
n.push(null);
|
|
1788
1788
|
}), t.on("data", function(s) {
|
|
1789
|
-
if (
|
|
1789
|
+
if (E("wrapped data"), e.decoder && (s = e.decoder.write(s)), !(e.objectMode && s == null) && !(!e.objectMode && (!s || !s.length))) {
|
|
1790
1790
|
var f = n.push(s);
|
|
1791
1791
|
f || (r = !0, t.pause());
|
|
1792
1792
|
}
|
|
@@ -1801,7 +1801,7 @@ C.prototype.wrap = function(t) {
|
|
|
1801
1801
|
return _n(o, function(s) {
|
|
1802
1802
|
t.on(s, n.emit.bind(n, s));
|
|
1803
1803
|
}), n._read = function(s) {
|
|
1804
|
-
|
|
1804
|
+
E("wrapped _read", s), r && (r = !1, t.resume());
|
|
1805
1805
|
}, n;
|
|
1806
1806
|
};
|
|
1807
1807
|
C._fromList = Pt;
|
|
@@ -1812,7 +1812,7 @@ function Pt(t, e) {
|
|
|
1812
1812
|
}
|
|
1813
1813
|
function dn(t, e, r) {
|
|
1814
1814
|
var n;
|
|
1815
|
-
return t < e.head.data.length ? (n = e.head.data.slice(0, t), e.head.data = e.head.data.slice(t)) : t === e.head.data.length ? n = e.shift() : n = r ? pn(t, e) :
|
|
1815
|
+
return t < e.head.data.length ? (n = e.head.data.slice(0, t), e.head.data = e.head.data.slice(t)) : t === e.head.data.length ? n = e.shift() : n = r ? pn(t, e) : gn(t, e), n;
|
|
1816
1816
|
}
|
|
1817
1817
|
function pn(t, e) {
|
|
1818
1818
|
var r = e.head, n = 1, i = r.data;
|
|
@@ -1826,7 +1826,7 @@ function pn(t, e) {
|
|
|
1826
1826
|
}
|
|
1827
1827
|
return e.length -= n, i;
|
|
1828
1828
|
}
|
|
1829
|
-
function
|
|
1829
|
+
function gn(t, e) {
|
|
1830
1830
|
var r = u.allocUnsafe(t), n = e.head, i = 1;
|
|
1831
1831
|
for (n.data.copy(r), t -= n.data.length; n = n.next; ) {
|
|
1832
1832
|
var o = n.data, s = t > o.length ? o.length : t;
|
|
@@ -1841,9 +1841,9 @@ 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, U(
|
|
1844
|
+
e.endEmitted || (e.ended = !0, U(mn, e, t));
|
|
1845
1845
|
}
|
|
1846
|
-
function
|
|
1846
|
+
function mn(t, e) {
|
|
1847
1847
|
!t.endEmitted && t.length === 0 && (t.endEmitted = !0, e.readable = !1, e.emit("end"));
|
|
1848
1848
|
}
|
|
1849
1849
|
function _n(t, e) {
|
|
@@ -1856,7 +1856,7 @@ function $t(t, e) {
|
|
|
1856
1856
|
return -1;
|
|
1857
1857
|
}
|
|
1858
1858
|
T.WritableState = He;
|
|
1859
|
-
oe(T,
|
|
1859
|
+
oe(T, m);
|
|
1860
1860
|
function wn() {
|
|
1861
1861
|
}
|
|
1862
1862
|
function yn(t, e, r) {
|
|
@@ -1882,22 +1882,22 @@ He.prototype.getBuffer = function() {
|
|
|
1882
1882
|
};
|
|
1883
1883
|
function T(t) {
|
|
1884
1884
|
if (!(this instanceof T) && !(this instanceof B)) return new T(t);
|
|
1885
|
-
this._writableState = new He(t, this), this.writable = !0, t && (typeof t.write == "function" && (this._write = t.write), typeof t.writev == "function" && (this._writev = t.writev)),
|
|
1885
|
+
this._writableState = new He(t, this), this.writable = !0, t && (typeof t.write == "function" && (this._write = t.write), typeof t.writev == "function" && (this._writev = t.writev)), m.call(this);
|
|
1886
1886
|
}
|
|
1887
1887
|
T.prototype.pipe = function() {
|
|
1888
1888
|
this.emit("error", new Error("Cannot pipe, not readable"));
|
|
1889
1889
|
};
|
|
1890
|
-
function
|
|
1890
|
+
function vn(t, e) {
|
|
1891
1891
|
var r = new Error("write after end");
|
|
1892
1892
|
t.emit("error", r), U(e, r);
|
|
1893
1893
|
}
|
|
1894
|
-
function
|
|
1894
|
+
function bn(t, e, r, n) {
|
|
1895
1895
|
var i = !0, o = !1;
|
|
1896
1896
|
return r === null ? o = new TypeError("May not write null values to stream") : !u.isBuffer(r) && typeof r != "string" && r !== void 0 && !e.objectMode && (o = new TypeError("Invalid non-string/buffer chunk")), o && (t.emit("error", o), U(n, o), i = !1), i;
|
|
1897
1897
|
}
|
|
1898
1898
|
T.prototype.write = function(t, e, r) {
|
|
1899
1899
|
var n = this._writableState, i = !1;
|
|
1900
|
-
return typeof e == "function" && (r = e, e = null), u.isBuffer(t) ? e = "buffer" : e || (e = n.defaultEncoding), typeof r != "function" && (r = wn), n.ended ?
|
|
1900
|
+
return typeof e == "function" && (r = e, e = null), u.isBuffer(t) ? e = "buffer" : e || (e = n.defaultEncoding), typeof r != "function" && (r = wn), n.ended ? vn(this, r) : bn(this, n, t, r) && (n.pendingcb++, i = xn(this, n, t, e, r)), i;
|
|
1901
1901
|
};
|
|
1902
1902
|
T.prototype.cork = function() {
|
|
1903
1903
|
var t = this._writableState;
|
|
@@ -2073,7 +2073,7 @@ function fe(t) {
|
|
|
2073
2073
|
fe.prototype._transform = function(t, e, r) {
|
|
2074
2074
|
r(null, t);
|
|
2075
2075
|
};
|
|
2076
|
-
oe(z,
|
|
2076
|
+
oe(z, m);
|
|
2077
2077
|
z.Readable = C;
|
|
2078
2078
|
z.Writable = T;
|
|
2079
2079
|
z.Duplex = B;
|
|
@@ -2081,7 +2081,7 @@ z.Transform = k;
|
|
|
2081
2081
|
z.PassThrough = fe;
|
|
2082
2082
|
z.Stream = z;
|
|
2083
2083
|
function z() {
|
|
2084
|
-
|
|
2084
|
+
m.call(this);
|
|
2085
2085
|
}
|
|
2086
2086
|
z.prototype.pipe = function(t, e) {
|
|
2087
2087
|
var r = this;
|
|
@@ -2101,7 +2101,7 @@ z.prototype.pipe = function(t, e) {
|
|
|
2101
2101
|
o || (o = !0, typeof t.destroy == "function" && t.destroy());
|
|
2102
2102
|
}
|
|
2103
2103
|
function a(h) {
|
|
2104
|
-
if (l(),
|
|
2104
|
+
if (l(), m.listenerCount(this, "error") === 0)
|
|
2105
2105
|
throw h;
|
|
2106
2106
|
}
|
|
2107
2107
|
r.on("error", a), t.on("error", a);
|
|
@@ -2113,9 +2113,9 @@ z.prototype.pipe = function(t, e) {
|
|
|
2113
2113
|
const Jt = function(t) {
|
|
2114
2114
|
return typeof t == "object" && t !== null && !Array.isArray(t);
|
|
2115
2115
|
};
|
|
2116
|
-
class
|
|
2116
|
+
class y 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, y), 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 Yt = function(t) {
|
|
|
2133
2133
|
e[r] = { name: i };
|
|
2134
2134
|
else if (Jt(i)) {
|
|
2135
2135
|
if (typeof i.name != "string")
|
|
2136
|
-
throw new
|
|
2136
|
+
throw new y("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 y("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, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = 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 y(
|
|
2250
2250
|
"CSV_INVALID_OPTION_ENCODING",
|
|
2251
2251
|
[
|
|
2252
2252
|
"Invalid option encoding:",
|
|
@@ -2258,7 +2258,7 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = 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 y(
|
|
2262
2262
|
"CSV_INVALID_OPTION_BOM",
|
|
2263
2263
|
[
|
|
2264
2264
|
"Invalid option bom:",
|
|
@@ -2272,7 +2272,7 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = 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 y(
|
|
2276
2276
|
"CSV_INVALID_OPTION_CAST",
|
|
2277
2277
|
[
|
|
2278
2278
|
"Invalid option cast:",
|
|
@@ -2289,7 +2289,7 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = 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 y(
|
|
2293
2293
|
"CSV_INVALID_OPTION_CAST_DATE",
|
|
2294
2294
|
[
|
|
2295
2295
|
"Invalid option cast_date:",
|
|
@@ -2307,7 +2307,7 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = 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 y(
|
|
2311
2311
|
"CSV_INVALID_OPTION_COLUMNS",
|
|
2312
2312
|
[
|
|
2313
2313
|
"Invalid option columns:",
|
|
@@ -2320,7 +2320,7 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = 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 y(
|
|
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, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
2330
2330
|
e
|
|
2331
2331
|
);
|
|
2332
2332
|
if (e.columns === !1)
|
|
2333
|
-
throw new
|
|
2333
|
+
throw new y(
|
|
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, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = 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 = u.from(e.comment, e.encoding)), !D(e.comment))
|
|
2345
|
-
throw new
|
|
2345
|
+
throw new y(
|
|
2346
2346
|
"CSV_INVALID_OPTION_COMMENT",
|
|
2347
2347
|
[
|
|
2348
2348
|
"Invalid option comment:",
|
|
@@ -2354,7 +2354,7 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = 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 y(
|
|
2358
2358
|
"CSV_INVALID_OPTION_COMMENT",
|
|
2359
2359
|
[
|
|
2360
2360
|
"Invalid option comment_no_infix:",
|
|
@@ -2365,7 +2365,7 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = 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 y(
|
|
2369
2369
|
"CSV_INVALID_OPTION_DELIMITER",
|
|
2370
2370
|
[
|
|
2371
2371
|
"Invalid option delimiter:",
|
|
@@ -2378,7 +2378,7 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
2378
2378
|
if (n == null || n === !1)
|
|
2379
2379
|
return u.from(",", e.encoding);
|
|
2380
2380
|
if (typeof n == "string" && (n = u.from(n, e.encoding)), !D(n) || n.length === 0)
|
|
2381
|
-
throw new
|
|
2381
|
+
throw new y(
|
|
2382
2382
|
"CSV_INVALID_OPTION_DELIMITER",
|
|
2383
2383
|
[
|
|
2384
2384
|
"Invalid option delimiter:",
|
|
@@ -2419,7 +2419,7 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = 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 y(
|
|
2423
2423
|
"CSV_INVALID_OPTION_IGNORE_LAST_DELIMITERS",
|
|
2424
2424
|
[
|
|
2425
2425
|
"Invalid option `ignore_last_delimiters`:",
|
|
@@ -2429,7 +2429,7 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
2429
2429
|
e
|
|
2430
2430
|
);
|
|
2431
2431
|
if (e.ignore_last_delimiters === !0 && e.columns === !1)
|
|
2432
|
-
throw new
|
|
2432
|
+
throw new y(
|
|
2433
2433
|
"CSV_IGNORE_LAST_DELIMITERS_REQUIRES_COLUMNS",
|
|
2434
2434
|
[
|
|
2435
2435
|
"The option `ignore_last_delimiters`",
|
|
@@ -2477,7 +2477,7 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = 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 y(
|
|
2481
2481
|
"CSV_INVALID_OPTION_ON_RECORD",
|
|
2482
2482
|
[
|
|
2483
2483
|
"Invalid option `on_record`:",
|
|
@@ -2506,7 +2506,7 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
2506
2506
|
e.record_delimiter = [];
|
|
2507
2507
|
else if (typeof e.record_delimiter == "string" || D(e.record_delimiter)) {
|
|
2508
2508
|
if (e.record_delimiter.length === 0)
|
|
2509
|
-
throw new
|
|
2509
|
+
throw new y(
|
|
2510
2510
|
"CSV_INVALID_OPTION_RECORD_DELIMITER",
|
|
2511
2511
|
[
|
|
2512
2512
|
"Invalid option `record_delimiter`:",
|
|
@@ -2517,7 +2517,7 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = 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 y(
|
|
2521
2521
|
"CSV_INVALID_OPTION_RECORD_DELIMITER",
|
|
2522
2522
|
[
|
|
2523
2523
|
"Invalid option `record_delimiter`:",
|
|
@@ -2528,7 +2528,7 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
2528
2528
|
);
|
|
2529
2529
|
if (e.record_delimiter = e.record_delimiter.map(function(n, i) {
|
|
2530
2530
|
if (typeof n != "string" && !D(n))
|
|
2531
|
-
throw new
|
|
2531
|
+
throw new y(
|
|
2532
2532
|
"CSV_INVALID_OPTION_RECORD_DELIMITER",
|
|
2533
2533
|
[
|
|
2534
2534
|
"Invalid option `record_delimiter`:",
|
|
@@ -2539,7 +2539,7 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
2539
2539
|
e
|
|
2540
2540
|
);
|
|
2541
2541
|
if (n.length === 0)
|
|
2542
|
-
throw new
|
|
2542
|
+
throw new y(
|
|
2543
2543
|
"CSV_INVALID_OPTION_RECORD_DELIMITER",
|
|
2544
2544
|
[
|
|
2545
2545
|
"Invalid option `record_delimiter`:",
|
|
@@ -2665,7 +2665,7 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
2665
2665
|
state: kn(r),
|
|
2666
2666
|
__needMoreData: function(n, i, o) {
|
|
2667
2667
|
if (o) return !1;
|
|
2668
|
-
const { encoding: s, escape: f, quote: a } = this.options, { quoting: l, needMoreDataSize: h, recordDelimiterMaxLength: c } = this.state, d = i - n - 1,
|
|
2668
|
+
const { encoding: s, escape: f, quote: a } = this.options, { quoting: l, needMoreDataSize: h, recordDelimiterMaxLength: c } = this.state, d = i - n - 1, g = 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, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
2680
2680
|
// Skip if remaining buffer can be record delimiter following the closing quote
|
|
2681
2681
|
l ? a.length + c : 0
|
|
2682
2682
|
);
|
|
2683
|
-
return d <
|
|
2683
|
+
return d < g;
|
|
2684
2684
|
},
|
|
2685
2685
|
// Central parser implementation
|
|
2686
2686
|
parse: function(n, i, o, s) {
|
|
@@ -2691,65 +2691,65 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
2691
2691
|
from_line: h,
|
|
2692
2692
|
ltrim: c,
|
|
2693
2693
|
max_record_size: d,
|
|
2694
|
-
raw:
|
|
2695
|
-
relax_quotes:
|
|
2696
|
-
rtrim:
|
|
2694
|
+
raw: g,
|
|
2695
|
+
relax_quotes: x,
|
|
2696
|
+
rtrim: _,
|
|
2697
2697
|
skip_empty_lines: S,
|
|
2698
2698
|
to: I,
|
|
2699
|
-
to_line:
|
|
2699
|
+
to_line: v
|
|
2700
2700
|
} = this.options;
|
|
2701
|
-
let { comment:
|
|
2701
|
+
let { comment: w, 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:
|
|
2730
|
+
({ comment: w, 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 p;
|
|
2737
2737
|
for (p = 0; p < Ie && !this.__needMoreData(p, Ie, i); p++) {
|
|
2738
|
-
if (this.state.wasRowDelimiter === !0 && (this.info.lines++, this.state.wasRowDelimiter = !1),
|
|
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
|
p
|
|
2745
2745
|
) && (Re = this.options.record_delimiter);
|
|
2746
|
-
const O =
|
|
2747
|
-
if (
|
|
2746
|
+
const O = b[p];
|
|
2747
|
+
if (g === !0 && Qt.append(O), (O === $n || O === jn) && this.state.wasRowDelimiter === !1 && (this.state.wasRowDelimiter = !0), this.state.escaping === !0)
|
|
2748
2748
|
this.state.escaping = !1;
|
|
2749
2749
|
else {
|
|
2750
|
-
if (R !== null && this.state.quoting === !0 && this.__isEscape(
|
|
2750
|
+
if (R !== null && this.state.quoting === !0 && this.__isEscape(b, p, O) && p + R.length < Ie)
|
|
2751
2751
|
if (Ht) {
|
|
2752
|
-
if (this.__isQuote(
|
|
2752
|
+
if (this.__isQuote(b, p + R.length)) {
|
|
2753
2753
|
this.state.escaping = !0, p += R.length - 1;
|
|
2754
2754
|
continue;
|
|
2755
2755
|
}
|
|
@@ -2757,21 +2757,21 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
2757
2757
|
this.state.escaping = !0, p += R.length - 1;
|
|
2758
2758
|
continue;
|
|
2759
2759
|
}
|
|
2760
|
-
if (this.state.commenting === !1 && this.__isQuote(
|
|
2760
|
+
if (this.state.commenting === !1 && this.__isQuote(b, p))
|
|
2761
2761
|
if (this.state.quoting === !0) {
|
|
2762
|
-
const A =
|
|
2763
|
-
|
|
2762
|
+
const A = b[p + F.length], Z = _ && this.__isCharTrimable(b, p + F.length), j = w !== null && this.__compareBytes(w, b, p + F.length, A), X = this.__isDelimiter(
|
|
2763
|
+
b,
|
|
2764
2764
|
p + F.length,
|
|
2765
2765
|
A
|
|
2766
|
-
), de = Re.length === 0 ? this.__autoDiscoverRecordDelimiter(
|
|
2767
|
-
if (R !== null && this.__isEscape(
|
|
2766
|
+
), de = Re.length === 0 ? this.__autoDiscoverRecordDelimiter(b, p + F.length) : this.__isRecordDelimiter(A, b, p + F.length);
|
|
2767
|
+
if (R !== null && this.__isEscape(b, p, O) && this.__isQuote(b, p + R.length))
|
|
2768
2768
|
p += R.length - 1;
|
|
2769
2769
|
else if (!A || X || de || j || Z) {
|
|
2770
2770
|
this.state.quoting = !1, this.state.wasQuoting = !0, p += F.length - 1;
|
|
2771
2771
|
continue;
|
|
2772
|
-
} else if (
|
|
2772
|
+
} else if (x === !1) {
|
|
2773
2773
|
const Ge = this.__error(
|
|
2774
|
-
new
|
|
2774
|
+
new y(
|
|
2775
2775
|
"CSV_INVALID_CLOSING_QUOTE",
|
|
2776
2776
|
[
|
|
2777
2777
|
"Invalid Closing Quote:",
|
|
@@ -2788,11 +2788,11 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
2788
2788
|
} else
|
|
2789
2789
|
this.state.quoting = !1, this.state.wasQuoting = !0, this.state.field.prepend(F), p += F.length - 1;
|
|
2790
2790
|
} else if (this.state.field.length !== 0) {
|
|
2791
|
-
if (
|
|
2791
|
+
if (x === !1) {
|
|
2792
2792
|
const A = this.__infoField(), Z = Object.keys(re).map(
|
|
2793
2793
|
(X) => re[X].equals(this.state.field.toString()) ? X : !1
|
|
2794
2794
|
).filter(Boolean)[0], j = this.__error(
|
|
2795
|
-
new
|
|
2795
|
+
new y(
|
|
2796
2796
|
"INVALID_OPENING_QUOTE",
|
|
2797
2797
|
[
|
|
2798
2798
|
"Invalid Opening Quote:",
|
|
@@ -2815,7 +2815,7 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
2815
2815
|
if (this.state.quoting === !1) {
|
|
2816
2816
|
const A = this.__isRecordDelimiter(
|
|
2817
2817
|
O,
|
|
2818
|
-
|
|
2818
|
+
b,
|
|
2819
2819
|
p
|
|
2820
2820
|
);
|
|
2821
2821
|
if (A !== 0) {
|
|
@@ -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 (
|
|
2849
|
+
if (w !== null && (a === !1 || this.state.record.length === 0 && this.state.field.length === 0) && this.__compareBytes(w, b, p, O) !== 0) {
|
|
2850
2850
|
this.state.commenting = !0;
|
|
2851
2851
|
continue;
|
|
2852
2852
|
}
|
|
2853
|
-
const Z = this.__isDelimiter(
|
|
2853
|
+
const Z = this.__isDelimiter(b, p, O);
|
|
2854
2854
|
if (Z !== 0) {
|
|
2855
2855
|
this.info.bytes = this.state.bufBytesStart + p;
|
|
2856
2856
|
const j = this.__onField();
|
|
@@ -2862,7 +2862,7 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
2862
2862
|
}
|
|
2863
2863
|
if (this.state.commenting === !1 && d !== 0 && this.state.record_length + this.state.field.length > d)
|
|
2864
2864
|
return this.__error(
|
|
2865
|
-
new
|
|
2865
|
+
new y(
|
|
2866
2866
|
"CSV_MAX_RECORD_SIZE",
|
|
2867
2867
|
[
|
|
2868
2868
|
"Max Record Size:",
|
|
@@ -2874,13 +2874,13 @@ 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, p), he = _ === !1 || this.state.wasQuoting === !1;
|
|
2878
2878
|
if (J === !0 && he === !0)
|
|
2879
2879
|
this.state.field.append(O);
|
|
2880
2880
|
else {
|
|
2881
|
-
if (
|
|
2881
|
+
if (_ === !0 && !this.__isCharTrimable(b, p))
|
|
2882
2882
|
return this.__error(
|
|
2883
|
-
new
|
|
2883
|
+
new y(
|
|
2884
2884
|
"CSV_NON_TRIMABLE_CHAR_AFTER_CLOSING_QUOTE",
|
|
2885
2885
|
[
|
|
2886
2886
|
"Invalid Closing Quote:",
|
|
@@ -2891,14 +2891,14 @@ 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 && (p += this.__isCharTrimable(
|
|
2894
|
+
J === !1 && (p += this.__isCharTrimable(b, p) - 1);
|
|
2895
2895
|
continue;
|
|
2896
2896
|
}
|
|
2897
2897
|
}
|
|
2898
2898
|
if (i === !0)
|
|
2899
2899
|
if (this.state.quoting === !0) {
|
|
2900
2900
|
const O = this.__error(
|
|
2901
|
-
new
|
|
2901
|
+
new y(
|
|
2902
2902
|
"CSV_QUOTE_NOT_CLOSED",
|
|
2903
2903
|
[
|
|
2904
2904
|
"Quote Not Closed:",
|
|
@@ -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 += p, this.state.previousBuf =
|
|
2920
|
+
this.state.bufBytesStart += p, this.state.previousBuf = b.slice(p);
|
|
2921
2921
|
this.state.wasRowDelimiter === !0 && (this.info.lines++, this.state.wasRowDelimiter = !1);
|
|
2922
2922
|
},
|
|
2923
2923
|
__onRecord: function(n) {
|
|
@@ -2931,20 +2931,20 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
2931
2931
|
relax_column_count_less: h,
|
|
2932
2932
|
relax_column_count_more: c,
|
|
2933
2933
|
raw: d,
|
|
2934
|
-
skip_records_with_empty_values:
|
|
2935
|
-
} = this.options, { enabled:
|
|
2936
|
-
if (
|
|
2934
|
+
skip_records_with_empty_values: g
|
|
2935
|
+
} = this.options, { enabled: x, record: _ } = this.state;
|
|
2936
|
+
if (x === !1)
|
|
2937
2937
|
return this.__resetRecord();
|
|
2938
|
-
const S =
|
|
2938
|
+
const S = _.length;
|
|
2939
2939
|
if (i === !0) {
|
|
2940
|
-
if (
|
|
2940
|
+
if (g === !0 && lt(_)) {
|
|
2941
2941
|
this.__resetRecord();
|
|
2942
2942
|
return;
|
|
2943
2943
|
}
|
|
2944
|
-
return this.__firstLineToColumns(
|
|
2944
|
+
return this.__firstLineToColumns(_);
|
|
2945
2945
|
}
|
|
2946
2946
|
if (i === !1 && this.info.records === 0 && (this.state.expectedRecordLength = S), S !== this.state.expectedRecordLength) {
|
|
2947
|
-
const I = i === !1 ? new
|
|
2947
|
+
const I = i === !1 ? new y(
|
|
2948
2948
|
"CSV_RECORD_INCONSISTENT_FIELDS_LENGTH",
|
|
2949
2949
|
[
|
|
2950
2950
|
"Invalid Record Length:",
|
|
@@ -2954,9 +2954,9 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
2954
2954
|
this.options,
|
|
2955
2955
|
this.__infoField(),
|
|
2956
2956
|
{
|
|
2957
|
-
record:
|
|
2957
|
+
record: _
|
|
2958
2958
|
}
|
|
2959
|
-
) : new
|
|
2959
|
+
) : new y(
|
|
2960
2960
|
"CSV_RECORD_INCONSISTENT_COLUMNS",
|
|
2961
2961
|
[
|
|
2962
2962
|
"Invalid Record Length:",
|
|
@@ -2967,17 +2967,17 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
2967
2967
|
this.options,
|
|
2968
2968
|
this.__infoField(),
|
|
2969
2969
|
{
|
|
2970
|
-
record:
|
|
2970
|
+
record: _
|
|
2971
2971
|
}
|
|
2972
2972
|
);
|
|
2973
2973
|
if (l === !0 || h === !0 && S < this.state.expectedRecordLength || c === !0 && S > this.state.expectedRecordLength)
|
|
2974
2974
|
this.info.invalid_field_length++, this.state.error = I;
|
|
2975
2975
|
else {
|
|
2976
|
-
const
|
|
2977
|
-
if (
|
|
2976
|
+
const v = this.__error(I);
|
|
2977
|
+
if (v) return v;
|
|
2978
2978
|
}
|
|
2979
2979
|
}
|
|
2980
|
-
if (
|
|
2980
|
+
if (g === !0 && lt(_)) {
|
|
2981
2981
|
this.__resetRecord();
|
|
2982
2982
|
return;
|
|
2983
2983
|
}
|
|
@@ -2988,46 +2988,46 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = function(t) {
|
|
|
2988
2988
|
if (this.info.records++, a === 1 || this.info.records >= a) {
|
|
2989
2989
|
const { objname: I } = this.options;
|
|
2990
2990
|
if (i !== !1) {
|
|
2991
|
-
const
|
|
2992
|
-
for (let
|
|
2993
|
-
i[
|
|
2991
|
+
const v = {};
|
|
2992
|
+
for (let w = 0, R = _.length; w < R; w++)
|
|
2993
|
+
i[w] === void 0 || i[w].disabled || (o === !0 && v[i[w].name] !== void 0 ? Array.isArray(v[i[w].name]) ? v[i[w].name] = v[i[w].name].concat(_[w]) : v[i[w].name] = [v[i[w].name], _[w]] : v[i[w].name] = _[w]);
|
|
2994
2994
|
if (d === !0 || f === !0) {
|
|
2995
|
-
const
|
|
2996
|
-
{ record:
|
|
2995
|
+
const w = Object.assign(
|
|
2996
|
+
{ record: v },
|
|
2997
2997
|
d === !0 ? { raw: this.state.rawBuffer.toString(s) } : {},
|
|
2998
2998
|
f === !0 ? { info: this.__infoRecord() } : {}
|
|
2999
2999
|
), R = this.__push(
|
|
3000
|
-
I === void 0 ?
|
|
3000
|
+
I === void 0 ? w : [v[I], w],
|
|
3001
3001
|
n
|
|
3002
3002
|
);
|
|
3003
3003
|
if (R)
|
|
3004
3004
|
return R;
|
|
3005
3005
|
} else {
|
|
3006
|
-
const
|
|
3007
|
-
I === void 0 ?
|
|
3006
|
+
const w = this.__push(
|
|
3007
|
+
I === void 0 ? v : [v[I], v],
|
|
3008
3008
|
n
|
|
3009
3009
|
);
|
|
3010
|
-
if (
|
|
3011
|
-
return
|
|
3010
|
+
if (w)
|
|
3011
|
+
return w;
|
|
3012
3012
|
}
|
|
3013
3013
|
} else if (d === !0 || f === !0) {
|
|
3014
|
-
const
|
|
3015
|
-
{ record:
|
|
3014
|
+
const v = Object.assign(
|
|
3015
|
+
{ record: _ },
|
|
3016
3016
|
d === !0 ? { raw: this.state.rawBuffer.toString(s) } : {},
|
|
3017
3017
|
f === !0 ? { info: this.__infoRecord() } : {}
|
|
3018
|
-
),
|
|
3019
|
-
I === void 0 ?
|
|
3018
|
+
), w = this.__push(
|
|
3019
|
+
I === void 0 ? v : [_[I], v],
|
|
3020
3020
|
n
|
|
3021
3021
|
);
|
|
3022
|
-
if (
|
|
3023
|
-
return
|
|
3022
|
+
if (w)
|
|
3023
|
+
return w;
|
|
3024
3024
|
} else {
|
|
3025
|
-
const
|
|
3026
|
-
I === void 0 ?
|
|
3025
|
+
const v = this.__push(
|
|
3026
|
+
I === void 0 ? _ : [_[I], _],
|
|
3027
3027
|
n
|
|
3028
3028
|
);
|
|
3029
|
-
if (
|
|
3030
|
-
return
|
|
3029
|
+
if (v)
|
|
3030
|
+
return v;
|
|
3031
3031
|
}
|
|
3032
3032
|
}
|
|
3033
3033
|
this.__resetRecord();
|
|
@@ -3038,7 +3038,7 @@ const Nn = 12, Fn = 13, Mn = 10, Bn = 32, Un = 9, kn = 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 y(
|
|
3042
3042
|
"CSV_INVALID_COLUMN_MAPPING",
|
|
3043
3043
|
[
|
|
3044
3044
|
"Invalid Column Mapping:",
|
|
@@ -3303,7 +3303,7 @@ const je = function() {
|
|
|
3303
3303
|
else if (r === void 0 && s === "function")
|
|
3304
3304
|
r = o;
|
|
3305
3305
|
else
|
|
3306
|
-
throw new
|
|
3306
|
+
throw new y(
|
|
3307
3307
|
"CSV_INVALID_ARGUMENT",
|
|
3308
3308
|
["Invalid argument:", `got ${JSON.stringify(o)} at index ${i}`],
|
|
3309
3309
|
e || {}
|
|
@@ -3390,18 +3390,22 @@ class ri {
|
|
|
3390
3390
|
*/
|
|
3391
3391
|
async inferSchema(e, r, n) {
|
|
3392
3392
|
const i = Xn(r), { parsingRecords: o, valueDelimiterId: s } = await Kn(r, n), f = [], a = [];
|
|
3393
|
-
for (const
|
|
3394
|
-
const
|
|
3395
|
-
f.push(
|
|
3393
|
+
for (const c of o) {
|
|
3394
|
+
const d = e.inferValues(a, c, !0);
|
|
3395
|
+
f.push(d);
|
|
3396
3396
|
}
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3397
|
+
let l = 0;
|
|
3398
|
+
const h = f[0];
|
|
3399
|
+
if (h) {
|
|
3400
|
+
const c = h.length;
|
|
3401
|
+
for (let d = 0; d < c; d++) {
|
|
3402
|
+
const g = h[d]?.inferredValue, x = g == null ? `Column ${d}` : String(g), _ = a[d];
|
|
3403
|
+
_ != null && (_.label = { en: x });
|
|
3403
3404
|
}
|
|
3405
|
+
l = 1;
|
|
3404
3406
|
}
|
|
3407
|
+
for (let c = l; c < f.length; c++)
|
|
3408
|
+
;
|
|
3405
3409
|
return { recordDelimiterId: i, valueDelimiterId: s, parsingRecords: o, inferenceRecords: f, columnConfigs: a };
|
|
3406
3410
|
}
|
|
3407
3411
|
/**
|
|
@@ -3410,7 +3414,7 @@ class ri {
|
|
|
3410
3414
|
async parseStream(e, r, n, i, o) {
|
|
3411
3415
|
return new Promise((s, f) => {
|
|
3412
3416
|
let a, l, h, c = !1, d = !1;
|
|
3413
|
-
const
|
|
3417
|
+
const g = () => {
|
|
3414
3418
|
if (d) return;
|
|
3415
3419
|
d = !0;
|
|
3416
3420
|
const S = a;
|
|
@@ -3418,9 +3422,9 @@ class ri {
|
|
|
3418
3422
|
l?.cancel();
|
|
3419
3423
|
}), l = void 0;
|
|
3420
3424
|
};
|
|
3421
|
-
i.signal.addEventListener("abort",
|
|
3422
|
-
const
|
|
3423
|
-
c || (c = !0,
|
|
3425
|
+
i.signal.addEventListener("abort", g, { once: !0 });
|
|
3426
|
+
const x = (S) => {
|
|
3427
|
+
c || (c = !0, g(), i.signal.aborted || i.abort(S), f(S));
|
|
3424
3428
|
};
|
|
3425
3429
|
(async () => {
|
|
3426
3430
|
a = je({
|
|
@@ -3435,9 +3439,9 @@ class ri {
|
|
|
3435
3439
|
i.signal.throwIfAborted(), h.push(R);
|
|
3436
3440
|
}
|
|
3437
3441
|
} catch (R) {
|
|
3438
|
-
|
|
3442
|
+
x(R);
|
|
3439
3443
|
}
|
|
3440
|
-
}), a.on("error", (R) =>
|
|
3444
|
+
}), a.on("error", (R) => x(R)), a.on("end", () => {
|
|
3441
3445
|
c || (h?.flush(), s(ti(a)));
|
|
3442
3446
|
});
|
|
3443
3447
|
const S = await fetch(encodeURI(n), { signal: i.signal });
|
|
@@ -3445,17 +3449,17 @@ class ri {
|
|
|
3445
3449
|
throw await Wn(S, `Failed to fetch '${n}' file.`, "datapos-connector-file-store-emulator|Connector|retrieve");
|
|
3446
3450
|
l = S.body.getReader();
|
|
3447
3451
|
const I = new TextDecoder(e.encodingId);
|
|
3448
|
-
let
|
|
3449
|
-
for (; !
|
|
3452
|
+
let v = await l.read();
|
|
3453
|
+
for (; !v.done; ) {
|
|
3450
3454
|
if (c) return;
|
|
3451
3455
|
i.signal.throwIfAborted();
|
|
3452
|
-
const R = I.decode(
|
|
3453
|
-
R.length > 0 && a.write(R),
|
|
3456
|
+
const R = I.decode(v.value, { stream: !0 });
|
|
3457
|
+
R.length > 0 && a.write(R), v = await l.read();
|
|
3454
3458
|
}
|
|
3455
3459
|
if (c) return;
|
|
3456
|
-
const
|
|
3457
|
-
|
|
3458
|
-
})().catch((S) =>
|
|
3460
|
+
const w = I.decode();
|
|
3461
|
+
w.length > 0 && a.write(w), a.end();
|
|
3462
|
+
})().catch((S) => x(S));
|
|
3459
3463
|
});
|
|
3460
3464
|
}
|
|
3461
3465
|
}
|
|
@@ -3472,23 +3476,23 @@ async function Kn(t, e) {
|
|
|
3472
3476
|
try {
|
|
3473
3477
|
let f = 0, a, l = 0, h = 0;
|
|
3474
3478
|
const c = je({
|
|
3475
|
-
cast: (d,
|
|
3479
|
+
cast: (d, g) => ({ value: d, wasValueQuoted: g.quoting }),
|
|
3476
3480
|
delimiter: s,
|
|
3477
3481
|
relax_column_count: !0
|
|
3478
3482
|
});
|
|
3479
3483
|
await new Promise((d) => {
|
|
3480
3484
|
try {
|
|
3481
|
-
const
|
|
3485
|
+
const g = [];
|
|
3482
3486
|
c.on("readable", () => {
|
|
3483
|
-
let
|
|
3484
|
-
for (; (
|
|
3487
|
+
let x;
|
|
3488
|
+
for (; (x = c.read()) != null; ) {
|
|
3485
3489
|
l++;
|
|
3486
|
-
const
|
|
3487
|
-
a != null && (h += Math.abs(
|
|
3490
|
+
const _ = x.length;
|
|
3491
|
+
a != null && (h += Math.abs(_ - a)), a = _, f += _, g.push(x);
|
|
3488
3492
|
}
|
|
3489
3493
|
}), c.on("error", () => d()), c.on("end", () => {
|
|
3490
|
-
const
|
|
3491
|
-
(!i || h <= i) && (!n ||
|
|
3494
|
+
const x = f / l;
|
|
3495
|
+
(!i || h <= i) && (!n || x > n) && (r = s, n = x, i = h, o = [...g]), d();
|
|
3492
3496
|
}), c.write(t), c.end();
|
|
3493
3497
|
} catch {
|
|
3494
3498
|
d();
|