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