@dpuse/dpuse-tool-adaltas-csv-parser 1.0.126 → 1.0.127

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.161 | MIT | [LICENSE](licenses/downloads/@dpuse/dpuse-shared@1.0.161-LICENSE.txt) |
64
+ | [@dpuse/dpuse-shared](https://github.com/dpuse/dpuse-shared) | 1.0.174 | MIT | [LICENSE](licenses/downloads/@dpuse/dpuse-shared@1.0.174-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.161 — this month: 2026-10-29
72
+ - **[@dpuse/dpuse-shared](https://github.com/dpuse/dpuse-shared)** 1.0.174 — this month: 2026-11-02
73
73
  - **[valibot](https://github.com/open-circle/valibot)** 1.5.0 — 1 mth 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,9 +85,9 @@ _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** | 126.8 kB · gzip 31.8 kB · 100.0% of the build |
88
+ | **dist/dpuse-tool-adaltas-csv-parser.es.js** | 126.9 kB · gzip 31.9 kB · 100.0% of the build |
89
89
  |     csv-parse → dist/esm/index.js | `████████████████░░░░` 78.2% · 99.2 kB |
90
- |     @dpuse/dpuse-shared → dist/dpuse-shared.es.js | `███░░░░░░░░░░░░░░░░░` 12.5% · 15.9 kB |
90
+ |     @dpuse/dpuse-shared → dist/dpuse-shared.es.js | `███░░░░░░░░░░░░░░░░░` 12.6% · 15.9 kB |
91
91
  |     src → index.ts | `█░░░░░░░░░░░░░░░░░░░` 3.5% · 4.4 kB |
92
92
  |     (bundler output, whitespace & JSON) | `█░░░░░░░░░░░░░░░░░░░` 5.8% · 7.4 kB |
93
93
 
@@ -2955,91 +2955,7 @@ var Er = {
2955
2955
  "oAuth2",
2956
2956
  "none"
2957
2957
  ]), { ...Er };
2958
- function Dr(e) {
2959
- try {
2960
- e();
2961
- } catch {}
2962
- }
2963
- $([
2964
- "arrow",
2965
- "avro",
2966
- "dtv",
2967
- "json",
2968
- "jsonl",
2969
- "markdown",
2970
- "ods",
2971
- "parquet",
2972
- "sav",
2973
- "sqlite",
2974
- "xlsx",
2975
- "xml"
2976
- ]), { ...Er };
2977
- async function Or(e, t, n) {
2978
- let r = kr(e), { issues: i, parsedRecords: a, valueDelimiterId: o } = await Ar(e, t.valueDelimiterIds, t.isComplete, n);
2979
- return {
2980
- issues: i,
2981
- parsedRecords: a,
2982
- recordDelimiterId: r,
2983
- valueDelimiterId: o
2984
- };
2985
- }
2986
- function kr(e) {
2987
- let t = (e.match(/\r\n/g) ?? []).length, n = (e.match(/(?<!\r)\n/g) ?? []).length, r = (e.match(/\r(?!\n)/g) ?? []).length;
2988
- return t >= n && t >= r ? "\r\n" : n >= t && n >= r ? "\n" : r >= t && r >= n ? "\r" : "\n";
2989
- }
2990
- async function Ar(e, t, n, r) {
2991
- let i, a, o, s = [], c, l = !1;
2992
- for (let u of t) {
2993
- let { issues: t, records: d } = await r(e, u, n);
2994
- if (t.length > 0) {
2995
- c = jr(c, {
2996
- delimiter: u,
2997
- issues: t,
2998
- records: d
2999
- });
3000
- continue;
3001
- }
3002
- if (l = !0, d.length === 0) continue;
3003
- let { averageValueCount: f, sumOfValueCountDiffs: p } = Mr(d);
3004
- (!o || p <= o) && (!a || f > a) && (i = u, a = f, o = p, s = d);
3005
- }
3006
- if (!l && c != null) {
3007
- let { delimiter: e, issues: t, records: n } = c;
3008
- return {
3009
- issues: t,
3010
- parsedRecords: n,
3011
- valueDelimiterId: Nr(n) ? e : void 0
3012
- };
3013
- }
3014
- return {
3015
- issues: [],
3016
- parsedRecords: s,
3017
- valueDelimiterId: i != null && Nr(s) ? i : void 0
3018
- };
3019
- }
3020
- function jr(e, t) {
3021
- return e == null || t.issues.length < e.issues.length ? t : e;
3022
- }
3023
- function Mr(e) {
3024
- let t = 0, n = 0, r;
3025
- for (let i of e) r != null && (n += Math.abs(i.length - r)), r = i.length, t += i.length;
3026
- return {
3027
- averageValueCount: t / e.length,
3028
- sumOfValueCountDiffs: n
3029
- };
3030
- }
3031
- function Nr(e) {
3032
- let t = /* @__PURE__ */ new Map();
3033
- for (let n of e) t.set(n.length, (t.get(n.length) ?? 0) + 1);
3034
- let [n = 0, r = 0] = [...t].toSorted((e, t) => t[1] - e[1])[0] ?? [];
3035
- return n > 1 && r * 2 > e.length;
3036
- }
3037
- $(["list"]), { ...Er }, $([
3038
- "list",
3039
- "render",
3040
- "setColorMode"
3041
- ]), { ...Er };
3042
- var Pr = {
2958
+ var Dr = {
3043
2959
  ascii: {
3044
2960
  id: "ascii",
3045
2961
  groupId: null,
@@ -3471,12 +3387,96 @@ var Pr = {
3471
3387
  decoderId: "windows-1257"
3472
3388
  }
3473
3389
  };
3390
+ function Or(e) {
3391
+ return Object.hasOwn(Dr, e);
3392
+ }
3393
+ function kr(e) {
3394
+ return Or(e) ? Dr[e].decoderId ?? e : e;
3395
+ }
3396
+ function Ar(e) {
3397
+ try {
3398
+ e();
3399
+ } catch {}
3400
+ }
3401
+ $([
3402
+ "arrow",
3403
+ "avro",
3404
+ "dtv",
3405
+ "json",
3406
+ "jsonl",
3407
+ "markdown",
3408
+ "ods",
3409
+ "parquet",
3410
+ "sav",
3411
+ "sqlite",
3412
+ "xlsx",
3413
+ "xml"
3414
+ ]), { ...Er };
3415
+ async function jr(e, t, n) {
3416
+ let r = Mr(e), { issues: i, parsedRecords: a, valueDelimiterId: o } = await Nr(e, t.valueDelimiterIds, t.isComplete, n);
3417
+ return {
3418
+ issues: i,
3419
+ parsedRecords: a,
3420
+ recordDelimiterId: r,
3421
+ valueDelimiterId: o
3422
+ };
3423
+ }
3424
+ function Mr(e) {
3425
+ let t = (e.match(/\r\n/g) ?? []).length, n = (e.match(/(?<!\r)\n/g) ?? []).length, r = (e.match(/\r(?!\n)/g) ?? []).length;
3426
+ return t >= n && t >= r ? "\r\n" : n >= t && n >= r ? "\n" : r >= t && r >= n ? "\r" : "\n";
3427
+ }
3428
+ async function Nr(e, t, n, r) {
3429
+ let i, a, o, s = [], c, l = !1;
3430
+ for (let u of t) {
3431
+ let { issues: t, records: d } = await r(e, u, n);
3432
+ if (t.length > 0) {
3433
+ c = Pr(c, {
3434
+ delimiter: u,
3435
+ issues: t,
3436
+ records: d
3437
+ });
3438
+ continue;
3439
+ }
3440
+ if (l = !0, d.length === 0) continue;
3441
+ let { averageValueCount: f, sumOfValueCountDiffs: p } = Fr(d);
3442
+ (a === void 0 || a <= 1 || p <= (o ?? 0)) && (a === void 0 || f > a) && (i = u, a = f, o = p, s = d);
3443
+ }
3444
+ if (!l && c != null) {
3445
+ let { delimiter: e, issues: t, records: n } = c;
3446
+ return {
3447
+ issues: t,
3448
+ parsedRecords: n,
3449
+ valueDelimiterId: Ir(n) ? e : void 0
3450
+ };
3451
+ }
3452
+ return {
3453
+ issues: [],
3454
+ parsedRecords: s,
3455
+ valueDelimiterId: i != null && Ir(s) ? i : void 0
3456
+ };
3457
+ }
3458
+ function Pr(e, t) {
3459
+ return e == null || t.issues.length < e.issues.length ? t : e;
3460
+ }
3474
3461
  function Fr(e) {
3475
- return Object.hasOwn(Pr, e);
3462
+ let t = 0, n = 0, r;
3463
+ for (let i of e) r != null && (n += Math.abs(i.length - r)), r = i.length, t += i.length;
3464
+ return {
3465
+ averageValueCount: t / e.length,
3466
+ sumOfValueCountDiffs: n
3467
+ };
3476
3468
  }
3477
3469
  function Ir(e) {
3478
- return Fr(e) ? Pr[e].decoderId ?? e : e;
3470
+ let t = /* @__PURE__ */ new Map();
3471
+ for (let n of e) t.set(n.length, (t.get(n.length) ?? 0) + 1);
3472
+ let [n = 0, r = 0] = [...t].toSorted((e, t) => t[1] - e[1])[0] ?? [];
3473
+ return n > 1 && r * 2 > e.length;
3479
3474
  }
3475
+ $(["list"]), { ...Er }, $([
3476
+ "list",
3477
+ "render",
3478
+ "setColorMode"
3479
+ ]), { ...Er };
3480
3480
  // src/index.ts
3481
3481
  var Lr = {
3482
3482
  bom: !1,
@@ -3514,7 +3514,7 @@ var Lr = {
3514
3514
  if (l) return;
3515
3515
  l = !0;
3516
3516
  let e = a;
3517
- a = void 0, s = void 0, e != null && (Dr(() => e.removeAllListeners()), Dr(() => e.end())), Dr(() => void o?.cancel()), o = void 0;
3517
+ a = void 0, s = void 0, e != null && (Ar(() => e.removeAllListeners()), Ar(() => e.end())), Ar(() => void o?.cancel()), o = void 0;
3518
3518
  }, d = (e) => {
3519
3519
  c || (c = !0, u(), i(e instanceof Error ? e : Error(String(e))));
3520
3520
  };
@@ -3558,7 +3558,7 @@ var Lr = {
3558
3558
  a.on("end", () => {
3559
3559
  c || (i.flush(), l(Kr(a)));
3560
3560
  }), o = e.getReader();
3561
- let u = new TextDecoder(Ir(t.encodingId)), f = 0, p = !1, m = await o.read();
3561
+ let u = new TextDecoder(kr(t.encodingId)), f = 0, p = !1, m = await o.read();
3562
3562
  for (; !m.done;) {
3563
3563
  if (c) return;
3564
3564
  t.abortSignal.throwIfAborted(), f += m.value.length, await Ur(a, u, m.value, i) > 0 && (p = !0), m = await o.read();
@@ -3579,7 +3579,7 @@ var Lr = {
3579
3579
  });
3580
3580
  }
3581
3581
  async parseText(e, t) {
3582
- return await Or(e, t, qr);
3582
+ return await jr(e, t, qr);
3583
3583
  }
3584
3584
  };
3585
3585
  async function Ur(e, t, n, r) {