@datapos/datapos-tool-csv-parse 0.0.100 → 0.0.102
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.
|
@@ -30,7 +30,7 @@ function Ze(t) {
|
|
|
30
30
|
o.push(er(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, u = a >> 1, h = -7, c = r ? i - 1 : 0, d = r ? -1 : 1, p = t[e + c];
|
|
35
35
|
for (c += d, o = p & (1 << -h) - 1, p >>= -h, h += f; h > 0; o = o * 256 + t[e + c], c += d, h -= 8)
|
|
36
36
|
;
|
|
@@ -595,16 +595,16 @@ l.prototype.readInt32BE = function(e, r) {
|
|
|
595
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
|
l.prototype.readFloatLE = function(e, r) {
|
|
598
|
-
return r || T(e, 4, this.length),
|
|
598
|
+
return r || T(e, 4, this.length), ve(this, e, !0, 23, 4);
|
|
599
599
|
};
|
|
600
600
|
l.prototype.readFloatBE = function(e, r) {
|
|
601
|
-
return r || T(e, 4, this.length),
|
|
601
|
+
return r || T(e, 4, this.length), ve(this, e, !1, 23, 4);
|
|
602
602
|
};
|
|
603
603
|
l.prototype.readDoubleLE = function(e, r) {
|
|
604
|
-
return r || T(e, 8, this.length),
|
|
604
|
+
return r || T(e, 8, this.length), ve(this, e, !0, 52, 8);
|
|
605
605
|
};
|
|
606
606
|
l.prototype.readDoubleBE = function(e, r) {
|
|
607
|
-
return r || T(e, 8, this.length),
|
|
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 @@ l.prototype.writeUIntBE = function(e, r, n, i) {
|
|
|
634
634
|
l.prototype.writeUInt8 = function(e, r, n) {
|
|
635
635
|
return e = +e, r = r | 0, n || N(this, e, r, 1, 255, 0), l.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
|
l.prototype.writeUInt16LE = function(e, r, n) {
|
|
643
|
-
return e = +e, r = r | 0, n || N(this, e, r, 2, 65535, 0), l.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), l.TYPED_ARRAY_SUPPORT ? (this[r] = e & 255, this[r + 1] = e >>> 8) : be(this, e, r, !0), r + 2;
|
|
644
644
|
};
|
|
645
645
|
l.prototype.writeUInt16BE = function(e, r, n) {
|
|
646
|
-
return e = +e, r = r | 0, n || N(this, e, r, 2, 65535, 0), l.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), l.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 @@ l.prototype.writeInt8 = function(e, r, n) {
|
|
|
680
680
|
return e = +e, r = r | 0, n || N(this, e, r, 1, 127, -128), l.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)), e < 0 && (e = 255 + e + 1), this[r] = e & 255, r + 1;
|
|
681
681
|
};
|
|
682
682
|
l.prototype.writeInt16LE = function(e, r, n) {
|
|
683
|
-
return e = +e, r = r | 0, n || N(this, e, r, 2, 32767, -32768), l.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), l.TYPED_ARRAY_SUPPORT ? (this[r] = e & 255, this[r + 1] = e >>> 8) : be(this, e, r, !0), r + 2;
|
|
684
684
|
};
|
|
685
685
|
l.prototype.writeInt16BE = function(e, r, n) {
|
|
686
|
-
return e = +e, r = r | 0, n || N(this, e, r, 2, 32767, -32768), l.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), l.TYPED_ARRAY_SUPPORT ? (this[r] = e >>> 8, this[r + 1] = e & 255) : be(this, e, r, !1), r + 2;
|
|
687
687
|
};
|
|
688
688
|
l.prototype.writeInt32LE = function(e, r, n) {
|
|
689
689
|
return e = +e, r = r | 0, n || N(this, e, r, 4, 2147483647, -2147483648), l.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 @@ l.prototype.writeInt32LE = function(e, r, n) {
|
|
|
691
691
|
l.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), l.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
|
l.prototype.writeFloatLE = function(e, r, n) {
|
|
702
|
-
return
|
|
702
|
+
return bt(this, e, r, !0, n);
|
|
703
703
|
};
|
|
704
704
|
l.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
|
l.prototype.writeDoubleLE = function(e, r, n) {
|
|
711
711
|
return Et(this, e, r, !0, n);
|
|
@@ -763,13 +763,13 @@ l.prototype.fill = function(e, r, n, i) {
|
|
|
763
763
|
return this;
|
|
764
764
|
};
|
|
765
765
|
var yr = /[^+\/0-9A-Za-z-_]/g;
|
|
766
|
-
function
|
|
767
|
-
if (t =
|
|
766
|
+
function vr(t) {
|
|
767
|
+
if (t = br(t).replace(yr, ""), t.length < 2) return "";
|
|
768
768
|
for (; t.length % 4 !== 0; )
|
|
769
769
|
t = t + "=";
|
|
770
770
|
return t;
|
|
771
771
|
}
|
|
772
|
-
function
|
|
772
|
+
function br(t) {
|
|
773
773
|
return t.trim ? t.trim() : t.replace(/^\s+|\s+$/g, "");
|
|
774
774
|
}
|
|
775
775
|
function Er(t) {
|
|
@@ -836,7 +836,7 @@ function Sr(t, e) {
|
|
|
836
836
|
return o;
|
|
837
837
|
}
|
|
838
838
|
function xt(t) {
|
|
839
|
-
return Xt(
|
|
839
|
+
return Xt(vr(t));
|
|
840
840
|
}
|
|
841
841
|
function xe(t, e, r, n) {
|
|
842
842
|
for (var i = 0; i < n && !(i + r >= e.length || i >= t.length); ++i)
|
|
@@ -1704,8 +1704,8 @@ C.prototype.pipe = function(t, e) {
|
|
|
1704
1704
|
r.on("data", d);
|
|
1705
1705
|
function d(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) && !u && (E("false write response, pause", r._readableState.awaitDrain), r._readableState.awaitDrain++, c = !0), r.pause());
|
|
1709
1709
|
}
|
|
1710
1710
|
function p(I) {
|
|
1711
1711
|
E("onerror", I), S(), t.removeListener("error", p), rn(t, "error") === 0 && t.emit("error", I);
|
|
@@ -1859,7 +1859,7 @@ L.WritableState = He;
|
|
|
1859
1859
|
oe(L, g);
|
|
1860
1860
|
function yn() {
|
|
1861
1861
|
}
|
|
1862
|
-
function
|
|
1862
|
+
function vn(t, e, r) {
|
|
1863
1863
|
this.chunk = t, this.encoding = e, this.callback = r, this.next = null;
|
|
1864
1864
|
}
|
|
1865
1865
|
function He(t, e) {
|
|
@@ -1887,7 +1887,7 @@ function L(t) {
|
|
|
1887
1887
|
L.prototype.pipe = function() {
|
|
1888
1888
|
this.emit("error", new Error("Cannot pipe, not readable"));
|
|
1889
1889
|
};
|
|
1890
|
-
function
|
|
1890
|
+
function bn(t, e) {
|
|
1891
1891
|
var r = new Error("write after end");
|
|
1892
1892
|
t.emit("error", r), U(e, r);
|
|
1893
1893
|
}
|
|
@@ -1897,7 +1897,7 @@ function En(t, e, r, n) {
|
|
|
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), l.isBuffer(t) ? e = "buffer" : e || (e = n.defaultEncoding), typeof r != "function" && (r = yn), n.ended ?
|
|
1900
|
+
return typeof e == "function" && (r = e, e = null), l.isBuffer(t) ? e = "buffer" : e || (e = n.defaultEncoding), typeof r != "function" && (r = yn), n.ended ? bn(this, r) : En(this, n, t, r) && (n.pendingcb++, i = Sn(this, n, t, e, r)), i;
|
|
1901
1901
|
};
|
|
1902
1902
|
L.prototype.cork = function() {
|
|
1903
1903
|
var t = this._writableState;
|
|
@@ -1921,7 +1921,7 @@ function Sn(t, e, r, n, i) {
|
|
|
1921
1921
|
var s = e.length < e.highWaterMark;
|
|
1922
1922
|
if (s || (e.needDrain = !0), e.writing || e.corked) {
|
|
1923
1923
|
var f = e.lastBufferedRequest;
|
|
1924
|
-
e.lastBufferedRequest = new
|
|
1924
|
+
e.lastBufferedRequest = new vn(r, n, i), f ? f.next = e.lastBufferedRequest : e.bufferedRequest = e.lastBufferedRequest, e.bufferedRequestCount += 1;
|
|
1925
1925
|
} else
|
|
1926
1926
|
$e(t, e, !1, o, r, n, i);
|
|
1927
1927
|
return s;
|
|
@@ -2696,31 +2696,31 @@ const Fn = 12, Mn = 13, Bn = 10, Un = 32, kn = 9, Pn = function(t) {
|
|
|
2696
2696
|
rtrim: _,
|
|
2697
2697
|
skip_empty_lines: S,
|
|
2698
2698
|
to: I,
|
|
2699
|
-
to_line:
|
|
2699
|
+
to_line: v
|
|
2700
2700
|
} = this.options;
|
|
2701
2701
|
let { comment: w, escape: R, quote: F, record_delimiter: Re } = this.options;
|
|
2702
2702
|
const { bomSkipped: Qt, previousBuf: ce, rawBuffer: Ht, escapeIsQuote: Gt } = 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 = l.concat([ce, n]);
|
|
2711
2711
|
if (Qt === !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 = lt({
|
|
2725
2725
|
...this.original_options,
|
|
2726
2726
|
encoding: O
|
|
@@ -2732,24 +2732,24 @@ const Fn = 12, Mn = 13, Bn = 10, Un = 32, kn = 9, Pn = function(t) {
|
|
|
2732
2732
|
}
|
|
2733
2733
|
this.state.bomSkipped = !0;
|
|
2734
2734
|
}
|
|
2735
|
-
const Ie =
|
|
2735
|
+
const Ie = b.length;
|
|
2736
2736
|
let m;
|
|
2737
2737
|
for (m = 0; m < Ie && !this.__needMoreData(m, Ie, i); m++) {
|
|
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
|
m
|
|
2745
2745
|
) && (Re = this.options.record_delimiter);
|
|
2746
|
-
const O =
|
|
2746
|
+
const O = b[m];
|
|
2747
2747
|
if (p === !0 && Ht.append(O), (O === jn || O === qn) && 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, m, O) && m + R.length < Ie)
|
|
2751
2751
|
if (Gt) {
|
|
2752
|
-
if (this.__isQuote(
|
|
2752
|
+
if (this.__isQuote(b, m + R.length)) {
|
|
2753
2753
|
this.state.escaping = !0, m += R.length - 1;
|
|
2754
2754
|
continue;
|
|
2755
2755
|
}
|
|
@@ -2757,14 +2757,14 @@ const Fn = 12, Mn = 13, Bn = 10, Un = 32, kn = 9, Pn = function(t) {
|
|
|
2757
2757
|
this.state.escaping = !0, m += 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, m))
|
|
2761
2761
|
if (this.state.quoting === !0) {
|
|
2762
|
-
const A =
|
|
2763
|
-
|
|
2762
|
+
const A = b[m + F.length], Z = _ && this.__isCharTrimable(b, m + F.length), j = w !== null && this.__compareBytes(w, b, m + F.length, A), X = this.__isDelimiter(
|
|
2763
|
+
b,
|
|
2764
2764
|
m + 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, m + F.length) : this.__isRecordDelimiter(A, b, m + F.length);
|
|
2767
|
+
if (R !== null && this.__isEscape(b, m, O) && this.__isQuote(b, m + R.length))
|
|
2768
2768
|
m += R.length - 1;
|
|
2769
2769
|
else if (!A || X || de || j || Z) {
|
|
2770
2770
|
this.state.quoting = !1, this.state.wasQuoting = !0, m += F.length - 1;
|
|
@@ -2815,7 +2815,7 @@ const Fn = 12, Mn = 13, Bn = 10, Un = 32, kn = 9, Pn = function(t) {
|
|
|
2815
2815
|
if (this.state.quoting === !1) {
|
|
2816
2816
|
const A = this.__isRecordDelimiter(
|
|
2817
2817
|
O,
|
|
2818
|
-
|
|
2818
|
+
b,
|
|
2819
2819
|
m
|
|
2820
2820
|
);
|
|
2821
2821
|
if (A !== 0) {
|
|
@@ -2846,11 +2846,11 @@ const Fn = 12, Mn = 13, Bn = 10, Un = 32, kn = 9, Pn = function(t) {
|
|
|
2846
2846
|
}
|
|
2847
2847
|
if (this.state.commenting)
|
|
2848
2848
|
continue;
|
|
2849
|
-
if (w !== null && (a === !1 || this.state.record.length === 0 && this.state.field.length === 0) && this.__compareBytes(w,
|
|
2849
|
+
if (w !== null && (a === !1 || this.state.record.length === 0 && this.state.field.length === 0) && this.__compareBytes(w, b, m, O) !== 0) {
|
|
2850
2850
|
this.state.commenting = !0;
|
|
2851
2851
|
continue;
|
|
2852
2852
|
}
|
|
2853
|
-
const Z = this.__isDelimiter(
|
|
2853
|
+
const Z = this.__isDelimiter(b, m, O);
|
|
2854
2854
|
if (Z !== 0) {
|
|
2855
2855
|
this.info.bytes = this.state.bufBytesStart + m;
|
|
2856
2856
|
const j = this.__onField();
|
|
@@ -2874,11 +2874,11 @@ const Fn = 12, Mn = 13, Bn = 10, Un = 32, kn = 9, Pn = 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, m), 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 (_ === !0 && !this.__isCharTrimable(
|
|
2881
|
+
if (_ === !0 && !this.__isCharTrimable(b, m))
|
|
2882
2882
|
return this.__error(
|
|
2883
2883
|
new y(
|
|
2884
2884
|
"CSV_NON_TRIMABLE_CHAR_AFTER_CLOSING_QUOTE",
|
|
@@ -2891,7 +2891,7 @@ const Fn = 12, Mn = 13, Bn = 10, Un = 32, kn = 9, Pn = function(t) {
|
|
|
2891
2891
|
this.__infoField()
|
|
2892
2892
|
)
|
|
2893
2893
|
);
|
|
2894
|
-
J === !1 && (m += this.__isCharTrimable(
|
|
2894
|
+
J === !1 && (m += this.__isCharTrimable(b, m) - 1);
|
|
2895
2895
|
continue;
|
|
2896
2896
|
}
|
|
2897
2897
|
}
|
|
@@ -2917,7 +2917,7 @@ const Fn = 12, Mn = 13, Bn = 10, Un = 32, kn = 9, Pn = 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 += m, this.state.previousBuf =
|
|
2920
|
+
this.state.bufBytesStart += m, this.state.previousBuf = b.slice(m);
|
|
2921
2921
|
this.state.wasRowDelimiter === !0 && (this.info.lines++, this.state.wasRowDelimiter = !1);
|
|
2922
2922
|
},
|
|
2923
2923
|
__onRecord: function(n) {
|
|
@@ -2973,8 +2973,8 @@ const Fn = 12, Mn = 13, Bn = 10, Un = 32, kn = 9, Pn = function(t) {
|
|
|
2973
2973
|
if (u === !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
2980
|
if (p === !0 && ut(_)) {
|
|
@@ -2988,46 +2988,46 @@ const Fn = 12, Mn = 13, Bn = 10, Un = 32, kn = 9, Pn = function(t) {
|
|
|
2988
2988
|
if (this.info.records++, a === 1 || this.info.records >= a) {
|
|
2989
2989
|
const { objname: I } = this.options;
|
|
2990
2990
|
if (i !== !1) {
|
|
2991
|
-
const
|
|
2991
|
+
const v = {};
|
|
2992
2992
|
for (let w = 0, R = _.length; w < R; w++)
|
|
2993
|
-
i[w] === void 0 || i[w].disabled || (o === !0 &&
|
|
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
2995
|
const w = Object.assign(
|
|
2996
|
-
{ record:
|
|
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 ? w : [
|
|
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
3006
|
const w = this.__push(
|
|
3007
|
-
I === void 0 ?
|
|
3007
|
+
I === void 0 ? v : [v[I], v],
|
|
3008
3008
|
n
|
|
3009
3009
|
);
|
|
3010
3010
|
if (w)
|
|
3011
3011
|
return w;
|
|
3012
3012
|
}
|
|
3013
3013
|
} else if (d === !0 || f === !0) {
|
|
3014
|
-
const
|
|
3014
|
+
const v = Object.assign(
|
|
3015
3015
|
{ record: _ },
|
|
3016
3016
|
d === !0 ? { raw: this.state.rawBuffer.toString(s) } : {},
|
|
3017
3017
|
f === !0 ? { info: this.__infoRecord() } : {}
|
|
3018
3018
|
), w = this.__push(
|
|
3019
|
-
I === void 0 ?
|
|
3019
|
+
I === void 0 ? v : [_[I], v],
|
|
3020
3020
|
n
|
|
3021
3021
|
);
|
|
3022
3022
|
if (w)
|
|
3023
3023
|
return w;
|
|
3024
3024
|
} else {
|
|
3025
|
-
const
|
|
3025
|
+
const v = this.__push(
|
|
3026
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();
|
|
@@ -3380,17 +3380,17 @@ function Gn(t) {
|
|
|
3380
3380
|
return t.length > 2048 ? `${t.slice(0, 2048)}... [truncated]` : t;
|
|
3381
3381
|
}
|
|
3382
3382
|
const Wt = {
|
|
3383
|
-
bom:
|
|
3383
|
+
// bom: false,
|
|
3384
3384
|
// cast: undefined,
|
|
3385
|
-
cast_date:
|
|
3385
|
+
// cast_date: false,
|
|
3386
3386
|
columns: !1,
|
|
3387
3387
|
comment: "",
|
|
3388
3388
|
comment_no_infix: !1,
|
|
3389
3389
|
delimiter: ",",
|
|
3390
3390
|
encoding: "utf8",
|
|
3391
3391
|
escape: '"',
|
|
3392
|
-
from: 1,
|
|
3393
|
-
from_line: 1,
|
|
3392
|
+
// from: 1,
|
|
3393
|
+
// from_line: 1,
|
|
3394
3394
|
group_columns_by_name: !1,
|
|
3395
3395
|
ignore_last_delimiters: !1,
|
|
3396
3396
|
info: !1,
|
|
@@ -3400,8 +3400,8 @@ const Wt = {
|
|
|
3400
3400
|
// on_record: undefined,
|
|
3401
3401
|
// on_skip: undefined,
|
|
3402
3402
|
quote: '"',
|
|
3403
|
-
raw:
|
|
3404
|
-
record_delimiter: [],
|
|
3403
|
+
// raw: false,
|
|
3404
|
+
// record_delimiter: [],
|
|
3405
3405
|
relax_column_count: !1,
|
|
3406
3406
|
relax_column_count_less: !1,
|
|
3407
3407
|
relax_column_count_more: !1,
|
|
@@ -3410,8 +3410,8 @@ const Wt = {
|
|
|
3410
3410
|
skip_empty_lines: !1,
|
|
3411
3411
|
skip_records_with_empty_values: !1,
|
|
3412
3412
|
skip_records_with_error: !1,
|
|
3413
|
-
to: 1,
|
|
3414
|
-
to_line: -1,
|
|
3413
|
+
// to: 1,
|
|
3414
|
+
// to_line: -1,
|
|
3415
3415
|
trim: !1
|
|
3416
3416
|
}, Zn = 1e4, Xn = 4;
|
|
3417
3417
|
class ni {
|
|
@@ -3487,12 +3487,12 @@ class ni {
|
|
|
3487
3487
|
throw await Qn(S, `Failed to fetch '${n}' file.`, "datapos-connector-file-store-emulator|Connector|retrieve");
|
|
3488
3488
|
u = S.body.getReader();
|
|
3489
3489
|
const I = new TextDecoder(e.encodingId);
|
|
3490
|
-
let
|
|
3491
|
-
for (; !
|
|
3490
|
+
let v = await u.read();
|
|
3491
|
+
for (; !v.done; ) {
|
|
3492
3492
|
if (c) return;
|
|
3493
3493
|
i.signal.throwIfAborted();
|
|
3494
|
-
const R = I.decode(
|
|
3495
|
-
R.length > 0 && a.write(R),
|
|
3494
|
+
const R = I.decode(v.value, { stream: !0 });
|
|
3495
|
+
R.length > 0 && a.write(R), v = await u.read();
|
|
3496
3496
|
}
|
|
3497
3497
|
if (c) return;
|
|
3498
3498
|
const w = I.decode();
|