@teselagen/file-utils 0.3.17 → 0.3.18
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/index.cjs +230 -259
- package/index.js +230 -259
- package/index.umd.cjs +230 -259
- package/package.json +2 -2
- package/src/file-utils.js +1 -12
package/index.js
CHANGED
|
@@ -9475,7 +9475,7 @@ const Promise$1 = /* @__PURE__ */ getDefaultExportFromCjs(bluebirdExports);
|
|
|
9475
9475
|
var papaparse_min = { exports: {} };
|
|
9476
9476
|
/* @license
|
|
9477
9477
|
Papa Parse
|
|
9478
|
-
v5.
|
|
9478
|
+
v5.3.2
|
|
9479
9479
|
https://github.com/mholt/PapaParse
|
|
9480
9480
|
License: MIT
|
|
9481
9481
|
*/
|
|
@@ -9484,28 +9484,24 @@ License: MIT
|
|
|
9484
9484
|
module2.exports = t();
|
|
9485
9485
|
}(commonjsGlobal, /* @__PURE__ */ __name(function s() {
|
|
9486
9486
|
var f = "undefined" != typeof self ? self : "undefined" != typeof window ? window : void 0 !== f ? f : {};
|
|
9487
|
-
var n = !f.document && !!f.postMessage, o = f.
|
|
9488
|
-
var
|
|
9489
|
-
|
|
9490
|
-
if (t.dynamicTyping =
|
|
9491
|
-
var
|
|
9487
|
+
var n = !f.document && !!f.postMessage, o = n && /blob:/i.test((f.location || {}).protocol), a = {}, h = 0, b = { parse: function(e, t) {
|
|
9488
|
+
var i2 = (t = t || {}).dynamicTyping || false;
|
|
9489
|
+
M(i2) && (t.dynamicTypingFunction = i2, i2 = {});
|
|
9490
|
+
if (t.dynamicTyping = i2, t.transform = !!M(t.transform) && t.transform, t.worker && b.WORKERS_SUPPORTED) {
|
|
9491
|
+
var r = function() {
|
|
9492
9492
|
if (!b.WORKERS_SUPPORTED)
|
|
9493
9493
|
return false;
|
|
9494
|
-
var e2 = (
|
|
9495
|
-
var
|
|
9496
|
-
return t2.onmessage = _, t2.id =
|
|
9494
|
+
var e2 = (i3 = f.URL || f.webkitURL || null, r2 = s.toString(), b.BLOB_URL || (b.BLOB_URL = i3.createObjectURL(new Blob(["(", r2, ")();"], { type: "text/javascript" })))), t2 = new f.Worker(e2);
|
|
9495
|
+
var i3, r2;
|
|
9496
|
+
return t2.onmessage = _, t2.id = h++, a[t2.id] = t2;
|
|
9497
9497
|
}();
|
|
9498
|
-
return
|
|
9498
|
+
return r.userStep = t.step, r.userChunk = t.chunk, r.userComplete = t.complete, r.userError = t.error, t.step = M(t.step), t.chunk = M(t.chunk), t.complete = M(t.complete), t.error = M(t.error), delete t.worker, void r.postMessage({ input: e, config: t, workerId: r.id });
|
|
9499
9499
|
}
|
|
9500
9500
|
var n2 = null;
|
|
9501
|
-
b.NODE_STREAM_INPUT, "string" == typeof e ? (e =
|
|
9502
|
-
if (65279 === e2.charCodeAt(0))
|
|
9503
|
-
return e2.slice(1);
|
|
9504
|
-
return e2;
|
|
9505
|
-
}(e), n2 = t.download ? new l(t) : new p(t)) : true === e.readable && J(e.read) && J(e.on) ? n2 = new g(t) : (f.File && e instanceof File || e instanceof Object) && (n2 = new c(t));
|
|
9501
|
+
b.NODE_STREAM_INPUT, "string" == typeof e ? n2 = t.download ? new l(t) : new p(t) : true === e.readable && M(e.read) && M(e.on) ? n2 = new g(t) : (f.File && e instanceof File || e instanceof Object) && (n2 = new c(t));
|
|
9506
9502
|
return n2.stream(e);
|
|
9507
9503
|
}, unparse: function(e, t) {
|
|
9508
|
-
var n2 = false, _2 = true, m2 = ",", y2 = "\r\n", s2 = '"', a2 = s2 + s2,
|
|
9504
|
+
var n2 = false, _2 = true, m2 = ",", y2 = "\r\n", s2 = '"', a2 = s2 + s2, i2 = false, r = null, o2 = false;
|
|
9509
9505
|
!function() {
|
|
9510
9506
|
if ("object" != typeof t)
|
|
9511
9507
|
return;
|
|
@@ -9513,149 +9509,149 @@ License: MIT
|
|
|
9513
9509
|
return -1 !== t.delimiter.indexOf(e2);
|
|
9514
9510
|
}).length || (m2 = t.delimiter);
|
|
9515
9511
|
("boolean" == typeof t.quotes || "function" == typeof t.quotes || Array.isArray(t.quotes)) && (n2 = t.quotes);
|
|
9516
|
-
"boolean" != typeof t.skipEmptyLines && "string" != typeof t.skipEmptyLines || (
|
|
9512
|
+
"boolean" != typeof t.skipEmptyLines && "string" != typeof t.skipEmptyLines || (i2 = t.skipEmptyLines);
|
|
9517
9513
|
"string" == typeof t.newline && (y2 = t.newline);
|
|
9518
9514
|
"string" == typeof t.quoteChar && (s2 = t.quoteChar);
|
|
9519
9515
|
"boolean" == typeof t.header && (_2 = t.header);
|
|
9520
9516
|
if (Array.isArray(t.columns)) {
|
|
9521
9517
|
if (0 === t.columns.length)
|
|
9522
9518
|
throw new Error("Option columns is empty");
|
|
9523
|
-
|
|
9519
|
+
r = t.columns;
|
|
9524
9520
|
}
|
|
9525
9521
|
void 0 !== t.escapeChar && (a2 = t.escapeChar + s2);
|
|
9526
9522
|
("boolean" == typeof t.escapeFormulae || t.escapeFormulae instanceof RegExp) && (o2 = t.escapeFormulae instanceof RegExp ? t.escapeFormulae : /^[=+\-@\t\r].*$/);
|
|
9527
9523
|
}();
|
|
9528
|
-
var
|
|
9524
|
+
var h2 = new RegExp(j(s2), "g");
|
|
9529
9525
|
"string" == typeof e && (e = JSON.parse(e));
|
|
9530
9526
|
if (Array.isArray(e)) {
|
|
9531
9527
|
if (!e.length || Array.isArray(e[0]))
|
|
9532
|
-
return
|
|
9528
|
+
return u2(null, e, i2);
|
|
9533
9529
|
if ("object" == typeof e[0])
|
|
9534
|
-
return
|
|
9530
|
+
return u2(r || Object.keys(e[0]), e, i2);
|
|
9535
9531
|
} else if ("object" == typeof e)
|
|
9536
|
-
return "string" == typeof e.data && (e.data = JSON.parse(e.data)), Array.isArray(e.data) && (e.fields || (e.fields = e.meta && e.meta.fields ||
|
|
9532
|
+
return "string" == typeof e.data && (e.data = JSON.parse(e.data)), Array.isArray(e.data) && (e.fields || (e.fields = e.meta && e.meta.fields || r), e.fields || (e.fields = Array.isArray(e.data[0]) ? e.fields : "object" == typeof e.data[0] ? Object.keys(e.data[0]) : []), Array.isArray(e.data[0]) || "object" == typeof e.data[0] || (e.data = [e.data])), u2(e.fields || [], e.data || [], i2);
|
|
9537
9533
|
throw new Error("Unable to serialize unrecognized input");
|
|
9538
|
-
function
|
|
9539
|
-
var
|
|
9534
|
+
function u2(e2, t2, i3) {
|
|
9535
|
+
var r2 = "";
|
|
9540
9536
|
"string" == typeof e2 && (e2 = JSON.parse(e2)), "string" == typeof t2 && (t2 = JSON.parse(t2));
|
|
9541
9537
|
var n3 = Array.isArray(e2) && 0 < e2.length, s3 = !Array.isArray(t2[0]);
|
|
9542
9538
|
if (n3 && _2) {
|
|
9543
9539
|
for (var a3 = 0; a3 < e2.length; a3++)
|
|
9544
|
-
0 < a3 && (
|
|
9545
|
-
0 < t2.length && (
|
|
9540
|
+
0 < a3 && (r2 += m2), r2 += v2(e2[a3], a3);
|
|
9541
|
+
0 < t2.length && (r2 += y2);
|
|
9546
9542
|
}
|
|
9547
9543
|
for (var o3 = 0; o3 < t2.length; o3++) {
|
|
9548
|
-
var
|
|
9549
|
-
if (
|
|
9550
|
-
for (var d2 = [], l2 = 0; l2 <
|
|
9544
|
+
var h3 = n3 ? e2.length : t2[o3].length, u3 = false, f2 = n3 ? 0 === Object.keys(t2[o3]).length : 0 === t2[o3].length;
|
|
9545
|
+
if (i3 && !n3 && (u3 = "greedy" === i3 ? "" === t2[o3].join("").trim() : 1 === t2[o3].length && 0 === t2[o3][0].length), "greedy" === i3 && n3) {
|
|
9546
|
+
for (var d2 = [], l2 = 0; l2 < h3; l2++) {
|
|
9551
9547
|
var c2 = s3 ? e2[l2] : l2;
|
|
9552
9548
|
d2.push(t2[o3][c2]);
|
|
9553
9549
|
}
|
|
9554
|
-
|
|
9550
|
+
u3 = "" === d2.join("").trim();
|
|
9555
9551
|
}
|
|
9556
|
-
if (!
|
|
9557
|
-
for (var p2 = 0; p2 <
|
|
9558
|
-
0 < p2 && !f2 && (
|
|
9552
|
+
if (!u3) {
|
|
9553
|
+
for (var p2 = 0; p2 < h3; p2++) {
|
|
9554
|
+
0 < p2 && !f2 && (r2 += m2);
|
|
9559
9555
|
var g2 = n3 && s3 ? e2[p2] : p2;
|
|
9560
|
-
|
|
9556
|
+
r2 += v2(t2[o3][g2], p2);
|
|
9561
9557
|
}
|
|
9562
|
-
o3 < t2.length - 1 && (!
|
|
9558
|
+
o3 < t2.length - 1 && (!i3 || 0 < h3 && !f2) && (r2 += y2);
|
|
9563
9559
|
}
|
|
9564
9560
|
}
|
|
9565
|
-
return
|
|
9561
|
+
return r2;
|
|
9566
9562
|
}
|
|
9567
|
-
__name(
|
|
9563
|
+
__name(u2, "u");
|
|
9568
9564
|
function v2(e2, t2) {
|
|
9569
9565
|
if (null == e2)
|
|
9570
9566
|
return "";
|
|
9571
9567
|
if (e2.constructor === Date)
|
|
9572
9568
|
return JSON.stringify(e2).slice(1, 25);
|
|
9573
|
-
var
|
|
9574
|
-
o2 && "string" == typeof e2 && o2.test(e2) && (e2 = "'" + e2,
|
|
9575
|
-
var
|
|
9576
|
-
return (
|
|
9577
|
-
for (var
|
|
9578
|
-
if (-1 < e3.indexOf(t3[
|
|
9569
|
+
var i3 = false;
|
|
9570
|
+
o2 && "string" == typeof e2 && o2.test(e2) && (e2 = "'" + e2, i3 = true);
|
|
9571
|
+
var r2 = e2.toString().replace(h2, a2);
|
|
9572
|
+
return (i3 = i3 || true === n2 || "function" == typeof n2 && n2(e2, t2) || Array.isArray(n2) && n2[t2] || function(e3, t3) {
|
|
9573
|
+
for (var i4 = 0; i4 < t3.length; i4++)
|
|
9574
|
+
if (-1 < e3.indexOf(t3[i4]))
|
|
9579
9575
|
return true;
|
|
9580
9576
|
return false;
|
|
9581
|
-
}(
|
|
9577
|
+
}(r2, b.BAD_DELIMITERS) || -1 < r2.indexOf(m2) || " " === r2.charAt(0) || " " === r2.charAt(r2.length - 1)) ? s2 + r2 + s2 : r2;
|
|
9582
9578
|
}
|
|
9583
9579
|
__name(v2, "v");
|
|
9584
9580
|
} };
|
|
9585
|
-
if (b.RECORD_SEP = String.fromCharCode(30), b.UNIT_SEP = String.fromCharCode(31), b.BYTE_ORDER_MARK = "\uFEFF", b.BAD_DELIMITERS = ["\r", "\n", '"', b.BYTE_ORDER_MARK], b.WORKERS_SUPPORTED = !n && !!f.Worker, b.NODE_STREAM_INPUT = 1, b.LocalChunkSize = 10485760, b.RemoteChunkSize = 5242880, b.DefaultDelimiter = ",", b.Parser = E, b.ParserHandle =
|
|
9581
|
+
if (b.RECORD_SEP = String.fromCharCode(30), b.UNIT_SEP = String.fromCharCode(31), b.BYTE_ORDER_MARK = "\uFEFF", b.BAD_DELIMITERS = ["\r", "\n", '"', b.BYTE_ORDER_MARK], b.WORKERS_SUPPORTED = !n && !!f.Worker, b.NODE_STREAM_INPUT = 1, b.LocalChunkSize = 10485760, b.RemoteChunkSize = 5242880, b.DefaultDelimiter = ",", b.Parser = E, b.ParserHandle = i, b.NetworkStreamer = l, b.FileStreamer = c, b.StringStreamer = p, b.ReadableStreamStreamer = g, f.jQuery) {
|
|
9586
9582
|
var d = f.jQuery;
|
|
9587
9583
|
d.fn.parse = function(o2) {
|
|
9588
|
-
var
|
|
9584
|
+
var i2 = o2.config || {}, h2 = [];
|
|
9589
9585
|
return this.each(function(e2) {
|
|
9590
9586
|
if (!("INPUT" === d(this).prop("tagName").toUpperCase() && "file" === d(this).attr("type").toLowerCase() && f.FileReader) || !this.files || 0 === this.files.length)
|
|
9591
9587
|
return true;
|
|
9592
9588
|
for (var t = 0; t < this.files.length; t++)
|
|
9593
|
-
|
|
9589
|
+
h2.push({ file: this.files[t], inputElem: this, instanceConfig: d.extend({}, i2) });
|
|
9594
9590
|
}), e(), this;
|
|
9595
9591
|
function e() {
|
|
9596
|
-
if (0 !==
|
|
9597
|
-
var e2, t,
|
|
9598
|
-
if (
|
|
9592
|
+
if (0 !== h2.length) {
|
|
9593
|
+
var e2, t, i3, r, n2 = h2[0];
|
|
9594
|
+
if (M(o2.before)) {
|
|
9599
9595
|
var s2 = o2.before(n2.file, n2.inputElem);
|
|
9600
9596
|
if ("object" == typeof s2) {
|
|
9601
9597
|
if ("abort" === s2.action)
|
|
9602
|
-
return e2 = "AbortError", t = n2.file,
|
|
9598
|
+
return e2 = "AbortError", t = n2.file, i3 = n2.inputElem, r = s2.reason, void (M(o2.error) && o2.error({ name: e2 }, t, i3, r));
|
|
9603
9599
|
if ("skip" === s2.action)
|
|
9604
|
-
return void
|
|
9600
|
+
return void u2();
|
|
9605
9601
|
"object" == typeof s2.config && (n2.instanceConfig = d.extend(n2.instanceConfig, s2.config));
|
|
9606
9602
|
} else if ("skip" === s2)
|
|
9607
|
-
return void
|
|
9603
|
+
return void u2();
|
|
9608
9604
|
}
|
|
9609
9605
|
var a2 = n2.instanceConfig.complete;
|
|
9610
9606
|
n2.instanceConfig.complete = function(e3) {
|
|
9611
|
-
|
|
9607
|
+
M(a2) && a2(e3, n2.file, n2.inputElem), u2();
|
|
9612
9608
|
}, b.parse(n2.file, n2.instanceConfig);
|
|
9613
9609
|
} else
|
|
9614
|
-
|
|
9610
|
+
M(o2.complete) && o2.complete();
|
|
9615
9611
|
}
|
|
9616
9612
|
__name(e, "e");
|
|
9617
|
-
function
|
|
9618
|
-
|
|
9613
|
+
function u2() {
|
|
9614
|
+
h2.splice(0, 1), e();
|
|
9619
9615
|
}
|
|
9620
|
-
__name(
|
|
9616
|
+
__name(u2, "u");
|
|
9621
9617
|
};
|
|
9622
9618
|
}
|
|
9623
|
-
function
|
|
9619
|
+
function u(e) {
|
|
9624
9620
|
this._handle = null, this._finished = false, this._completed = false, this._halted = false, this._input = null, this._baseIndex = 0, this._partialLine = "", this._rowCount = 0, this._start = 0, this._nextChunk = null, this.isFirstChunk = true, this._completeResults = { data: [], errors: [], meta: {} }, function(e2) {
|
|
9625
9621
|
var t = w(e2);
|
|
9626
9622
|
t.chunkSize = parseInt(t.chunkSize), e2.step || e2.chunk || (t.chunkSize = null);
|
|
9627
|
-
this._handle = new
|
|
9623
|
+
this._handle = new i(t), (this._handle.streamer = this)._config = t;
|
|
9628
9624
|
}.call(this, e), this.parseChunk = function(e2, t) {
|
|
9629
|
-
if (this.isFirstChunk &&
|
|
9630
|
-
var
|
|
9631
|
-
void 0 !==
|
|
9625
|
+
if (this.isFirstChunk && M(this._config.beforeFirstChunk)) {
|
|
9626
|
+
var i2 = this._config.beforeFirstChunk(e2);
|
|
9627
|
+
void 0 !== i2 && (e2 = i2);
|
|
9632
9628
|
}
|
|
9633
9629
|
this.isFirstChunk = false, this._halted = false;
|
|
9634
|
-
var
|
|
9630
|
+
var r = this._partialLine + e2;
|
|
9635
9631
|
this._partialLine = "";
|
|
9636
|
-
var n2 = this._handle.parse(
|
|
9632
|
+
var n2 = this._handle.parse(r, this._baseIndex, !this._finished);
|
|
9637
9633
|
if (!this._handle.paused() && !this._handle.aborted()) {
|
|
9638
9634
|
var s2 = n2.meta.cursor;
|
|
9639
|
-
this._finished || (this._partialLine =
|
|
9635
|
+
this._finished || (this._partialLine = r.substring(s2 - this._baseIndex), this._baseIndex = s2), n2 && n2.data && (this._rowCount += n2.data.length);
|
|
9640
9636
|
var a2 = this._finished || this._config.preview && this._rowCount >= this._config.preview;
|
|
9641
9637
|
if (o)
|
|
9642
9638
|
f.postMessage({ results: n2, workerId: b.WORKER_ID, finished: a2 });
|
|
9643
|
-
else if (
|
|
9639
|
+
else if (M(this._config.chunk) && !t) {
|
|
9644
9640
|
if (this._config.chunk(n2, this._handle), this._handle.paused() || this._handle.aborted())
|
|
9645
9641
|
return void (this._halted = true);
|
|
9646
9642
|
n2 = void 0, this._completeResults = void 0;
|
|
9647
9643
|
}
|
|
9648
|
-
return this._config.step || this._config.chunk || (this._completeResults.data = this._completeResults.data.concat(n2.data), this._completeResults.errors = this._completeResults.errors.concat(n2.errors), this._completeResults.meta = n2.meta), this._completed || !a2 || !
|
|
9644
|
+
return this._config.step || this._config.chunk || (this._completeResults.data = this._completeResults.data.concat(n2.data), this._completeResults.errors = this._completeResults.errors.concat(n2.errors), this._completeResults.meta = n2.meta), this._completed || !a2 || !M(this._config.complete) || n2 && n2.meta.aborted || (this._config.complete(this._completeResults, this._input), this._completed = true), a2 || n2 && n2.meta.paused || this._nextChunk(), n2;
|
|
9649
9645
|
}
|
|
9650
9646
|
this._halted = true;
|
|
9651
9647
|
}, this._sendError = function(e2) {
|
|
9652
|
-
|
|
9648
|
+
M(this._config.error) ? this._config.error(e2) : o && this._config.error && f.postMessage({ workerId: b.WORKER_ID, error: e2, finished: false });
|
|
9653
9649
|
};
|
|
9654
9650
|
}
|
|
9655
|
-
__name(
|
|
9651
|
+
__name(u, "u");
|
|
9656
9652
|
function l(e) {
|
|
9657
|
-
var
|
|
9658
|
-
(e = e || {}).chunkSize || (e.chunkSize = b.RemoteChunkSize),
|
|
9653
|
+
var r;
|
|
9654
|
+
(e = e || {}).chunkSize || (e.chunkSize = b.RemoteChunkSize), u.call(this, e), this._nextChunk = n ? function() {
|
|
9659
9655
|
this._readChunk(), this._chunkLoaded();
|
|
9660
9656
|
} : function() {
|
|
9661
9657
|
this._readChunk();
|
|
@@ -9665,41 +9661,41 @@ License: MIT
|
|
|
9665
9661
|
if (this._finished)
|
|
9666
9662
|
this._chunkLoaded();
|
|
9667
9663
|
else {
|
|
9668
|
-
if (
|
|
9664
|
+
if (r = new XMLHttpRequest(), this._config.withCredentials && (r.withCredentials = this._config.withCredentials), n || (r.onload = v(this._chunkLoaded, this), r.onerror = v(this._chunkError, this)), r.open(this._config.downloadRequestBody ? "POST" : "GET", this._input, !n), this._config.downloadRequestHeaders) {
|
|
9669
9665
|
var e2 = this._config.downloadRequestHeaders;
|
|
9670
9666
|
for (var t in e2)
|
|
9671
|
-
|
|
9667
|
+
r.setRequestHeader(t, e2[t]);
|
|
9672
9668
|
}
|
|
9673
9669
|
if (this._config.chunkSize) {
|
|
9674
|
-
var
|
|
9675
|
-
|
|
9670
|
+
var i2 = this._start + this._config.chunkSize - 1;
|
|
9671
|
+
r.setRequestHeader("Range", "bytes=" + this._start + "-" + i2);
|
|
9676
9672
|
}
|
|
9677
9673
|
try {
|
|
9678
|
-
|
|
9674
|
+
r.send(this._config.downloadRequestBody);
|
|
9679
9675
|
} catch (e3) {
|
|
9680
9676
|
this._chunkError(e3.message);
|
|
9681
9677
|
}
|
|
9682
|
-
n && 0 ===
|
|
9678
|
+
n && 0 === r.status && this._chunkError();
|
|
9683
9679
|
}
|
|
9684
9680
|
}, this._chunkLoaded = function() {
|
|
9685
|
-
4 ===
|
|
9681
|
+
4 === r.readyState && (r.status < 200 || 400 <= r.status ? this._chunkError() : (this._start += this._config.chunkSize ? this._config.chunkSize : r.responseText.length, this._finished = !this._config.chunkSize || this._start >= function(e2) {
|
|
9686
9682
|
var t = e2.getResponseHeader("Content-Range");
|
|
9687
9683
|
if (null === t)
|
|
9688
9684
|
return -1;
|
|
9689
9685
|
return parseInt(t.substring(t.lastIndexOf("/") + 1));
|
|
9690
|
-
}(
|
|
9686
|
+
}(r), this.parseChunk(r.responseText)));
|
|
9691
9687
|
}, this._chunkError = function(e2) {
|
|
9692
|
-
var t =
|
|
9688
|
+
var t = r.statusText || e2;
|
|
9693
9689
|
this._sendError(new Error(t));
|
|
9694
9690
|
};
|
|
9695
9691
|
}
|
|
9696
9692
|
__name(l, "l");
|
|
9697
9693
|
function c(e) {
|
|
9698
|
-
var
|
|
9699
|
-
(e = e || {}).chunkSize || (e.chunkSize = b.LocalChunkSize),
|
|
9694
|
+
var r, n2;
|
|
9695
|
+
(e = e || {}).chunkSize || (e.chunkSize = b.LocalChunkSize), u.call(this, e);
|
|
9700
9696
|
var s2 = "undefined" != typeof FileReader;
|
|
9701
9697
|
this.stream = function(e2) {
|
|
9702
|
-
this._input = e2, n2 = e2.slice || e2.webkitSlice || e2.mozSlice, s2 ? ((
|
|
9698
|
+
this._input = e2, n2 = e2.slice || e2.webkitSlice || e2.mozSlice, s2 ? ((r = new FileReader()).onload = v(this._chunkLoaded, this), r.onerror = v(this._chunkError, this)) : r = new FileReaderSync(), this._nextChunk();
|
|
9703
9699
|
}, this._nextChunk = function() {
|
|
9704
9700
|
this._finished || this._config.preview && !(this._rowCount < this._config.preview) || this._readChunk();
|
|
9705
9701
|
}, this._readChunk = function() {
|
|
@@ -9708,58 +9704,58 @@ License: MIT
|
|
|
9708
9704
|
var t = Math.min(this._start + this._config.chunkSize, this._input.size);
|
|
9709
9705
|
e2 = n2.call(e2, this._start, t);
|
|
9710
9706
|
}
|
|
9711
|
-
var
|
|
9712
|
-
s2 || this._chunkLoaded({ target: { result:
|
|
9707
|
+
var i2 = r.readAsText(e2, this._config.encoding);
|
|
9708
|
+
s2 || this._chunkLoaded({ target: { result: i2 } });
|
|
9713
9709
|
}, this._chunkLoaded = function(e2) {
|
|
9714
9710
|
this._start += this._config.chunkSize, this._finished = !this._config.chunkSize || this._start >= this._input.size, this.parseChunk(e2.target.result);
|
|
9715
9711
|
}, this._chunkError = function() {
|
|
9716
|
-
this._sendError(
|
|
9712
|
+
this._sendError(r.error);
|
|
9717
9713
|
};
|
|
9718
9714
|
}
|
|
9719
9715
|
__name(c, "c");
|
|
9720
9716
|
function p(e) {
|
|
9721
|
-
var
|
|
9722
|
-
|
|
9723
|
-
return
|
|
9717
|
+
var i2;
|
|
9718
|
+
u.call(this, e = e || {}), this.stream = function(e2) {
|
|
9719
|
+
return i2 = e2, this._nextChunk();
|
|
9724
9720
|
}, this._nextChunk = function() {
|
|
9725
9721
|
if (!this._finished) {
|
|
9726
9722
|
var e2, t = this._config.chunkSize;
|
|
9727
|
-
return t ? (e2 =
|
|
9723
|
+
return t ? (e2 = i2.substring(0, t), i2 = i2.substring(t)) : (e2 = i2, i2 = ""), this._finished = !i2, this.parseChunk(e2);
|
|
9728
9724
|
}
|
|
9729
9725
|
};
|
|
9730
9726
|
}
|
|
9731
9727
|
__name(p, "p");
|
|
9732
9728
|
function g(e) {
|
|
9733
|
-
|
|
9734
|
-
var t = [],
|
|
9729
|
+
u.call(this, e = e || {});
|
|
9730
|
+
var t = [], i2 = true, r = false;
|
|
9735
9731
|
this.pause = function() {
|
|
9736
|
-
|
|
9732
|
+
u.prototype.pause.apply(this, arguments), this._input.pause();
|
|
9737
9733
|
}, this.resume = function() {
|
|
9738
|
-
|
|
9734
|
+
u.prototype.resume.apply(this, arguments), this._input.resume();
|
|
9739
9735
|
}, this.stream = function(e2) {
|
|
9740
9736
|
this._input = e2, this._input.on("data", this._streamData), this._input.on("end", this._streamEnd), this._input.on("error", this._streamError);
|
|
9741
9737
|
}, this._checkIsFinished = function() {
|
|
9742
|
-
|
|
9738
|
+
r && 1 === t.length && (this._finished = true);
|
|
9743
9739
|
}, this._nextChunk = function() {
|
|
9744
|
-
this._checkIsFinished(), t.length ? this.parseChunk(t.shift()) :
|
|
9740
|
+
this._checkIsFinished(), t.length ? this.parseChunk(t.shift()) : i2 = true;
|
|
9745
9741
|
}, this._streamData = v(function(e2) {
|
|
9746
9742
|
try {
|
|
9747
|
-
t.push("string" == typeof e2 ? e2 : e2.toString(this._config.encoding)),
|
|
9743
|
+
t.push("string" == typeof e2 ? e2 : e2.toString(this._config.encoding)), i2 && (i2 = false, this._checkIsFinished(), this.parseChunk(t.shift()));
|
|
9748
9744
|
} catch (e3) {
|
|
9749
9745
|
this._streamError(e3);
|
|
9750
9746
|
}
|
|
9751
9747
|
}, this), this._streamError = v(function(e2) {
|
|
9752
9748
|
this._streamCleanUp(), this._sendError(e2);
|
|
9753
9749
|
}, this), this._streamEnd = v(function() {
|
|
9754
|
-
this._streamCleanUp(),
|
|
9750
|
+
this._streamCleanUp(), r = true, this._streamData("");
|
|
9755
9751
|
}, this), this._streamCleanUp = v(function() {
|
|
9756
9752
|
this._input.removeListener("data", this._streamData), this._input.removeListener("end", this._streamEnd), this._input.removeListener("error", this._streamError);
|
|
9757
9753
|
}, this);
|
|
9758
9754
|
}
|
|
9759
9755
|
__name(g, "g");
|
|
9760
|
-
function
|
|
9761
|
-
var a2, o2,
|
|
9762
|
-
if (
|
|
9756
|
+
function i(m2) {
|
|
9757
|
+
var a2, o2, h2, r = Math.pow(2, 53), n2 = -r, s2 = /^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/, u2 = /^(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))$/, t = this, i2 = 0, f2 = 0, d2 = false, e = false, l2 = [], c2 = { data: [], errors: [], meta: {} };
|
|
9758
|
+
if (M(m2.step)) {
|
|
9763
9759
|
var p2 = m2.step;
|
|
9764
9760
|
m2.step = function(e2) {
|
|
9765
9761
|
if (c2 = e2, _2())
|
|
@@ -9767,7 +9763,7 @@ License: MIT
|
|
|
9767
9763
|
else {
|
|
9768
9764
|
if (g2(), 0 === c2.data.length)
|
|
9769
9765
|
return;
|
|
9770
|
-
|
|
9766
|
+
i2 += e2.data.length, m2.preview && i2 > m2.preview ? o2.abort() : (c2.data = c2.data[0], p2(c2, t));
|
|
9771
9767
|
}
|
|
9772
9768
|
};
|
|
9773
9769
|
}
|
|
@@ -9776,13 +9772,13 @@ License: MIT
|
|
|
9776
9772
|
}
|
|
9777
9773
|
__name(y2, "y");
|
|
9778
9774
|
function g2() {
|
|
9779
|
-
return c2 &&
|
|
9775
|
+
return c2 && h2 && (k("Delimiter", "UndetectableDelimiter", "Unable to auto-detect delimiting character; defaulted to '" + b.DefaultDelimiter + "'"), h2 = false), m2.skipEmptyLines && (c2.data = c2.data.filter(function(e2) {
|
|
9780
9776
|
return !y2(e2);
|
|
9781
9777
|
})), _2() && function() {
|
|
9782
9778
|
if (!c2)
|
|
9783
9779
|
return;
|
|
9784
9780
|
function e2(e3, t3) {
|
|
9785
|
-
|
|
9781
|
+
M(m2.transformHeader) && (e3 = m2.transformHeader(e3, t3)), l2.push(e3);
|
|
9786
9782
|
}
|
|
9787
9783
|
__name(e2, "e");
|
|
9788
9784
|
if (Array.isArray(c2.data[0])) {
|
|
@@ -9795,12 +9791,12 @@ License: MIT
|
|
|
9795
9791
|
if (!c2 || !m2.header && !m2.dynamicTyping && !m2.transform)
|
|
9796
9792
|
return c2;
|
|
9797
9793
|
function e2(e3, t3) {
|
|
9798
|
-
var
|
|
9799
|
-
for (
|
|
9800
|
-
var n3 =
|
|
9801
|
-
m2.header && (n3 =
|
|
9794
|
+
var i3, r2 = m2.header ? {} : [];
|
|
9795
|
+
for (i3 = 0; i3 < e3.length; i3++) {
|
|
9796
|
+
var n3 = i3, s3 = e3[i3];
|
|
9797
|
+
m2.header && (n3 = i3 >= l2.length ? "__parsed_extra" : l2[i3]), m2.transform && (s3 = m2.transform(s3, n3)), s3 = v2(n3, s3), "__parsed_extra" === n3 ? (r2[n3] = r2[n3] || [], r2[n3].push(s3)) : r2[n3] = s3;
|
|
9802
9798
|
}
|
|
9803
|
-
return m2.header && (
|
|
9799
|
+
return m2.header && (i3 > l2.length ? k("FieldMismatch", "TooManyFields", "Too many fields: expected " + l2.length + " fields but parsed " + i3, f2 + t3) : i3 < l2.length && k("FieldMismatch", "TooFewFields", "Too few fields: expected " + l2.length + " fields but parsed " + i3, f2 + t3)), r2;
|
|
9804
9800
|
}
|
|
9805
9801
|
__name(e2, "e");
|
|
9806
9802
|
var t2 = 1;
|
|
@@ -9815,219 +9811,204 @@ License: MIT
|
|
|
9815
9811
|
}
|
|
9816
9812
|
__name(_2, "_");
|
|
9817
9813
|
function v2(e2, t2) {
|
|
9818
|
-
return
|
|
9814
|
+
return i3 = e2, m2.dynamicTypingFunction && void 0 === m2.dynamicTyping[i3] && (m2.dynamicTyping[i3] = m2.dynamicTypingFunction(i3)), true === (m2.dynamicTyping[i3] || m2.dynamicTyping) ? "true" === t2 || "TRUE" === t2 || "false" !== t2 && "FALSE" !== t2 && (function(e3) {
|
|
9819
9815
|
if (s2.test(e3)) {
|
|
9820
9816
|
var t3 = parseFloat(e3);
|
|
9821
|
-
if (n2 < t3 && t3 <
|
|
9817
|
+
if (n2 < t3 && t3 < r)
|
|
9822
9818
|
return true;
|
|
9823
9819
|
}
|
|
9824
9820
|
return false;
|
|
9825
|
-
}(t2) ? parseFloat(t2) :
|
|
9826
|
-
var
|
|
9821
|
+
}(t2) ? parseFloat(t2) : u2.test(t2) ? new Date(t2) : "" === t2 ? null : t2) : t2;
|
|
9822
|
+
var i3;
|
|
9827
9823
|
}
|
|
9828
9824
|
__name(v2, "v");
|
|
9829
|
-
function k(e2, t2,
|
|
9830
|
-
var n3 = { type: e2, code: t2, message:
|
|
9831
|
-
void 0 !==
|
|
9825
|
+
function k(e2, t2, i3, r2) {
|
|
9826
|
+
var n3 = { type: e2, code: t2, message: i3 };
|
|
9827
|
+
void 0 !== r2 && (n3.row = r2), c2.errors.push(n3);
|
|
9832
9828
|
}
|
|
9833
9829
|
__name(k, "k");
|
|
9834
|
-
this.parse = function(e2, t2,
|
|
9835
|
-
var
|
|
9830
|
+
this.parse = function(e2, t2, i3) {
|
|
9831
|
+
var r2 = m2.quoteChar || '"';
|
|
9836
9832
|
if (m2.newline || (m2.newline = function(e3, t3) {
|
|
9837
9833
|
e3 = e3.substring(0, 1048576);
|
|
9838
|
-
var
|
|
9839
|
-
if (1 ===
|
|
9834
|
+
var i4 = new RegExp(j(t3) + "([^]*?)" + j(t3), "gm"), r3 = (e3 = e3.replace(i4, "")).split("\r"), n4 = e3.split("\n"), s4 = 1 < n4.length && n4[0].length < r3[0].length;
|
|
9835
|
+
if (1 === r3.length || s4)
|
|
9840
9836
|
return "\n";
|
|
9841
|
-
for (var a3 = 0, o3 = 0; o3 <
|
|
9842
|
-
"\n" ===
|
|
9843
|
-
return a3 >=
|
|
9844
|
-
}(e2,
|
|
9845
|
-
|
|
9837
|
+
for (var a3 = 0, o3 = 0; o3 < r3.length; o3++)
|
|
9838
|
+
"\n" === r3[o3][0] && a3++;
|
|
9839
|
+
return a3 >= r3.length / 2 ? "\r\n" : "\r";
|
|
9840
|
+
}(e2, r2)), h2 = false, m2.delimiter)
|
|
9841
|
+
M(m2.delimiter) && (m2.delimiter = m2.delimiter(e2), c2.meta.delimiter = m2.delimiter);
|
|
9846
9842
|
else {
|
|
9847
|
-
var n3 = function(e3, t3,
|
|
9848
|
-
var s4, a3, o3,
|
|
9843
|
+
var n3 = function(e3, t3, i4, r3, n4) {
|
|
9844
|
+
var s4, a3, o3, h3;
|
|
9849
9845
|
n4 = n4 || [",", " ", "|", ";", b.RECORD_SEP, b.UNIT_SEP];
|
|
9850
|
-
for (var
|
|
9851
|
-
var f3 = n4[
|
|
9846
|
+
for (var u3 = 0; u3 < n4.length; u3++) {
|
|
9847
|
+
var f3 = n4[u3], d3 = 0, l3 = 0, c3 = 0;
|
|
9852
9848
|
o3 = void 0;
|
|
9853
|
-
for (var p3 = new E({ comments:
|
|
9854
|
-
if (
|
|
9849
|
+
for (var p3 = new E({ comments: r3, delimiter: f3, newline: t3, preview: 10 }).parse(e3), g3 = 0; g3 < p3.data.length; g3++)
|
|
9850
|
+
if (i4 && y2(p3.data[g3]))
|
|
9855
9851
|
c3++;
|
|
9856
9852
|
else {
|
|
9857
9853
|
var _3 = p3.data[g3].length;
|
|
9858
9854
|
l3 += _3, void 0 !== o3 ? 0 < _3 && (d3 += Math.abs(_3 - o3), o3 = _3) : o3 = _3;
|
|
9859
9855
|
}
|
|
9860
|
-
0 < p3.data.length && (l3 /= p3.data.length - c3), (void 0 === a3 || d3 <= a3) && (void 0 ===
|
|
9856
|
+
0 < p3.data.length && (l3 /= p3.data.length - c3), (void 0 === a3 || d3 <= a3) && (void 0 === h3 || h3 < l3) && 1.99 < l3 && (a3 = d3, s4 = f3, h3 = l3);
|
|
9861
9857
|
}
|
|
9862
9858
|
return { successful: !!(m2.delimiter = s4), bestDelimiter: s4 };
|
|
9863
9859
|
}(e2, m2.newline, m2.skipEmptyLines, m2.comments, m2.delimitersToGuess);
|
|
9864
|
-
n3.successful ? m2.delimiter = n3.bestDelimiter : (
|
|
9860
|
+
n3.successful ? m2.delimiter = n3.bestDelimiter : (h2 = true, m2.delimiter = b.DefaultDelimiter), c2.meta.delimiter = m2.delimiter;
|
|
9865
9861
|
}
|
|
9866
9862
|
var s3 = w(m2);
|
|
9867
|
-
return m2.preview && m2.header && s3.preview++, a2 = e2, o2 = new E(s3), c2 = o2.parse(a2, t2,
|
|
9863
|
+
return m2.preview && m2.header && s3.preview++, a2 = e2, o2 = new E(s3), c2 = o2.parse(a2, t2, i3), g2(), d2 ? { meta: { paused: true } } : c2 || { meta: { paused: false } };
|
|
9868
9864
|
}, this.paused = function() {
|
|
9869
9865
|
return d2;
|
|
9870
9866
|
}, this.pause = function() {
|
|
9871
|
-
d2 = true, o2.abort(), a2 =
|
|
9867
|
+
d2 = true, o2.abort(), a2 = M(m2.chunk) ? "" : a2.substring(o2.getCharIndex());
|
|
9872
9868
|
}, this.resume = function() {
|
|
9873
9869
|
t.streamer._halted ? (d2 = false, t.streamer.parseChunk(a2, true)) : setTimeout(t.resume, 3);
|
|
9874
9870
|
}, this.aborted = function() {
|
|
9875
9871
|
return e;
|
|
9876
9872
|
}, this.abort = function() {
|
|
9877
|
-
e = true, o2.abort(), c2.meta.aborted = true,
|
|
9873
|
+
e = true, o2.abort(), c2.meta.aborted = true, M(m2.complete) && m2.complete(c2), a2 = "";
|
|
9878
9874
|
};
|
|
9879
9875
|
}
|
|
9880
|
-
__name(
|
|
9881
|
-
function
|
|
9876
|
+
__name(i, "i");
|
|
9877
|
+
function j(e) {
|
|
9882
9878
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
9883
9879
|
}
|
|
9884
|
-
__name(
|
|
9885
|
-
function E(
|
|
9886
|
-
var
|
|
9887
|
-
if (void 0 !==
|
|
9880
|
+
__name(j, "j");
|
|
9881
|
+
function E(e) {
|
|
9882
|
+
var S, O = (e = e || {}).delimiter, x = e.newline, I = e.comments, T = e.step, D = e.preview, A = e.fastMode, L = S = void 0 === e.quoteChar || null === e.quoteChar ? '"' : e.quoteChar;
|
|
9883
|
+
if (void 0 !== e.escapeChar && (L = e.escapeChar), ("string" != typeof O || -1 < b.BAD_DELIMITERS.indexOf(O)) && (O = ","), I === O)
|
|
9888
9884
|
throw new Error("Comment character same as delimiter");
|
|
9889
|
-
true ===
|
|
9890
|
-
var
|
|
9891
|
-
this.parse = function(
|
|
9892
|
-
if ("string" != typeof
|
|
9885
|
+
true === I ? I = "#" : ("string" != typeof I || -1 < b.BAD_DELIMITERS.indexOf(I)) && (I = false), "\n" !== x && "\r" !== x && "\r\n" !== x && (x = "\n");
|
|
9886
|
+
var F = 0, z = false;
|
|
9887
|
+
this.parse = function(r, t, i2) {
|
|
9888
|
+
if ("string" != typeof r)
|
|
9893
9889
|
throw new Error("Input must be a string");
|
|
9894
|
-
var n2 =
|
|
9895
|
-
if (!
|
|
9896
|
-
return
|
|
9897
|
-
if (
|
|
9898
|
-
var l2 =
|
|
9899
|
-
|
|
9900
|
-
|
|
9901
|
-
|
|
9902
|
-
|
|
9903
|
-
|
|
9904
|
-
y2 = y2 + "_" + v2;
|
|
9905
|
-
c2.push(y2);
|
|
9906
|
-
}
|
|
9907
|
-
if (g2) {
|
|
9908
|
-
var k = i.split(P);
|
|
9909
|
-
k[0] = c2.join(M), i = k.join(P);
|
|
9910
|
-
}
|
|
9911
|
-
}
|
|
9912
|
-
if (B || false !== B && -1 === i.indexOf(z)) {
|
|
9913
|
-
for (var b2 = i.split(P), E2 = 0; E2 < b2.length; E2++) {
|
|
9914
|
-
if (f2 = b2[E2], W += f2.length, E2 !== b2.length - 1)
|
|
9915
|
-
W += P.length;
|
|
9916
|
-
else if (r2)
|
|
9917
|
-
return L();
|
|
9918
|
-
if (!U || f2.substring(0, a2) !== U) {
|
|
9890
|
+
var n2 = r.length, e2 = O.length, s2 = x.length, a2 = I.length, o2 = M(T), h2 = [], u2 = [], f2 = [], d2 = F = 0;
|
|
9891
|
+
if (!r)
|
|
9892
|
+
return C();
|
|
9893
|
+
if (A || false !== A && -1 === r.indexOf(S)) {
|
|
9894
|
+
for (var l2 = r.split(x), c2 = 0; c2 < l2.length; c2++) {
|
|
9895
|
+
if (f2 = l2[c2], F += f2.length, c2 !== l2.length - 1)
|
|
9896
|
+
F += x.length;
|
|
9897
|
+
else if (i2)
|
|
9898
|
+
return C();
|
|
9899
|
+
if (!I || f2.substring(0, a2) !== I) {
|
|
9919
9900
|
if (o2) {
|
|
9920
|
-
if (
|
|
9921
|
-
return
|
|
9901
|
+
if (h2 = [], k(f2.split(O)), R(), z)
|
|
9902
|
+
return C();
|
|
9922
9903
|
} else
|
|
9923
|
-
|
|
9924
|
-
if (
|
|
9925
|
-
return
|
|
9904
|
+
k(f2.split(O));
|
|
9905
|
+
if (D && D <= c2)
|
|
9906
|
+
return h2 = h2.slice(0, D), C(true);
|
|
9926
9907
|
}
|
|
9927
9908
|
}
|
|
9928
|
-
return
|
|
9909
|
+
return C();
|
|
9929
9910
|
}
|
|
9930
|
-
for (var
|
|
9931
|
-
if (
|
|
9932
|
-
if (
|
|
9933
|
-
if (-1 ===
|
|
9934
|
-
return
|
|
9935
|
-
|
|
9936
|
-
} else if (-1 !==
|
|
9937
|
-
f2.push(
|
|
9911
|
+
for (var p2 = r.indexOf(O, F), g2 = r.indexOf(x, F), _2 = new RegExp(j(L) + j(S), "g"), m2 = r.indexOf(S, F); ; )
|
|
9912
|
+
if (r[F] !== S)
|
|
9913
|
+
if (I && 0 === f2.length && r.substring(F, F + a2) === I) {
|
|
9914
|
+
if (-1 === g2)
|
|
9915
|
+
return C();
|
|
9916
|
+
F = g2 + s2, g2 = r.indexOf(x, F), p2 = r.indexOf(O, F);
|
|
9917
|
+
} else if (-1 !== p2 && (p2 < g2 || -1 === g2))
|
|
9918
|
+
f2.push(r.substring(F, p2)), F = p2 + e2, p2 = r.indexOf(O, F);
|
|
9938
9919
|
else {
|
|
9939
|
-
if (-1 ===
|
|
9920
|
+
if (-1 === g2)
|
|
9940
9921
|
break;
|
|
9941
|
-
if (f2.push(
|
|
9942
|
-
return
|
|
9943
|
-
if (
|
|
9944
|
-
return
|
|
9922
|
+
if (f2.push(r.substring(F, g2)), w2(g2 + s2), o2 && (R(), z))
|
|
9923
|
+
return C();
|
|
9924
|
+
if (D && h2.length >= D)
|
|
9925
|
+
return C(true);
|
|
9945
9926
|
}
|
|
9946
9927
|
else
|
|
9947
|
-
for (
|
|
9948
|
-
if (-1 === (
|
|
9949
|
-
return
|
|
9950
|
-
if (
|
|
9951
|
-
return
|
|
9952
|
-
if (
|
|
9953
|
-
if (
|
|
9954
|
-
-1 !==
|
|
9955
|
-
var
|
|
9956
|
-
if (
|
|
9957
|
-
f2.push(
|
|
9928
|
+
for (m2 = F, F++; ; ) {
|
|
9929
|
+
if (-1 === (m2 = r.indexOf(S, m2 + 1)))
|
|
9930
|
+
return i2 || u2.push({ type: "Quotes", code: "MissingQuotes", message: "Quoted field unterminated", row: h2.length, index: F }), E2();
|
|
9931
|
+
if (m2 === n2 - 1)
|
|
9932
|
+
return E2(r.substring(F, m2).replace(_2, S));
|
|
9933
|
+
if (S !== L || r[m2 + 1] !== L) {
|
|
9934
|
+
if (S === L || 0 === m2 || r[m2 - 1] !== L) {
|
|
9935
|
+
-1 !== p2 && p2 < m2 + 1 && (p2 = r.indexOf(O, m2 + 1)), -1 !== g2 && g2 < m2 + 1 && (g2 = r.indexOf(x, m2 + 1));
|
|
9936
|
+
var y2 = b2(-1 === g2 ? p2 : Math.min(p2, g2));
|
|
9937
|
+
if (r.substr(m2 + 1 + y2, e2) === O) {
|
|
9938
|
+
f2.push(r.substring(F, m2).replace(_2, S)), r[F = m2 + 1 + y2 + e2] !== S && (m2 = r.indexOf(S, F)), p2 = r.indexOf(O, F), g2 = r.indexOf(x, F);
|
|
9958
9939
|
break;
|
|
9959
9940
|
}
|
|
9960
|
-
var
|
|
9961
|
-
if (
|
|
9962
|
-
if (f2.push(
|
|
9963
|
-
return
|
|
9964
|
-
if (
|
|
9965
|
-
return
|
|
9941
|
+
var v2 = b2(g2);
|
|
9942
|
+
if (r.substring(m2 + 1 + v2, m2 + 1 + v2 + s2) === x) {
|
|
9943
|
+
if (f2.push(r.substring(F, m2).replace(_2, S)), w2(m2 + 1 + v2 + s2), p2 = r.indexOf(O, F), m2 = r.indexOf(S, F), o2 && (R(), z))
|
|
9944
|
+
return C();
|
|
9945
|
+
if (D && h2.length >= D)
|
|
9946
|
+
return C(true);
|
|
9966
9947
|
break;
|
|
9967
9948
|
}
|
|
9968
|
-
|
|
9949
|
+
u2.push({ type: "Quotes", code: "InvalidQuotes", message: "Trailing quote on quoted field is malformed", row: h2.length, index: F }), m2++;
|
|
9969
9950
|
}
|
|
9970
9951
|
} else
|
|
9971
|
-
|
|
9952
|
+
m2++;
|
|
9972
9953
|
}
|
|
9973
|
-
return
|
|
9974
|
-
function
|
|
9975
|
-
|
|
9954
|
+
return E2();
|
|
9955
|
+
function k(e3) {
|
|
9956
|
+
h2.push(e3), d2 = F;
|
|
9976
9957
|
}
|
|
9977
|
-
__name(
|
|
9978
|
-
function
|
|
9958
|
+
__name(k, "k");
|
|
9959
|
+
function b2(e3) {
|
|
9979
9960
|
var t2 = 0;
|
|
9980
|
-
if (-1 !==
|
|
9981
|
-
var
|
|
9982
|
-
|
|
9961
|
+
if (-1 !== e3) {
|
|
9962
|
+
var i3 = r.substring(m2 + 1, e3);
|
|
9963
|
+
i3 && "" === i3.trim() && (t2 = i3.length);
|
|
9983
9964
|
}
|
|
9984
9965
|
return t2;
|
|
9985
9966
|
}
|
|
9986
|
-
__name(
|
|
9987
|
-
function
|
|
9988
|
-
return
|
|
9967
|
+
__name(b2, "b");
|
|
9968
|
+
function E2(e3) {
|
|
9969
|
+
return i2 || (void 0 === e3 && (e3 = r.substring(F)), f2.push(e3), F = n2, k(f2), o2 && R()), C();
|
|
9989
9970
|
}
|
|
9990
|
-
__name(
|
|
9991
|
-
function
|
|
9992
|
-
|
|
9971
|
+
__name(E2, "E");
|
|
9972
|
+
function w2(e3) {
|
|
9973
|
+
F = e3, k(f2), f2 = [], g2 = r.indexOf(x, F);
|
|
9993
9974
|
}
|
|
9994
|
-
__name(
|
|
9995
|
-
function
|
|
9996
|
-
return { data:
|
|
9975
|
+
__name(w2, "w");
|
|
9976
|
+
function C(e3) {
|
|
9977
|
+
return { data: h2, errors: u2, meta: { delimiter: O, linebreak: x, aborted: z, truncated: !!e3, cursor: d2 + (t || 0) } };
|
|
9997
9978
|
}
|
|
9998
|
-
__name(
|
|
9999
|
-
function
|
|
10000
|
-
|
|
9979
|
+
__name(C, "C");
|
|
9980
|
+
function R() {
|
|
9981
|
+
T(C()), h2 = [], u2 = [];
|
|
10001
9982
|
}
|
|
10002
|
-
__name(
|
|
9983
|
+
__name(R, "R");
|
|
10003
9984
|
}, this.abort = function() {
|
|
10004
|
-
|
|
9985
|
+
z = true;
|
|
10005
9986
|
}, this.getCharIndex = function() {
|
|
10006
|
-
return
|
|
9987
|
+
return F;
|
|
10007
9988
|
};
|
|
10008
9989
|
}
|
|
10009
9990
|
__name(E, "E");
|
|
10010
9991
|
function _(e) {
|
|
10011
|
-
var t = e.data,
|
|
9992
|
+
var t = e.data, i2 = a[t.workerId], r = false;
|
|
10012
9993
|
if (t.error)
|
|
10013
|
-
|
|
9994
|
+
i2.userError(t.error, t.file);
|
|
10014
9995
|
else if (t.results && t.results.data) {
|
|
10015
9996
|
var n2 = { abort: function() {
|
|
10016
|
-
|
|
9997
|
+
r = true, m(t.workerId, { data: [], errors: [], meta: { aborted: true } });
|
|
10017
9998
|
}, pause: y, resume: y };
|
|
10018
|
-
if (
|
|
10019
|
-
for (var s2 = 0; s2 < t.results.data.length && (
|
|
9999
|
+
if (M(i2.userStep)) {
|
|
10000
|
+
for (var s2 = 0; s2 < t.results.data.length && (i2.userStep({ data: t.results.data[s2], errors: t.results.errors, meta: t.results.meta }, n2), !r); s2++)
|
|
10020
10001
|
;
|
|
10021
10002
|
delete t.results;
|
|
10022
10003
|
} else
|
|
10023
|
-
|
|
10004
|
+
M(i2.userChunk) && (i2.userChunk(t.results, n2, t.file), delete t.results);
|
|
10024
10005
|
}
|
|
10025
|
-
t.finished && !
|
|
10006
|
+
t.finished && !r && m(t.workerId, t.results);
|
|
10026
10007
|
}
|
|
10027
10008
|
__name(_, "_");
|
|
10028
10009
|
function m(e, t) {
|
|
10029
|
-
var
|
|
10030
|
-
|
|
10010
|
+
var i2 = a[e];
|
|
10011
|
+
M(i2.userComplete) && i2.userComplete(t), i2.terminate(), delete a[e];
|
|
10031
10012
|
}
|
|
10032
10013
|
__name(m, "m");
|
|
10033
10014
|
function y() {
|
|
@@ -10038,8 +10019,8 @@ License: MIT
|
|
|
10038
10019
|
if ("object" != typeof e || null === e)
|
|
10039
10020
|
return e;
|
|
10040
10021
|
var t = Array.isArray(e) ? [] : {};
|
|
10041
|
-
for (var
|
|
10042
|
-
t[
|
|
10022
|
+
for (var i2 in e)
|
|
10023
|
+
t[i2] = w(e[i2]);
|
|
10043
10024
|
return t;
|
|
10044
10025
|
}
|
|
10045
10026
|
__name(w, "w");
|
|
@@ -10049,20 +10030,20 @@ License: MIT
|
|
|
10049
10030
|
};
|
|
10050
10031
|
}
|
|
10051
10032
|
__name(v, "v");
|
|
10052
|
-
function
|
|
10033
|
+
function M(e) {
|
|
10053
10034
|
return "function" == typeof e;
|
|
10054
10035
|
}
|
|
10055
|
-
__name(
|
|
10036
|
+
__name(M, "M");
|
|
10056
10037
|
return o && (f.onmessage = function(e) {
|
|
10057
10038
|
var t = e.data;
|
|
10058
10039
|
void 0 === b.WORKER_ID && t && (b.WORKER_ID = t.workerId);
|
|
10059
10040
|
if ("string" == typeof t.input)
|
|
10060
10041
|
f.postMessage({ workerId: b.WORKER_ID, results: b.parse(t.input, t.config), finished: true });
|
|
10061
10042
|
else if (f.File && t.input instanceof File || t.input instanceof Object) {
|
|
10062
|
-
var
|
|
10063
|
-
|
|
10043
|
+
var i2 = b.parse(t.input, t.config);
|
|
10044
|
+
i2 && f.postMessage({ workerId: b.WORKER_ID, results: i2, finished: true });
|
|
10064
10045
|
}
|
|
10065
|
-
}), (l.prototype = Object.create(
|
|
10046
|
+
}), (l.prototype = Object.create(u.prototype)).constructor = l, (c.prototype = Object.create(u.prototype)).constructor = c, (p.prototype = Object.create(p.prototype)).constructor = p, (g.prototype = Object.create(u.prototype)).constructor = g, b;
|
|
10066
10047
|
}, "s"));
|
|
10067
10048
|
})(papaparse_min);
|
|
10068
10049
|
var papaparse_minExports = papaparse_min.exports;
|
|
@@ -10157,16 +10138,6 @@ const setupCsvParserOptions = /* @__PURE__ */ __name((parserOptions = {}) => {
|
|
|
10157
10138
|
return transHeader;
|
|
10158
10139
|
};
|
|
10159
10140
|
}
|
|
10160
|
-
const transformToAlwaysRun = /* @__PURE__ */ __name((header) => header.trim(), "transformToAlwaysRun");
|
|
10161
|
-
if (parserOptions.transformHeader) {
|
|
10162
|
-
const existingTransformHeader = parserOptions.transformHeader;
|
|
10163
|
-
papaParseOpts.transformHeader = (header) => {
|
|
10164
|
-
const trimmedHeader = transformToAlwaysRun(header);
|
|
10165
|
-
return existingTransformHeader(trimmedHeader);
|
|
10166
|
-
};
|
|
10167
|
-
} else {
|
|
10168
|
-
papaParseOpts.transformHeader = transformToAlwaysRun;
|
|
10169
|
-
}
|
|
10170
10141
|
return papaParseOpts;
|
|
10171
10142
|
}, "setupCsvParserOptions");
|
|
10172
10143
|
const normalizeCsvHeaderHelper = /* @__PURE__ */ __name((h) => snakeCase(camelCase(h)).toUpperCase(), "normalizeCsvHeaderHelper");
|