@dpuse/dpuse-tool-adaltas-csv-parser 1.0.129 → 1.0.131
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.212 | MIT | [LICENSE](licenses/downloads/@dpuse/dpuse-shared@1.0.212-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,7 +69,7 @@ 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.212 — this month: 2026-11-11
|
|
73
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
|
|
|
@@ -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
|
|
|
@@ -2957,7 +2957,6 @@ var Dr = {
|
|
|
2957
2957
|
version: /* @__PURE__ */ Q()
|
|
2958
2958
|
};
|
|
2959
2959
|
({ ...Dr }), $([
|
|
2960
|
-
"abortOperation",
|
|
2961
2960
|
"auditObjectContent",
|
|
2962
2961
|
"closeStore",
|
|
2963
2962
|
"createObject",
|
|
@@ -2973,7 +2972,6 @@ var Dr = {
|
|
|
2973
2972
|
"previewObject",
|
|
2974
2973
|
"queryRecords",
|
|
2975
2974
|
"removeRecords",
|
|
2976
|
-
"retrieveChunks",
|
|
2977
2975
|
"retrieveRecords",
|
|
2978
2976
|
"upsertRecords"
|
|
2979
2977
|
]), $([
|
|
@@ -3909,121 +3907,78 @@ var Rr = {
|
|
|
3909
3907
|
skip_records_with_error: !1,
|
|
3910
3908
|
to_line: -1,
|
|
3911
3909
|
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();
|
|
3910
|
+
}, zr = 1048576, Br = 50, Vr = 1e4, Hr = class {
|
|
3911
|
+
async *parseStream(e, t) {
|
|
3912
|
+
t.abortSignal.throwIfAborted();
|
|
3913
|
+
let n = Math.max(1, Math.floor(t.chunkSize ?? Vr)), r = ir({
|
|
3914
|
+
...Rr,
|
|
3915
|
+
cast: (e, t) => ({
|
|
3916
|
+
value: e,
|
|
3917
|
+
valueWasQuoted: t.quoting
|
|
3918
|
+
}),
|
|
3919
|
+
delimiter: Er(t.valueDelimiterId),
|
|
3920
|
+
relax_column_count: !0
|
|
3921
|
+
}), i = Ur(r), a = e.getReader(), o = () => {
|
|
3922
|
+
jr(() => void a.cancel(t.abortSignal.reason));
|
|
3923
|
+
};
|
|
3924
|
+
t.abortSignal.addEventListener("abort", o, { once: !0 });
|
|
3925
|
+
try {
|
|
3926
|
+
let e = new TextDecoder(Ar(t.encodingId)), o = 0, s = !1, c = await a.read();
|
|
3927
|
+
for (; !c.done;) {
|
|
3928
|
+
o += c.value.length;
|
|
3929
|
+
for (let a = 0; a < c.value.length; a += zr) {
|
|
3930
|
+
t.abortSignal.throwIfAborted();
|
|
3931
|
+
let o = e.decode(c.value.subarray(a, a + zr), { stream: !0 });
|
|
3932
|
+
o.length !== 0 && (s = !0, !r.write(o) && i.error == null && await Gr(r, "drain"), yield* Wr(i, n, t.abortSignal, !1));
|
|
3967
3933
|
}
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3934
|
+
c = await a.read();
|
|
3935
|
+
}
|
|
3936
|
+
t.abortSignal.throwIfAborted();
|
|
3937
|
+
let l = e.decode();
|
|
3938
|
+
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)) : {
|
|
3939
|
+
byteCount: o,
|
|
3940
|
+
commentLineCount: 0,
|
|
3941
|
+
emptyLineCount: 0,
|
|
3942
|
+
lineCount: 0,
|
|
3943
|
+
nonUniformRecordCount: 0,
|
|
3944
|
+
recordCount: 0
|
|
3945
|
+
};
|
|
3946
|
+
} finally {
|
|
3947
|
+
t.abortSignal.removeEventListener("abort", o), r.removeAllListeners(), jr(() => void a.cancel());
|
|
3948
|
+
}
|
|
3982
3949
|
}
|
|
3983
3950
|
async parseText(e, t) {
|
|
3984
|
-
return await Mr(e, t,
|
|
3951
|
+
return await Mr(e, t, qr);
|
|
3985
3952
|
}
|
|
3986
3953
|
};
|
|
3987
|
-
|
|
3988
|
-
let
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3954
|
+
function Ur(e) {
|
|
3955
|
+
let t = {
|
|
3956
|
+
error: void 0,
|
|
3957
|
+
records: []
|
|
3958
|
+
};
|
|
3959
|
+
return e.on("readable", () => {
|
|
3960
|
+
let n;
|
|
3961
|
+
for (; (n = e.read()) != null;) t.records.push(n);
|
|
3962
|
+
}), e.on("error", (e) => {
|
|
3963
|
+
t.error = e;
|
|
3964
|
+
}), t;
|
|
3994
3965
|
}
|
|
3995
|
-
function
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
3966
|
+
function* Wr(e, t, n, r) {
|
|
3967
|
+
if (e.error != null) throw e.error;
|
|
3968
|
+
for (; e.records.length >= t || r && e.records.length > 0;) n.throwIfAborted(), yield {
|
|
3969
|
+
records: e.records.splice(0, t),
|
|
3970
|
+
typeId: "parsingRecordArray"
|
|
3971
|
+
};
|
|
3972
|
+
}
|
|
3973
|
+
function Gr(e, t) {
|
|
3974
|
+
return new Promise((n) => {
|
|
3975
|
+
let r = () => {
|
|
3976
|
+
e.removeListener(t, r), e.removeListener("error", r), n();
|
|
3977
|
+
};
|
|
3978
|
+
e.once(t, r), e.once("error", r);
|
|
4000
3979
|
});
|
|
4001
3980
|
}
|
|
4002
3981
|
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
3982
|
return {
|
|
4028
3983
|
byteCount: e?.info.bytes ?? -1,
|
|
4029
3984
|
commentLineCount: e?.info.comment_lines ?? -1,
|
|
@@ -4033,10 +3988,10 @@ function qr(e) {
|
|
|
4033
3988
|
recordCount: e?.info.records ?? -1
|
|
4034
3989
|
};
|
|
4035
3990
|
}
|
|
4036
|
-
function
|
|
3991
|
+
function qr(e, t, n) {
|
|
4037
3992
|
return new Promise((r) => {
|
|
4038
3993
|
let i = [], a = [], o = 0, s = (e) => {
|
|
4039
|
-
e == null || !n && e.code === "CSV_QUOTE_NOT_CLOSED" || (i.push(
|
|
3994
|
+
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
3995
|
}, c = ir({
|
|
4041
3996
|
...Rr,
|
|
4042
3997
|
cast: (e, t) => ({
|
|
@@ -4066,7 +4021,7 @@ function Jr(e, t, n) {
|
|
|
4066
4021
|
}), c.write(e), c.end();
|
|
4067
4022
|
});
|
|
4068
4023
|
}
|
|
4069
|
-
function
|
|
4024
|
+
function Jr(e, t) {
|
|
4070
4025
|
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
4026
|
return {
|
|
4072
4027
|
endLineNumber: n != null && n > t ? n : void 0,
|
|
@@ -4076,7 +4031,7 @@ function Yr(e, t) {
|
|
|
4076
4031
|
message: e.message,
|
|
4077
4032
|
recordNumber: e.records == null ? void 0 : e.records + 1,
|
|
4078
4033
|
severityId: "error",
|
|
4079
|
-
value: i != null && i.length >
|
|
4034
|
+
value: i != null && i.length > Br ? `${i.slice(0, Br)}…` : i
|
|
4080
4035
|
};
|
|
4081
4036
|
}
|
|
4082
|
-
export {
|
|
4037
|
+
export { Hr as Tool };
|