@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.188 | MIT | [LICENSE](licenses/downloads/@dpuse/dpuse-shared@1.0.188-LICENSE.txt) |
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.188 — this month: 2026-11-07
73
- - **[valibot](https://github.com/open-circle/valibot)** 1.5.0 — 1 mth ago: 2026-09-09
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.8&nbsp;kB&nbsp;·&nbsp;gzip&nbsp;32.5&nbsp;kB&nbsp;·&nbsp;100.0%&nbsp;of&nbsp;the&nbsp;build |
89
- | &nbsp;&nbsp;&nbsp;&nbsp;csv-parse → dist/esm/index.js | `███████████████░░░░░`&nbsp;73.6%&nbsp;·&nbsp;99.2&nbsp;kB |
90
- | &nbsp;&nbsp;&nbsp;&nbsp;@dpuse/dpuse-shared → dist/dpuse-shared.es.js | `███░░░░░░░░░░░░░░░░░`&nbsp;17.2%&nbsp;·&nbsp;23.2&nbsp;kB |
91
- | &nbsp;&nbsp;&nbsp;&nbsp;src → index.ts | `█░░░░░░░░░░░░░░░░░░░`&nbsp;3.3%&nbsp;·&nbsp;4.4&nbsp;kB |
92
- | &nbsp;&nbsp;&nbsp;&nbsp;(bundler output, whitespace & JSON) | `█░░░░░░░░░░░░░░░░░░░`&nbsp;5.9%&nbsp;·&nbsp;8.0&nbsp;kB |
88
+ | **dist/dpuse-tool-adaltas-csv-parser.es.js** | 134.0&nbsp;kB&nbsp;·&nbsp;gzip&nbsp;32.2&nbsp;kB&nbsp;·&nbsp;100.0%&nbsp;of&nbsp;the&nbsp;build |
89
+ | &nbsp;&nbsp;&nbsp;&nbsp;csv-parse → dist/esm/index.js | `███████████████░░░░░`&nbsp;74.0%&nbsp;·&nbsp;99.2&nbsp;kB |
90
+ | &nbsp;&nbsp;&nbsp;&nbsp;@dpuse/dpuse-shared → dist/dpuse-shared.es.js | `███░░░░░░░░░░░░░░░░░`&nbsp;17.3%&nbsp;·&nbsp;23.2&nbsp;kB |
91
+ | &nbsp;&nbsp;&nbsp;&nbsp;src → index.ts | `█░░░░░░░░░░░░░░░░░░░`&nbsp;2.8%&nbsp;·&nbsp;3.8&nbsp;kB |
92
+ | &nbsp;&nbsp;&nbsp;&nbsp;(bundler output, whitespace & JSON) | `█░░░░░░░░░░░░░░░░░░░`&nbsp;5.8%&nbsp;·&nbsp;7.8&nbsp;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 = 4, Br = 1048576, Vr = 50, Hr = 1e4, Ur = class {
3913
- async parseStream(e, t, n) {
3914
- return new Promise((r, i) => {
3915
- let a, o, s, c = !1, l = !1, u = () => {
3916
- if (l) return;
3917
- l = !0;
3918
- let e = a;
3919
- a = void 0, s = void 0, e != null && (jr(() => e.removeAllListeners()), jr(() => e.end())), jr(() => void o?.cancel()), o = void 0;
3920
- }, d = (e) => {
3921
- c || (c = !0, u(), i(e instanceof Error ? e : Error(String(e))));
3922
- };
3923
- t.abortSignal.addEventListener("abort", () => {
3924
- d(t.abortSignal.reason);
3925
- }, { once: !0 }), (async () => {
3926
- t.abortSignal.throwIfAborted(), a = ir({
3927
- ...Rr,
3928
- cast: (e, t) => ({
3929
- value: e,
3930
- valueWasQuoted: t.quoting
3931
- }),
3932
- delimiter: Er(t.valueDelimiterId),
3933
- relax_column_count: !0
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
- if (c) return;
3969
- let h = u.decode();
3970
- h.length > 0 && (a.write(h), p = !0), p ? a.end() : (a.removeAllListeners(), a = void 0, r({
3971
- byteCount: f,
3972
- commentLineCount: 0,
3973
- emptyLineCount: 0,
3974
- lineCount: 0,
3975
- nonUniformRecordCount: 0,
3976
- recordCount: 0
3977
- }));
3978
- })().catch((e) => {
3979
- d(e);
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, Jr);
3952
+ return await Mr(e, t, qr);
3985
3953
  }
3986
3954
  };
3987
- async function Wr(e, t, n, r) {
3988
- let i = 0;
3989
- for (let a = 0; a < n.length; a += Br) {
3990
- let o = t.decode(n.subarray(a, a + Br), { stream: !0 });
3991
- o.length > 0 && (i += o.length, e.write(o) || await Gr(e)), await r.drain();
3992
- }
3993
- return i;
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 Gr(e) {
3996
- return new Promise((t) => {
3997
- e.once("drain", () => {
3998
- t();
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 Jr(e, t, n) {
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(Yr(e, o + 1)), e.lines != null && (o = e.lines));
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 Yr(e, t) {
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 > Vr ? `${i.slice(0, Vr)}…` : i
4035
+ value: i != null && i.length > Br ? `${i.slice(0, Br)}…` : i
4080
4036
  };
4081
4037
  }
4082
- export { Ur as Tool };
4038
+ export { Hr as Tool };