@datapos/datapos-tool-csv-parse 0.0.42 → 0.0.44
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.
|
@@ -1565,9 +1565,9 @@ function Zr(t) {
|
|
|
1565
1565
|
function Xr(t) {
|
|
1566
1566
|
this.charReceived = t.length % 3, this.charLength = this.charReceived ? 3 : 0;
|
|
1567
1567
|
}
|
|
1568
|
-
|
|
1568
|
+
R.ReadableState = Bt;
|
|
1569
1569
|
var b = kr("stream");
|
|
1570
|
-
oe(
|
|
1570
|
+
oe(R, p);
|
|
1571
1571
|
function Kr(t, e, r) {
|
|
1572
1572
|
if (typeof t.prependListener == "function")
|
|
1573
1573
|
return t.prependListener(e, r);
|
|
@@ -1581,19 +1581,19 @@ function Bt(t, e) {
|
|
|
1581
1581
|
var r = t.highWaterMark, n = this.objectMode ? 16 : 16 * 1024;
|
|
1582
1582
|
this.highWaterMark = r || r === 0 ? r : n, this.highWaterMark = ~~this.highWaterMark, this.buffer = new te(), this.length = 0, this.pipes = null, this.pipesCount = 0, this.flowing = null, this.ended = !1, this.endEmitted = !1, this.reading = !1, this.sync = !0, this.needReadable = !1, this.emittedReadable = !1, this.readableListening = !1, this.resumeScheduled = !1, this.defaultEncoding = t.defaultEncoding || "utf8", this.ranOut = !1, this.awaitDrain = 0, this.readingMore = !1, this.decoder = null, this.encoding = null, t.encoding && (this.decoder = new he(t.encoding), this.encoding = t.encoding);
|
|
1583
1583
|
}
|
|
1584
|
-
function
|
|
1585
|
-
if (!(this instanceof
|
|
1584
|
+
function R(t) {
|
|
1585
|
+
if (!(this instanceof R)) return new R(t);
|
|
1586
1586
|
this._readableState = new Bt(t, this), this.readable = !0, t && typeof t.read == "function" && (this._read = t.read), p.call(this);
|
|
1587
1587
|
}
|
|
1588
|
-
|
|
1588
|
+
R.prototype.push = function(t, e) {
|
|
1589
1589
|
var r = this._readableState;
|
|
1590
1590
|
return !r.objectMode && typeof t == "string" && (e = e || r.defaultEncoding, e !== r.encoding && (t = a.from(t, e), e = "")), Ut(this, r, t, e, !1);
|
|
1591
1591
|
};
|
|
1592
|
-
|
|
1592
|
+
R.prototype.unshift = function(t) {
|
|
1593
1593
|
var e = this._readableState;
|
|
1594
1594
|
return Ut(this, e, t, "", !0);
|
|
1595
1595
|
};
|
|
1596
|
-
|
|
1596
|
+
R.prototype.isPaused = function() {
|
|
1597
1597
|
return this._readableState.flowing === !1;
|
|
1598
1598
|
};
|
|
1599
1599
|
function Ut(t, e, r, n, i) {
|
|
@@ -1619,7 +1619,7 @@ function Ut(t, e, r, n, i) {
|
|
|
1619
1619
|
function tn(t) {
|
|
1620
1620
|
return !t.ended && (t.needReadable || t.length < t.highWaterMark || t.length === 0);
|
|
1621
1621
|
}
|
|
1622
|
-
|
|
1622
|
+
R.prototype.setEncoding = function(t) {
|
|
1623
1623
|
return this._readableState.decoder = new he(t), this._readableState.encoding = t, this;
|
|
1624
1624
|
};
|
|
1625
1625
|
var Ke = 8388608;
|
|
@@ -1629,7 +1629,7 @@ function rn(t) {
|
|
|
1629
1629
|
function et(t, e) {
|
|
1630
1630
|
return t <= 0 || e.length === 0 && e.ended ? 0 : e.objectMode ? 1 : t !== t ? e.flowing && e.length ? e.buffer.head.data.length : e.length : (t > e.highWaterMark && (e.highWaterMark = rn(t)), t <= e.length ? t : e.ended ? e.length : (e.needReadable = !0, 0));
|
|
1631
1631
|
}
|
|
1632
|
-
|
|
1632
|
+
R.prototype.read = function(t) {
|
|
1633
1633
|
b("read", t), t = parseInt(t, 10);
|
|
1634
1634
|
var e = this._readableState, r = t;
|
|
1635
1635
|
if (t !== 0 && (e.emittedReadable = !1), t === 0 && e.needReadable && (e.length >= e.highWaterMark || e.ended))
|
|
@@ -1669,10 +1669,10 @@ function fn(t, e) {
|
|
|
1669
1669
|
r = e.length;
|
|
1670
1670
|
e.readingMore = !1;
|
|
1671
1671
|
}
|
|
1672
|
-
|
|
1672
|
+
R.prototype._read = function(t) {
|
|
1673
1673
|
this.emit("error", new Error("not implemented"));
|
|
1674
1674
|
};
|
|
1675
|
-
|
|
1675
|
+
R.prototype.pipe = function(t, e) {
|
|
1676
1676
|
var r = this, n = this._readableState;
|
|
1677
1677
|
switch (n.pipesCount) {
|
|
1678
1678
|
case 0:
|
|
@@ -1730,7 +1730,7 @@ function an(t) {
|
|
|
1730
1730
|
b("pipeOnDrain", e.awaitDrain), e.awaitDrain && e.awaitDrain--, e.awaitDrain === 0 && t.listeners("data").length && (e.flowing = !0, Ye(t));
|
|
1731
1731
|
};
|
|
1732
1732
|
}
|
|
1733
|
-
|
|
1733
|
+
R.prototype.unpipe = function(t) {
|
|
1734
1734
|
var e = this._readableState;
|
|
1735
1735
|
if (e.pipesCount === 0) return this;
|
|
1736
1736
|
if (e.pipesCount === 1)
|
|
@@ -1745,7 +1745,7 @@ I.prototype.unpipe = function(t) {
|
|
|
1745
1745
|
var o = Pt(e.pipes, t);
|
|
1746
1746
|
return o === -1 ? this : (e.pipes.splice(o, 1), e.pipesCount -= 1, e.pipesCount === 1 && (e.pipes = e.pipes[0]), t.emit("unpipe", this), this);
|
|
1747
1747
|
};
|
|
1748
|
-
|
|
1748
|
+
R.prototype.on = function(t, e) {
|
|
1749
1749
|
var r = p.prototype.on.call(this, t, e);
|
|
1750
1750
|
if (t === "data")
|
|
1751
1751
|
this._readableState.flowing !== !1 && this.resume();
|
|
@@ -1755,11 +1755,11 @@ I.prototype.on = function(t, e) {
|
|
|
1755
1755
|
}
|
|
1756
1756
|
return r;
|
|
1757
1757
|
};
|
|
1758
|
-
|
|
1758
|
+
R.prototype.addListener = R.prototype.on;
|
|
1759
1759
|
function un(t) {
|
|
1760
1760
|
b("readable nexttick read 0"), t.read(0);
|
|
1761
1761
|
}
|
|
1762
|
-
|
|
1762
|
+
R.prototype.resume = function() {
|
|
1763
1763
|
var t = this._readableState;
|
|
1764
1764
|
return t.flowing || (b("resume"), t.flowing = !0, ln(this, t)), this;
|
|
1765
1765
|
};
|
|
@@ -1769,7 +1769,7 @@ function ln(t, e) {
|
|
|
1769
1769
|
function hn(t, e) {
|
|
1770
1770
|
e.reading || (b("resume read 0"), t.read(0)), e.resumeScheduled = !1, e.awaitDrain = 0, t.emit("resume"), Ye(t), e.flowing && !e.reading && t.read(0);
|
|
1771
1771
|
}
|
|
1772
|
-
|
|
1772
|
+
R.prototype.pause = function() {
|
|
1773
1773
|
return b("call pause flowing=%j", this._readableState.flowing), this._readableState.flowing !== !1 && (b("pause"), this._readableState.flowing = !1, this.emit("pause")), this;
|
|
1774
1774
|
};
|
|
1775
1775
|
function Ye(t) {
|
|
@@ -1777,7 +1777,7 @@ function Ye(t) {
|
|
|
1777
1777
|
for (b("flow", e.flowing); e.flowing && t.read() !== null; )
|
|
1778
1778
|
;
|
|
1779
1779
|
}
|
|
1780
|
-
|
|
1780
|
+
R.prototype.wrap = function(t) {
|
|
1781
1781
|
var e = this._readableState, r = !1, n = this;
|
|
1782
1782
|
t.on("end", function() {
|
|
1783
1783
|
if (b("wrapped end"), e.decoder && !e.ended) {
|
|
@@ -1804,7 +1804,7 @@ I.prototype.wrap = function(t) {
|
|
|
1804
1804
|
b("wrapped _read", s), r && (r = !1, t.resume());
|
|
1805
1805
|
}, n;
|
|
1806
1806
|
};
|
|
1807
|
-
|
|
1807
|
+
R._fromList = kt;
|
|
1808
1808
|
function kt(t, e) {
|
|
1809
1809
|
if (e.length === 0) return null;
|
|
1810
1810
|
var r;
|
|
@@ -2000,7 +2000,7 @@ function zt(t) {
|
|
|
2000
2000
|
t.corkedRequestsFree ? t.corkedRequestsFree.next = e : t.corkedRequestsFree = e;
|
|
2001
2001
|
};
|
|
2002
2002
|
}
|
|
2003
|
-
oe(B,
|
|
2003
|
+
oe(B, R);
|
|
2004
2004
|
var it = Object.keys(N.prototype);
|
|
2005
2005
|
for (var Fe = 0; Fe < it.length; Fe++) {
|
|
2006
2006
|
var Me = it[Fe];
|
|
@@ -2008,7 +2008,7 @@ for (var Fe = 0; Fe < it.length; Fe++) {
|
|
|
2008
2008
|
}
|
|
2009
2009
|
function B(t) {
|
|
2010
2010
|
if (!(this instanceof B)) return new B(t);
|
|
2011
|
-
|
|
2011
|
+
R.call(this, t), N.call(this, t), t && t.readable === !1 && (this.readable = !1), t && t.writable === !1 && (this.writable = !1), this.allowHalfOpen = !0, t && t.allowHalfOpen === !1 && (this.allowHalfOpen = !1), this.once("end", Cn);
|
|
2012
2012
|
}
|
|
2013
2013
|
function Cn() {
|
|
2014
2014
|
this.allowHalfOpen || this._writableState.ended || U(An, this);
|
|
@@ -2074,7 +2074,7 @@ ae.prototype._transform = function(t, e, r) {
|
|
|
2074
2074
|
r(null, t);
|
|
2075
2075
|
};
|
|
2076
2076
|
oe(V, p);
|
|
2077
|
-
V.Readable =
|
|
2077
|
+
V.Readable = R;
|
|
2078
2078
|
V.Writable = N;
|
|
2079
2079
|
V.Duplex = B;
|
|
2080
2080
|
V.Transform = k;
|
|
@@ -2698,7 +2698,7 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2698
2698
|
to: S,
|
|
2699
2699
|
to_line: w
|
|
2700
2700
|
} = this.options;
|
|
2701
|
-
let { comment: m, escape:
|
|
2701
|
+
let { comment: m, escape: I, quote: L, record_delimiter: se } = this.options;
|
|
2702
2702
|
const { bomSkipped: Yt, previousBuf: ce, rawBuffer: Wt, escapeIsQuote: Ht } = this.state;
|
|
2703
2703
|
let v;
|
|
2704
2704
|
if (ce === void 0)
|
|
@@ -2727,7 +2727,7 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2727
2727
|
});
|
|
2728
2728
|
for (const A in de)
|
|
2729
2729
|
this.options[A] = de[A];
|
|
2730
|
-
({ comment: m, escape:
|
|
2730
|
+
({ comment: m, escape: I, quote: L } = this.options);
|
|
2731
2731
|
break;
|
|
2732
2732
|
}
|
|
2733
2733
|
this.state.bomSkipped = !0;
|
|
@@ -2747,14 +2747,14 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2747
2747
|
if (y === !0 && Wt.append(C), (C === Pn || C === $n) && this.state.wasRowDelimiter === !1 && (this.state.wasRowDelimiter = !0), this.state.escaping === !0)
|
|
2748
2748
|
this.state.escaping = !1;
|
|
2749
2749
|
else {
|
|
2750
|
-
if (
|
|
2750
|
+
if (I !== null && this.state.quoting === !0 && this.__isEscape(v, d, C) && d + I.length < Ie)
|
|
2751
2751
|
if (Ht) {
|
|
2752
|
-
if (this.__isQuote(v, d +
|
|
2753
|
-
this.state.escaping = !0, d +=
|
|
2752
|
+
if (this.__isQuote(v, d + I.length)) {
|
|
2753
|
+
this.state.escaping = !0, d += I.length - 1;
|
|
2754
2754
|
continue;
|
|
2755
2755
|
}
|
|
2756
2756
|
} else {
|
|
2757
|
-
this.state.escaping = !0, d +=
|
|
2757
|
+
this.state.escaping = !0, d += I.length - 1;
|
|
2758
2758
|
continue;
|
|
2759
2759
|
}
|
|
2760
2760
|
if (this.state.commenting === !1 && this.__isQuote(v, d))
|
|
@@ -2764,8 +2764,8 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2764
2764
|
d + L.length,
|
|
2765
2765
|
A
|
|
2766
2766
|
), pe = se.length === 0 ? this.__autoDiscoverRecordDelimiter(v, d + L.length) : this.__isRecordDelimiter(A, v, d + L.length);
|
|
2767
|
-
if (
|
|
2768
|
-
d +=
|
|
2767
|
+
if (I !== null && this.__isEscape(v, d, C) && this.__isQuote(v, d + I.length))
|
|
2768
|
+
d += I.length - 1;
|
|
2769
2769
|
else if (!A || X || pe || j || Z) {
|
|
2770
2770
|
this.state.quoting = !1, this.state.wasQuoting = !0, d += L.length - 1;
|
|
2771
2771
|
continue;
|
|
@@ -2989,19 +2989,19 @@ const Nn = 12, Dn = 13, Fn = 10, Mn = 32, Bn = 9, Un = function(t) {
|
|
|
2989
2989
|
const { objname: S } = this.options;
|
|
2990
2990
|
if (i !== !1) {
|
|
2991
2991
|
const w = {};
|
|
2992
|
-
for (let m = 0,
|
|
2992
|
+
for (let m = 0, I = E.length; m < I; m++)
|
|
2993
2993
|
i[m] === void 0 || i[m].disabled || (o === !0 && w[i[m].name] !== void 0 ? Array.isArray(w[i[m].name]) ? w[i[m].name] = w[i[m].name].concat(E[m]) : w[i[m].name] = [w[i[m].name], E[m]] : w[i[m].name] = E[m]);
|
|
2994
2994
|
if (g === !0 || f === !0) {
|
|
2995
2995
|
const m = Object.assign(
|
|
2996
2996
|
{ record: w },
|
|
2997
2997
|
g === !0 ? { raw: this.state.rawBuffer.toString(s) } : {},
|
|
2998
2998
|
f === !0 ? { info: this.__infoRecord() } : {}
|
|
2999
|
-
),
|
|
2999
|
+
), I = this.__push(
|
|
3000
3000
|
S === void 0 ? m : [w[S], m],
|
|
3001
3001
|
n
|
|
3002
3002
|
);
|
|
3003
|
-
if (
|
|
3004
|
-
return
|
|
3003
|
+
if (I)
|
|
3004
|
+
return I;
|
|
3005
3005
|
} else {
|
|
3006
3006
|
const m = this.__push(
|
|
3007
3007
|
S === void 0 ? w : [w[S], w],
|
|
@@ -3397,18 +3397,17 @@ class Gn {
|
|
|
3397
3397
|
f = ut(e), l = this.constructRowBuffer({ chunk: () => {
|
|
3398
3398
|
}, chunkSize: r.chunkSize ?? Qn }), f.on("readable", () => {
|
|
3399
3399
|
try {
|
|
3400
|
-
const
|
|
3400
|
+
const I = c;
|
|
3401
3401
|
if (f == null || l == null) return;
|
|
3402
3402
|
let L;
|
|
3403
3403
|
for (; (L = f.read()) != null; ) {
|
|
3404
3404
|
if (c++, h) return;
|
|
3405
3405
|
i.signal.throwIfAborted(), l.push(L);
|
|
3406
3406
|
}
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
O(R);
|
|
3407
|
+
} catch (I) {
|
|
3408
|
+
O(I);
|
|
3410
3409
|
}
|
|
3411
|
-
}), f.on("error", (
|
|
3410
|
+
}), f.on("error", (I) => O(I)), f.on("end", () => {
|
|
3412
3411
|
h || (l?.flush(), o(this.constructSummary(f)));
|
|
3413
3412
|
});
|
|
3414
3413
|
const x = await fetch(encodeURI(n), { signal: i.signal });
|
|
@@ -3416,11 +3415,11 @@ class Gn {
|
|
|
3416
3415
|
throw await Yn(x, `Failed to fetch '${n}' file.`, "datapos-connector-file-store-emulator|Connector|retrieve");
|
|
3417
3416
|
u = x.body.pipeThrough(new TextDecoderStream(r.encodingId)).getReader();
|
|
3418
3417
|
let S = await u.read(), w = Promise.resolve();
|
|
3419
|
-
const m = (
|
|
3418
|
+
const m = (I) => {
|
|
3420
3419
|
const L = f;
|
|
3421
3420
|
w = w.then(() => {
|
|
3422
3421
|
if (!(h || L == null))
|
|
3423
|
-
return this.writeToParser(L,
|
|
3422
|
+
return this.writeToParser(L, I);
|
|
3424
3423
|
}).catch((se) => {
|
|
3425
3424
|
O(se);
|
|
3426
3425
|
});
|