@dpuse/dpuse-tool-adaltas-csv-parser 1.0.128 → 1.0.130
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.211 | MIT | [LICENSE](licenses/downloads/@dpuse/dpuse-shared@1.0.211-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,8 +69,8 @@ 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.
|
|
73
|
-
- **[valibot](https://github.com/open-circle/valibot)** 1.5.0 —
|
|
72
|
+
- **[@dpuse/dpuse-shared](https://github.com/dpuse/dpuse-shared)** 1.0.211 — this month: 2026-11-11
|
|
73
|
+
- **[valibot](https://github.com/open-circle/valibot)** 1.5.0 — 2 mths ago: 2026-09-09
|
|
74
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 -->
|
|
@@ -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** | 134.
|
|
89
|
-
| csv-parse → dist/esm/index.js | `███████████████░░░░░`
|
|
90
|
-
| @dpuse/dpuse-shared → dist/dpuse-shared.es.js | `███░░░░░░░░░░░░░░░░░` 17.
|
|
91
|
-
| src → index.ts | `█░░░░░░░░░░░░░░░░░░░`
|
|
92
|
-
| (bundler output, whitespace & JSON) | `█░░░░░░░░░░░░░░░░░░░` 5.
|
|
88
|
+
| **dist/dpuse-tool-adaltas-csv-parser.es.js** | 134.0 kB · gzip 32.2 kB · 100.0% of the build |
|
|
89
|
+
| csv-parse → dist/esm/index.js | `███████████████░░░░░` 74.0% · 99.2 kB |
|
|
90
|
+
| @dpuse/dpuse-shared → dist/dpuse-shared.es.js | `███░░░░░░░░░░░░░░░░░` 17.3% · 23.2 kB |
|
|
91
|
+
| src → index.ts | `█░░░░░░░░░░░░░░░░░░░` 2.8% · 3.8 kB |
|
|
92
|
+
| (bundler output, whitespace & JSON) | `█░░░░░░░░░░░░░░░░░░░` 5.8% · 7.8 kB |
|
|
93
93
|
|
|
94
94
|
Bars show each row's share of its output file.
|
|
95
95
|
|
|
@@ -2973,7 +2973,6 @@ var Dr = {
|
|
|
2973
2973
|
"previewObject",
|
|
2974
2974
|
"queryRecords",
|
|
2975
2975
|
"removeRecords",
|
|
2976
|
-
"retrieveChunks",
|
|
2977
2976
|
"retrieveRecords",
|
|
2978
2977
|
"upsertRecords"
|
|
2979
2978
|
]), $([
|
|
@@ -3909,121 +3908,78 @@ var Rr = {
|
|
|
3909
3908
|
skip_records_with_error: !1,
|
|
3910
3909
|
to_line: -1,
|
|
3911
3910
|
trim: !1
|
|
3912
|
-
}, zr =
|
|
3913
|
-
async parseStream(e, t
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
},
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
let i = Kr({
|
|
3936
|
-
chunk: n,
|
|
3937
|
-
chunkSize: t.chunkSize ?? Hr
|
|
3938
|
-
});
|
|
3939
|
-
s = i, a.on("readable", () => {
|
|
3940
|
-
try {
|
|
3941
|
-
if (a == null || s == null) return;
|
|
3942
|
-
let e;
|
|
3943
|
-
for (; (e = a.read()) != null;) {
|
|
3944
|
-
if (c) return;
|
|
3945
|
-
t.abortSignal.throwIfAborted(), s.push(e);
|
|
3946
|
-
}
|
|
3947
|
-
} catch (e) {
|
|
3948
|
-
d(e);
|
|
3949
|
-
}
|
|
3950
|
-
}), a.on("error", (e) => {
|
|
3951
|
-
d(e);
|
|
3952
|
-
});
|
|
3953
|
-
let l = async (e) => {
|
|
3954
|
-
try {
|
|
3955
|
-
await i.drain(), r(e);
|
|
3956
|
-
} catch (e) {
|
|
3957
|
-
d(e);
|
|
3958
|
-
}
|
|
3959
|
-
};
|
|
3960
|
-
a.on("end", () => {
|
|
3961
|
-
c || (i.flush(), l(qr(a)));
|
|
3962
|
-
}), o = e.getReader();
|
|
3963
|
-
let u = new TextDecoder(Ar(t.encodingId)), f = 0, p = !1, m = await o.read();
|
|
3964
|
-
for (; !m.done;) {
|
|
3965
|
-
if (c) return;
|
|
3966
|
-
t.abortSignal.throwIfAborted(), f += m.value.length, await Wr(a, u, m.value, i) > 0 && (p = !0), m = await o.read();
|
|
3911
|
+
}, zr = 1048576, Br = 50, Vr = 1e4, Hr = class {
|
|
3912
|
+
async *parseStream(e, t) {
|
|
3913
|
+
t.abortSignal.throwIfAborted();
|
|
3914
|
+
let n = Math.max(1, Math.floor(t.chunkSize ?? Vr)), r = ir({
|
|
3915
|
+
...Rr,
|
|
3916
|
+
cast: (e, t) => ({
|
|
3917
|
+
value: e,
|
|
3918
|
+
valueWasQuoted: t.quoting
|
|
3919
|
+
}),
|
|
3920
|
+
delimiter: Er(t.valueDelimiterId),
|
|
3921
|
+
relax_column_count: !0
|
|
3922
|
+
}), i = Ur(r), a = e.getReader(), o = () => {
|
|
3923
|
+
jr(() => void a.cancel(t.abortSignal.reason));
|
|
3924
|
+
};
|
|
3925
|
+
t.abortSignal.addEventListener("abort", o, { once: !0 });
|
|
3926
|
+
try {
|
|
3927
|
+
let e = new TextDecoder(Ar(t.encodingId)), o = 0, s = !1, c = await a.read();
|
|
3928
|
+
for (; !c.done;) {
|
|
3929
|
+
o += c.value.length;
|
|
3930
|
+
for (let a = 0; a < c.value.length; a += zr) {
|
|
3931
|
+
t.abortSignal.throwIfAborted();
|
|
3932
|
+
let o = e.decode(c.value.subarray(a, a + zr), { stream: !0 });
|
|
3933
|
+
o.length !== 0 && (s = !0, !r.write(o) && i.error == null && await Gr(r, "drain"), yield* Wr(i, n, t.abortSignal, !1));
|
|
3967
3934
|
}
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3935
|
+
c = await a.read();
|
|
3936
|
+
}
|
|
3937
|
+
t.abortSignal.throwIfAborted();
|
|
3938
|
+
let l = e.decode();
|
|
3939
|
+
return l.length > 0 && (r.write(l), s = !0), s ? (r.end(), i.error ?? await Gr(r, "end"), yield* Wr(i, n, t.abortSignal, !0), Kr(r)) : {
|
|
3940
|
+
byteCount: o,
|
|
3941
|
+
commentLineCount: 0,
|
|
3942
|
+
emptyLineCount: 0,
|
|
3943
|
+
lineCount: 0,
|
|
3944
|
+
nonUniformRecordCount: 0,
|
|
3945
|
+
recordCount: 0
|
|
3946
|
+
};
|
|
3947
|
+
} finally {
|
|
3948
|
+
t.abortSignal.removeEventListener("abort", o), r.removeAllListeners(), jr(() => void a.cancel());
|
|
3949
|
+
}
|
|
3982
3950
|
}
|
|
3983
3951
|
async parseText(e, t) {
|
|
3984
|
-
return await Mr(e, t,
|
|
3952
|
+
return await Mr(e, t, qr);
|
|
3985
3953
|
}
|
|
3986
3954
|
};
|
|
3987
|
-
|
|
3988
|
-
let
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3955
|
+
function Ur(e) {
|
|
3956
|
+
let t = {
|
|
3957
|
+
error: void 0,
|
|
3958
|
+
records: []
|
|
3959
|
+
};
|
|
3960
|
+
return e.on("readable", () => {
|
|
3961
|
+
let n;
|
|
3962
|
+
for (; (n = e.read()) != null;) t.records.push(n);
|
|
3963
|
+
}), e.on("error", (e) => {
|
|
3964
|
+
t.error = e;
|
|
3965
|
+
}), t;
|
|
3994
3966
|
}
|
|
3995
|
-
function
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
3967
|
+
function* Wr(e, t, n, r) {
|
|
3968
|
+
if (e.error != null) throw e.error;
|
|
3969
|
+
for (; e.records.length >= t || r && e.records.length > 0;) n.throwIfAborted(), yield {
|
|
3970
|
+
records: e.records.splice(0, t),
|
|
3971
|
+
typeId: "parsingRecordArray"
|
|
3972
|
+
};
|
|
3973
|
+
}
|
|
3974
|
+
function Gr(e, t) {
|
|
3975
|
+
return new Promise((n) => {
|
|
3976
|
+
let r = () => {
|
|
3977
|
+
e.removeListener(t, r), e.removeListener("error", r), n();
|
|
3978
|
+
};
|
|
3979
|
+
e.once(t, r), e.once("error", r);
|
|
4000
3980
|
});
|
|
4001
3981
|
}
|
|
4002
3982
|
function Kr(e) {
|
|
4003
|
-
let t = Math.max(1, Math.floor(e.chunkSize)), n = [], r = [], i = s(), a = 0, o = () => {
|
|
4004
|
-
if (a === 0) return;
|
|
4005
|
-
let t = i;
|
|
4006
|
-
t.length = a, i = s(), a = 0;
|
|
4007
|
-
let o = e.chunk("parsingRecordArray", t);
|
|
4008
|
-
o instanceof Promise ? r.push(o) : n.length < zr && n.push(t);
|
|
4009
|
-
};
|
|
4010
|
-
return {
|
|
4011
|
-
drain: async () => {
|
|
4012
|
-
for (; r.length > 0;) await Promise.all(r.splice(0));
|
|
4013
|
-
},
|
|
4014
|
-
flush: o,
|
|
4015
|
-
push: (e) => {
|
|
4016
|
-
i[a++] = e, a >= t && o();
|
|
4017
|
-
}
|
|
4018
|
-
};
|
|
4019
|
-
function s() {
|
|
4020
|
-
let e = n.pop();
|
|
4021
|
-
if (e != null) return e.length = 0, e;
|
|
4022
|
-
let r = Array.from({ length: t });
|
|
4023
|
-
return r.length = 0, r;
|
|
4024
|
-
}
|
|
4025
|
-
}
|
|
4026
|
-
function qr(e) {
|
|
4027
3983
|
return {
|
|
4028
3984
|
byteCount: e?.info.bytes ?? -1,
|
|
4029
3985
|
commentLineCount: e?.info.comment_lines ?? -1,
|
|
@@ -4033,10 +3989,10 @@ function qr(e) {
|
|
|
4033
3989
|
recordCount: e?.info.records ?? -1
|
|
4034
3990
|
};
|
|
4035
3991
|
}
|
|
4036
|
-
function
|
|
3992
|
+
function qr(e, t, n) {
|
|
4037
3993
|
return new Promise((r) => {
|
|
4038
3994
|
let i = [], a = [], o = 0, s = (e) => {
|
|
4039
|
-
e == null || !n && e.code === "CSV_QUOTE_NOT_CLOSED" || (i.push(
|
|
3995
|
+
e == null || !n && e.code === "CSV_QUOTE_NOT_CLOSED" || (i.push(Jr(e, o + 1)), e.code !== "CSV_INVALID_CLOSING_QUOTE" && e.lines != null && (o = e.lines));
|
|
4040
3996
|
}, c = ir({
|
|
4041
3997
|
...Rr,
|
|
4042
3998
|
cast: (e, t) => ({
|
|
@@ -4066,7 +4022,7 @@ function Jr(e, t, n) {
|
|
|
4066
4022
|
}), c.write(e), c.end();
|
|
4067
4023
|
});
|
|
4068
4024
|
}
|
|
4069
|
-
function
|
|
4025
|
+
function Jr(e, t) {
|
|
4070
4026
|
let n = e.lines, r = e.code === "CSV_INVALID_CLOSING_QUOTE" ? /got "(.*?)" at line/u.exec(e.message)?.[1] : void 0, i = typeof e.field == "string" ? e.field : r;
|
|
4071
4027
|
return {
|
|
4072
4028
|
endLineNumber: n != null && n > t ? n : void 0,
|
|
@@ -4076,7 +4032,7 @@ function Yr(e, t) {
|
|
|
4076
4032
|
message: e.message,
|
|
4077
4033
|
recordNumber: e.records == null ? void 0 : e.records + 1,
|
|
4078
4034
|
severityId: "error",
|
|
4079
|
-
value: i != null && i.length >
|
|
4035
|
+
value: i != null && i.length > Br ? `${i.slice(0, Br)}…` : i
|
|
4080
4036
|
};
|
|
4081
4037
|
}
|
|
4082
|
-
export {
|
|
4038
|
+
export { Hr as Tool };
|