@dpuse/dpuse-tool-adaltas-csv-parser 1.0.113 → 1.0.115
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/README.md
CHANGED
|
@@ -61,7 +61,7 @@ License data is updated each time `npm run document` is run, using [license-chec
|
|
|
61
61
|
|
|
62
62
|
| Dependency | Version | License(s) | Document |
|
|
63
63
|
| :----------------------------------------------------------- | :-----: | :--------- | :-------------------------------------------------------------------- |
|
|
64
|
-
| [@dpuse/dpuse-shared](https://github.com/dpuse/dpuse-shared) | 1.0.
|
|
64
|
+
| [@dpuse/dpuse-shared](https://github.com/dpuse/dpuse-shared) | 1.0.143 | MIT | [LICENSE](licenses/downloads/@dpuse/dpuse-shared@1.0.143-LICENSE.txt) |
|
|
65
65
|
| [csv-parse](https://github.com/adaltas/node-csv) | 7.0.3 | MIT | [LICENSE](licenses/downloads/csv-parse@7.0.3-LICENSE.txt) |
|
|
66
66
|
| [valibot](https://github.com/open-circle/valibot) | 1.5.0 | MIT | [LICENSE](licenses/downloads/valibot@1.5.0-LICENSE.txt) |
|
|
67
67
|
|
|
@@ -69,9 +69,9 @@ License data is updated each time `npm run document` is run, using [license-chec
|
|
|
69
69
|
|
|
70
70
|
The dependency tree below shows how each package in the table above is reached — direct and transitive — along with its installed version, release date, and update status. A package that does not ship itself, such as one whose parts are bundled separately, is left out and what ships beneath it is shown in its place. Packages flagged ❗ have a newer version available; ⚠️ indicates a package that hasn't been updated in the last 6 months or longer. Neither flag necessarily indicates a problem: we let new releases stabilise before upgrading, and some packages are mature and stable (have limited or no dependencies), so they require no active development.
|
|
71
71
|
|
|
72
|
-
- **[@dpuse/dpuse-shared](https://github.com/dpuse/dpuse-shared)** 1.0.
|
|
72
|
+
- **[@dpuse/dpuse-shared](https://github.com/dpuse/dpuse-shared)** 1.0.143 — this month: 2026-10-26
|
|
73
73
|
- **[valibot](https://github.com/open-circle/valibot)** 1.5.0 — 1 mth ago: 2026-09-09
|
|
74
|
-
- **[csv-parse](https://github.com/adaltas/node-csv)** 7.0.3 —
|
|
74
|
+
- **[csv-parse](https://github.com/adaltas/node-csv)** 7.0.3 — 1 mth ago: 2026-09-25
|
|
75
75
|
|
|
76
76
|
<!-- DEPENDENCY_LICENSES_END -->
|
|
77
77
|
|
|
@@ -85,11 +85,11 @@ _Note: Sonda's Vite reports currently exclude CSS files, since Vite does not gen
|
|
|
85
85
|
|
|
86
86
|
| Chunk/Module/File | Composition |
|
|
87
87
|
| :-------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------- |
|
|
88
|
-
| **dist/dpuse-tool-adaltas-csv-parser.es.js** |
|
|
89
|
-
| csv-parse → dist/esm/index.js | `████████████████░░░░` 78.
|
|
90
|
-
| @dpuse/dpuse-shared → dist/dpuse-shared.es.js | `██░░░░░░░░░░░░░░░░░░` 12.0% · 15.
|
|
91
|
-
| src → index.ts | `█░░░░░░░░░░░░░░░░░░░` 3.
|
|
92
|
-
| (bundler output, whitespace & JSON) | `█░░░░░░░░░░░░░░░░░░░` 5.
|
|
88
|
+
| **dist/dpuse-tool-adaltas-csv-parser.es.js** | 126.4 kB · gzip 31.8 kB · 100.0% of the build |
|
|
89
|
+
| csv-parse → dist/esm/index.js | `████████████████░░░░` 78.5% · 99.2 kB |
|
|
90
|
+
| @dpuse/dpuse-shared → dist/dpuse-shared.es.js | `██░░░░░░░░░░░░░░░░░░` 12.0% · 15.2 kB |
|
|
91
|
+
| src → index.ts | `█░░░░░░░░░░░░░░░░░░░` 3.7% · 4.7 kB |
|
|
92
|
+
| (bundler output, whitespace & JSON) | `█░░░░░░░░░░░░░░░░░░░` 5.8% · 7.3 kB |
|
|
93
93
|
|
|
94
94
|
Bars show each row's share of its output file.
|
|
95
95
|
|
|
@@ -2900,7 +2900,7 @@ var Tr = {
|
|
|
2900
2900
|
status: /* @__PURE__ */ Z(Cr),
|
|
2901
2901
|
statusId: /* @__PURE__ */ Z(Sr)
|
|
2902
2902
|
};
|
|
2903
|
-
({ ...Tr }), J({ en: "
|
|
2903
|
+
({ ...Tr }), J({ en: "Arrow" }), J({ en: "Avro" }), J({ en: "Delimited text (CSV, TAB, TSV…)" }), J({ en: "JSON" }), J({ en: "JSON Lines (JSONL)" }), J({ en: "Markdown (MD)" }), J({ en: "OpenDocument spreadsheet (ODS)" }), J({ en: "Parquet" }), J({ en: "SPSS (SAV)" }), J({ en: "SQLite" }), J({ en: "Excel (XLSX, XLSM)" }), J({ en: "XML" }), J({ en: "Newline" }), J({ en: "Carriage Return" }), J({ en: "Carriage Return/Newline" }), J({ en: "Colon" }), J({ en: "Comma" }), J({ en: "Exclamation Mark" }), J({ en: "Record Separator" }), J({ en: "Semicolon" }), J({ en: "Space" }), J({ en: "Tab" }), J({ en: "Underscore" }), J({ en: "Unit Separator" }), J({ en: "Vertical Bar" }), $([
|
|
2904
2904
|
"app",
|
|
2905
2905
|
"engine",
|
|
2906
2906
|
"connector",
|
|
@@ -3523,11 +3523,12 @@ var Lr = {
|
|
|
3523
3523
|
});
|
|
3524
3524
|
}
|
|
3525
3525
|
async parseText(e, t, n = !1) {
|
|
3526
|
-
let r = Ur(e), {
|
|
3526
|
+
let r = Ur(e), { issues: i, parsedRecords: a, valueDelimiterId: o } = await Wr(e, t, n);
|
|
3527
3527
|
return {
|
|
3528
|
-
|
|
3528
|
+
issues: i,
|
|
3529
|
+
parsedRecords: a,
|
|
3529
3530
|
recordDelimiterId: r,
|
|
3530
|
-
valueDelimiterId:
|
|
3531
|
+
valueDelimiterId: o
|
|
3531
3532
|
};
|
|
3532
3533
|
}
|
|
3533
3534
|
};
|
|
@@ -3567,45 +3568,74 @@ function Ur(e) {
|
|
|
3567
3568
|
async function Wr(e, t, n) {
|
|
3568
3569
|
let r, i, a, o = [], s, c = !1;
|
|
3569
3570
|
for (let l of t) {
|
|
3570
|
-
let {
|
|
3571
|
-
if (t
|
|
3572
|
-
s
|
|
3571
|
+
let { issues: t, records: u } = await Kr(e, l, n);
|
|
3572
|
+
if (t.length > 0) {
|
|
3573
|
+
s = Gr(s, {
|
|
3574
|
+
delimiter: l,
|
|
3575
|
+
issues: t,
|
|
3576
|
+
records: u
|
|
3577
|
+
});
|
|
3573
3578
|
continue;
|
|
3574
3579
|
}
|
|
3575
3580
|
if (c = !0, u.length === 0) continue;
|
|
3576
|
-
let { averageValueCount: d, sumOfValueCountDiffs: f } =
|
|
3581
|
+
let { averageValueCount: d, sumOfValueCountDiffs: f } = qr(u);
|
|
3577
3582
|
(!a || f <= a) && (!i || d > i) && (r = l, i = d, a = f, o = u);
|
|
3578
3583
|
}
|
|
3579
|
-
if (!c && s != null)
|
|
3584
|
+
if (!c && s != null) {
|
|
3585
|
+
let { delimiter: e, issues: t, records: n } = s;
|
|
3586
|
+
return {
|
|
3587
|
+
issues: t,
|
|
3588
|
+
parsedRecords: n,
|
|
3589
|
+
valueDelimiterId: Jr(n) ? e : void 0
|
|
3590
|
+
};
|
|
3591
|
+
}
|
|
3580
3592
|
return {
|
|
3593
|
+
issues: [],
|
|
3581
3594
|
parsedRecords: o,
|
|
3582
|
-
valueDelimiterId: r != null &&
|
|
3595
|
+
valueDelimiterId: r != null && Jr(o) ? r : void 0
|
|
3583
3596
|
};
|
|
3584
3597
|
}
|
|
3585
|
-
function Gr(e, t
|
|
3598
|
+
function Gr(e, t) {
|
|
3599
|
+
return e == null || t.issues.length < e.issues.length ? t : e;
|
|
3600
|
+
}
|
|
3601
|
+
function Kr(e, t, n) {
|
|
3586
3602
|
return new Promise((r) => {
|
|
3587
|
-
let i = [], a =
|
|
3603
|
+
let i = [], a = [], o = (e) => {
|
|
3604
|
+
e == null || !n && e.code === "CSV_QUOTE_NOT_CLOSED" || i.push({
|
|
3605
|
+
id: e.code ?? "CSV_UNKNOWN_ERROR",
|
|
3606
|
+
lineNumber: e.lines,
|
|
3607
|
+
message: e.message,
|
|
3608
|
+
severityId: "error"
|
|
3609
|
+
});
|
|
3610
|
+
}, s = ar({
|
|
3588
3611
|
...Lr,
|
|
3589
3612
|
cast: (e, t) => ({
|
|
3590
3613
|
value: e,
|
|
3591
3614
|
wasValueQuoted: t.quoting
|
|
3592
3615
|
}),
|
|
3593
3616
|
delimiter: t,
|
|
3594
|
-
|
|
3617
|
+
on_skip: (e) => {
|
|
3618
|
+
o(e);
|
|
3619
|
+
},
|
|
3620
|
+
relax_column_count: !0,
|
|
3621
|
+
skip_records_with_error: !0
|
|
3595
3622
|
});
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
}),
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
records:
|
|
3623
|
+
s.on("data", (e) => {
|
|
3624
|
+
a.push(e);
|
|
3625
|
+
}), s.on("error", (e) => {
|
|
3626
|
+
o(e), r({
|
|
3627
|
+
issues: i,
|
|
3628
|
+
records: a
|
|
3629
|
+
});
|
|
3630
|
+
}), s.on("end", () => {
|
|
3631
|
+
r({
|
|
3632
|
+
issues: i,
|
|
3633
|
+
records: a
|
|
3602
3634
|
});
|
|
3603
|
-
}),
|
|
3604
|
-
r({ records: i });
|
|
3605
|
-
}), a.write(e), a.end();
|
|
3635
|
+
}), s.write(e), s.end();
|
|
3606
3636
|
});
|
|
3607
3637
|
}
|
|
3608
|
-
function
|
|
3638
|
+
function qr(e) {
|
|
3609
3639
|
let t = 0, n = 0, r;
|
|
3610
3640
|
for (let i of e) r != null && (n += Math.abs(i.length - r)), r = i.length, t += i.length;
|
|
3611
3641
|
return {
|
|
@@ -3613,7 +3643,7 @@ function Kr(e) {
|
|
|
3613
3643
|
sumOfValueCountDiffs: n
|
|
3614
3644
|
};
|
|
3615
3645
|
}
|
|
3616
|
-
function
|
|
3646
|
+
function Jr(e) {
|
|
3617
3647
|
let t = /* @__PURE__ */ new Map();
|
|
3618
3648
|
for (let n of e) t.set(n.length, (t.get(n.length) ?? 0) + 1);
|
|
3619
3649
|
let [n = 0, r = 0] = [...t].toSorted((e, t) => t[1] - e[1])[0] ?? [];
|