@dpuse/dpuse-tool-rust-csv-core-parser 1.0.116 → 1.0.118
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.
|
@@ -1,29 +1,26 @@
|
|
|
1
1
|
// node_modules/@dpuse/dpuse-shared/dist/dpuse-shared.es.js
|
|
2
|
-
|
|
3
|
-
return new Map(Object.entries(e));
|
|
4
|
-
}
|
|
5
|
-
var t = {
|
|
2
|
+
var e = {
|
|
6
3
|
lang: void 0,
|
|
7
4
|
message: void 0,
|
|
8
5
|
abortEarly: void 0,
|
|
9
6
|
abortPipeEarly: void 0
|
|
10
7
|
};
|
|
11
8
|
/* @__NO_SIDE_EFFECTS__ */
|
|
12
|
-
function
|
|
13
|
-
return
|
|
14
|
-
lang:
|
|
15
|
-
message:
|
|
16
|
-
abortEarly:
|
|
17
|
-
abortPipeEarly:
|
|
18
|
-
} :
|
|
9
|
+
function t(t) {
|
|
10
|
+
return t ? {
|
|
11
|
+
lang: t?.lang ?? void 0,
|
|
12
|
+
message: t?.message,
|
|
13
|
+
abortEarly: t?.abortEarly ?? void 0,
|
|
14
|
+
abortPipeEarly: t?.abortPipeEarly ?? void 0
|
|
15
|
+
} : e;
|
|
19
16
|
}
|
|
20
17
|
/* @__NO_SIDE_EFFECTS__ */
|
|
21
|
-
function
|
|
18
|
+
function n(e) {
|
|
22
19
|
let t = typeof e;
|
|
23
20
|
return t === "string" ? `"${e}"` : t === "number" || t === "bigint" || t === "boolean" ? `${e}` : t === "object" || t === "function" ? (e && Object.getPrototypeOf(e)?.constructor?.name) ?? "null" : t;
|
|
24
21
|
}
|
|
25
|
-
function
|
|
26
|
-
let o = a && "input" in a ? a.input :
|
|
22
|
+
function r(e, t, r, i, a) {
|
|
23
|
+
let o = a && "input" in a ? a.input : r.value, s = a?.expected ?? e.expects ?? null, c = a?.received ?? /* @__PURE__ */ n(o), l = {
|
|
27
24
|
kind: e.kind,
|
|
28
25
|
type: e.type,
|
|
29
26
|
input: o,
|
|
@@ -37,97 +34,97 @@ function i(e, t, n, i, a) {
|
|
|
37
34
|
abortEarly: i.abortEarly,
|
|
38
35
|
abortPipeEarly: i.abortPipeEarly
|
|
39
36
|
}, u = e.kind === "schema", d = a?.message ?? e.message ?? (e.reference, l.lang, void 0) ?? (u ? (l.lang, void 0) : null) ?? i.message ?? (l.lang, void 0);
|
|
40
|
-
d !== void 0 && (l.message = typeof d == "function" ? d(l) : d), u && (
|
|
37
|
+
d !== void 0 && (l.message = typeof d == "function" ? d(l) : d), u && (r.typed = !1), r.issues ? r.issues.push(l) : r.issues = [l];
|
|
41
38
|
}
|
|
42
39
|
/* @__NO_SIDE_EFFECTS__ */
|
|
43
|
-
function
|
|
40
|
+
function i(e, t) {
|
|
44
41
|
return e === t || Number.isNaN(e) && Number.isNaN(t);
|
|
45
42
|
}
|
|
46
43
|
/* @__NO_SIDE_EFFECTS__ */
|
|
47
|
-
function
|
|
44
|
+
function a(e, t) {
|
|
48
45
|
let n = [...new Set(e)];
|
|
49
46
|
return n.length > 1 ? `(${n.join(` ${t} `)})` : n[0] ?? "never";
|
|
50
47
|
}
|
|
51
|
-
function
|
|
48
|
+
function o(e) {
|
|
52
49
|
return e["~standard"] = {
|
|
53
50
|
version: 1,
|
|
54
51
|
vendor: "valibot",
|
|
55
|
-
validate: (
|
|
52
|
+
validate: (n) => e["~run"]({ value: n }, /* @__PURE__ */ t())
|
|
56
53
|
}, e;
|
|
57
54
|
}
|
|
58
55
|
/* @__NO_SIDE_EFFECTS__ */
|
|
59
|
-
function
|
|
56
|
+
function s(e, t, n) {
|
|
60
57
|
return typeof e.fallback == "function" ? e.fallback(t, n) : e.fallback;
|
|
61
58
|
}
|
|
62
59
|
/* @__NO_SIDE_EFFECTS__ */
|
|
63
|
-
function
|
|
60
|
+
function c(e, t, n) {
|
|
64
61
|
return typeof e.default == "function" ? e.default(t, n) : e.default;
|
|
65
62
|
}
|
|
66
63
|
/* @__NO_SIDE_EFFECTS__ */
|
|
67
|
-
function
|
|
68
|
-
return
|
|
64
|
+
function l(e, t) {
|
|
65
|
+
return o({
|
|
69
66
|
kind: "schema",
|
|
70
67
|
type: "literal",
|
|
71
|
-
reference:
|
|
72
|
-
expects: /* @__PURE__ */
|
|
68
|
+
reference: l,
|
|
69
|
+
expects: /* @__PURE__ */ n(e),
|
|
73
70
|
async: !1,
|
|
74
71
|
literal: e,
|
|
75
72
|
message: t,
|
|
76
73
|
"~run"(e, t) {
|
|
77
|
-
return /* @__PURE__ */
|
|
74
|
+
return /* @__PURE__ */ i(e.value, this.literal) ? e.typed = !0 : r(this, "type", e, t), e;
|
|
78
75
|
}
|
|
79
76
|
});
|
|
80
77
|
}
|
|
81
78
|
/* @__NO_SIDE_EFFECTS__ */
|
|
82
|
-
function
|
|
83
|
-
return
|
|
79
|
+
function u(e, t) {
|
|
80
|
+
return o({
|
|
84
81
|
kind: "schema",
|
|
85
82
|
type: "nullable",
|
|
86
|
-
reference:
|
|
83
|
+
reference: u,
|
|
87
84
|
expects: `(${e.expects} | null)`,
|
|
88
85
|
async: !1,
|
|
89
86
|
wrapped: e,
|
|
90
87
|
default: t,
|
|
91
88
|
"~run"(e, t) {
|
|
92
|
-
return e.value === null && (this.default !== void 0 && (e.value = /* @__PURE__ */
|
|
89
|
+
return e.value === null && (this.default !== void 0 && (e.value = /* @__PURE__ */ c(this, e, t)), e.value === null) ? (e.typed = !0, e) : this.wrapped["~run"](e, t);
|
|
93
90
|
}
|
|
94
91
|
});
|
|
95
92
|
}
|
|
96
93
|
/* @__NO_SIDE_EFFECTS__ */
|
|
97
|
-
function
|
|
98
|
-
return
|
|
94
|
+
function d(e) {
|
|
95
|
+
return o({
|
|
99
96
|
kind: "schema",
|
|
100
97
|
type: "number",
|
|
101
|
-
reference:
|
|
98
|
+
reference: d,
|
|
102
99
|
expects: "number",
|
|
103
100
|
async: !1,
|
|
104
101
|
message: e,
|
|
105
102
|
"~run"(e, t) {
|
|
106
|
-
return typeof e.value == "number" && !isNaN(e.value) ? e.typed = !0 :
|
|
103
|
+
return typeof e.value == "number" && !isNaN(e.value) ? e.typed = !0 : r(this, "type", e, t), e;
|
|
107
104
|
}
|
|
108
105
|
});
|
|
109
106
|
}
|
|
110
107
|
/* @__NO_SIDE_EFFECTS__ */
|
|
111
|
-
function
|
|
112
|
-
return
|
|
108
|
+
function f(e, t) {
|
|
109
|
+
return o({
|
|
113
110
|
kind: "schema",
|
|
114
111
|
type: "optional",
|
|
115
|
-
reference:
|
|
112
|
+
reference: f,
|
|
116
113
|
expects: `(${e.expects} | undefined)`,
|
|
117
114
|
async: !1,
|
|
118
115
|
wrapped: e,
|
|
119
116
|
default: t,
|
|
120
117
|
"~run"(e, t) {
|
|
121
|
-
return e.value === void 0 && (this.default !== void 0 && (e.value = /* @__PURE__ */
|
|
118
|
+
return e.value === void 0 && (this.default !== void 0 && (e.value = /* @__PURE__ */ c(this, e, t)), e.value === void 0) ? (e.typed = !0, e) : this.wrapped["~run"](e, t);
|
|
122
119
|
}
|
|
123
120
|
});
|
|
124
121
|
}
|
|
125
122
|
/* @__NO_SIDE_EFFECTS__ */
|
|
126
|
-
function
|
|
127
|
-
return
|
|
123
|
+
function p(e, t) {
|
|
124
|
+
return o({
|
|
128
125
|
kind: "schema",
|
|
129
126
|
type: "strict_object",
|
|
130
|
-
reference:
|
|
127
|
+
reference: p,
|
|
131
128
|
expects: "Object",
|
|
132
129
|
async: !1,
|
|
133
130
|
entries: e,
|
|
@@ -136,17 +133,17 @@ function m(e, t) {
|
|
|
136
133
|
let n = e.value;
|
|
137
134
|
if (n && typeof n == "object") {
|
|
138
135
|
e.typed = !0, e.value = {};
|
|
139
|
-
for (let
|
|
140
|
-
let a = this.entries[
|
|
141
|
-
if (
|
|
142
|
-
let
|
|
136
|
+
for (let i in this.entries) {
|
|
137
|
+
let a = this.entries[i];
|
|
138
|
+
if (i in n || (a.type === "exact_optional" || a.type === "optional" || a.type === "nullish") && a.default !== void 0) {
|
|
139
|
+
let r = i in n ? n[i] : /* @__PURE__ */ c(a), o = a["~run"]({ value: r }, t);
|
|
143
140
|
if (o.issues) {
|
|
144
141
|
let a = {
|
|
145
142
|
type: "object",
|
|
146
143
|
origin: "value",
|
|
147
144
|
input: n,
|
|
148
|
-
key:
|
|
149
|
-
value:
|
|
145
|
+
key: i,
|
|
146
|
+
value: r
|
|
150
147
|
};
|
|
151
148
|
for (let t of o.issues) t.path ? t.path.unshift(a) : t.path = [a], e.issues?.push(t);
|
|
152
149
|
if (e.issues ||= o.issues, t.abortEarly) {
|
|
@@ -154,78 +151,78 @@ function m(e, t) {
|
|
|
154
151
|
break;
|
|
155
152
|
}
|
|
156
153
|
}
|
|
157
|
-
o.typed || (e.typed = !1), e.value[
|
|
158
|
-
} else if (a.fallback !== void 0) e.value[
|
|
159
|
-
else if (a.type !== "exact_optional" && a.type !== "optional" && a.type !== "nullish" && (
|
|
154
|
+
o.typed || (e.typed = !1), e.value[i] = o.value;
|
|
155
|
+
} else if (a.fallback !== void 0) e.value[i] = /* @__PURE__ */ s(a);
|
|
156
|
+
else if (a.type !== "exact_optional" && a.type !== "optional" && a.type !== "nullish" && (r(this, "key", e, t, {
|
|
160
157
|
input: void 0,
|
|
161
|
-
expected: `"${
|
|
158
|
+
expected: `"${i}"`,
|
|
162
159
|
path: [{
|
|
163
160
|
type: "object",
|
|
164
161
|
origin: "key",
|
|
165
162
|
input: n,
|
|
166
|
-
key:
|
|
167
|
-
value: n[
|
|
163
|
+
key: i,
|
|
164
|
+
value: n[i]
|
|
168
165
|
}]
|
|
169
166
|
}), t.abortEarly)) break;
|
|
170
167
|
}
|
|
171
168
|
if (!e.issues || !t.abortEarly) {
|
|
172
|
-
for (let
|
|
173
|
-
|
|
174
|
-
input:
|
|
169
|
+
for (let i in n) if (!Object.prototype.hasOwnProperty.call(this.entries, i)) {
|
|
170
|
+
r(this, "key", e, t, {
|
|
171
|
+
input: i,
|
|
175
172
|
expected: "never",
|
|
176
173
|
path: [{
|
|
177
174
|
type: "object",
|
|
178
175
|
origin: "key",
|
|
179
176
|
input: n,
|
|
180
|
-
key:
|
|
181
|
-
value: n[
|
|
177
|
+
key: i,
|
|
178
|
+
value: n[i]
|
|
182
179
|
}]
|
|
183
180
|
});
|
|
184
181
|
break;
|
|
185
182
|
}
|
|
186
183
|
}
|
|
187
|
-
} else
|
|
184
|
+
} else r(this, "type", e, t);
|
|
188
185
|
return e;
|
|
189
186
|
}
|
|
190
187
|
});
|
|
191
188
|
}
|
|
192
189
|
/* @__NO_SIDE_EFFECTS__ */
|
|
193
|
-
function
|
|
194
|
-
return
|
|
190
|
+
function m(e) {
|
|
191
|
+
return o({
|
|
195
192
|
kind: "schema",
|
|
196
193
|
type: "string",
|
|
197
|
-
reference:
|
|
194
|
+
reference: m,
|
|
198
195
|
expects: "string",
|
|
199
196
|
async: !1,
|
|
200
197
|
message: e,
|
|
201
198
|
"~run"(e, t) {
|
|
202
|
-
return typeof e.value == "string" ? e.typed = !0 :
|
|
199
|
+
return typeof e.value == "string" ? e.typed = !0 : r(this, "type", e, t), e;
|
|
203
200
|
}
|
|
204
201
|
});
|
|
205
202
|
}
|
|
206
203
|
/* @__NO_SIDE_EFFECTS__ */
|
|
207
|
-
function
|
|
204
|
+
function h(e) {
|
|
208
205
|
let t;
|
|
209
206
|
if (e) for (let n of e) if (t) for (let e of n.issues) t.push(e);
|
|
210
207
|
else t = n.issues;
|
|
211
208
|
return t;
|
|
212
209
|
}
|
|
213
210
|
/* @__NO_SIDE_EFFECTS__ */
|
|
214
|
-
function
|
|
215
|
-
return
|
|
211
|
+
function g(e, t) {
|
|
212
|
+
return o({
|
|
216
213
|
kind: "schema",
|
|
217
214
|
type: "union",
|
|
218
|
-
reference:
|
|
219
|
-
expects: /* @__PURE__ */
|
|
215
|
+
reference: g,
|
|
216
|
+
expects: /* @__PURE__ */ a(e.map((e) => e.expects), "|"),
|
|
220
217
|
async: !1,
|
|
221
218
|
options: e,
|
|
222
219
|
message: t,
|
|
223
220
|
"~run"(e, t) {
|
|
224
|
-
let n,
|
|
225
|
-
for (let
|
|
226
|
-
let o =
|
|
221
|
+
let n, i, a;
|
|
222
|
+
for (let r of this.options) {
|
|
223
|
+
let o = r["~run"]({ value: e.value }, t);
|
|
227
224
|
if (o.typed) {
|
|
228
|
-
if (o.issues)
|
|
225
|
+
if (o.issues) i ? i.push(o) : i = [o];
|
|
229
226
|
else {
|
|
230
227
|
n = o;
|
|
231
228
|
break;
|
|
@@ -233,28 +230,28 @@ function _(e, t) {
|
|
|
233
230
|
} else a ? a.push(o) : a = [o];
|
|
234
231
|
}
|
|
235
232
|
if (n) return n;
|
|
236
|
-
if (
|
|
237
|
-
if (
|
|
238
|
-
|
|
233
|
+
if (i) {
|
|
234
|
+
if (i.length === 1) return i[0];
|
|
235
|
+
r(this, "type", e, t, { issues: /* @__PURE__ */ h(i) }), e.typed = !0;
|
|
239
236
|
} else if (a?.length === 1) return a[0];
|
|
240
|
-
else
|
|
237
|
+
else r(this, "type", e, t, { issues: /* @__PURE__ */ h(a) });
|
|
241
238
|
return e;
|
|
242
239
|
}
|
|
243
240
|
});
|
|
244
241
|
}
|
|
245
|
-
var
|
|
246
|
-
id: /* @__PURE__ */
|
|
247
|
-
label: /* @__PURE__ */
|
|
248
|
-
en: /* @__PURE__ */
|
|
249
|
-
es: /* @__PURE__ */
|
|
242
|
+
var _ = {
|
|
243
|
+
id: /* @__PURE__ */ m(),
|
|
244
|
+
label: /* @__PURE__ */ p({
|
|
245
|
+
en: /* @__PURE__ */ f(/* @__PURE__ */ m()),
|
|
246
|
+
es: /* @__PURE__ */ f(/* @__PURE__ */ m())
|
|
250
247
|
}),
|
|
251
|
-
description: /* @__PURE__ */
|
|
252
|
-
en: /* @__PURE__ */
|
|
253
|
-
es: /* @__PURE__ */
|
|
248
|
+
description: /* @__PURE__ */ p({
|
|
249
|
+
en: /* @__PURE__ */ f(/* @__PURE__ */ m()),
|
|
250
|
+
es: /* @__PURE__ */ f(/* @__PURE__ */ m())
|
|
254
251
|
}),
|
|
255
|
-
icon: /* @__PURE__ */
|
|
256
|
-
iconDark: /* @__PURE__ */
|
|
257
|
-
},
|
|
252
|
+
icon: /* @__PURE__ */ u(/* @__PURE__ */ m()),
|
|
253
|
+
iconDark: /* @__PURE__ */ u(/* @__PURE__ */ m())
|
|
254
|
+
}, v = (e) => /* @__PURE__ */ g(e.map((e) => /* @__PURE__ */ l(e))), y = v([
|
|
258
255
|
"app",
|
|
259
256
|
"connector",
|
|
260
257
|
"connectorConnection",
|
|
@@ -276,31 +273,77 @@ var v = {
|
|
|
276
273
|
"presenter",
|
|
277
274
|
"presenterPresentation",
|
|
278
275
|
"tool"
|
|
279
|
-
]),
|
|
276
|
+
]), b = v([
|
|
280
277
|
"danger",
|
|
281
278
|
"success",
|
|
282
279
|
"warning"
|
|
283
|
-
]),
|
|
280
|
+
]), x = v([
|
|
284
281
|
"alpha",
|
|
285
282
|
"beta",
|
|
286
283
|
"releaseCandidate",
|
|
287
284
|
"generalAvailability"
|
|
288
|
-
]),
|
|
289
|
-
color:
|
|
290
|
-
label: /* @__PURE__ */
|
|
291
|
-
}),
|
|
292
|
-
...
|
|
293
|
-
typeId:
|
|
285
|
+
]), S = /* @__PURE__ */ p({
|
|
286
|
+
color: b,
|
|
287
|
+
label: /* @__PURE__ */ m()
|
|
288
|
+
}), C = {
|
|
289
|
+
..._,
|
|
290
|
+
typeId: y
|
|
294
291
|
};
|
|
295
|
-
({ ...
|
|
296
|
-
var
|
|
297
|
-
...
|
|
298
|
-
firstCreatedAt: /* @__PURE__ */
|
|
299
|
-
lastUpdatedAt: /* @__PURE__ */
|
|
300
|
-
status: /* @__PURE__ */
|
|
301
|
-
statusId: /* @__PURE__ */
|
|
292
|
+
({ ...C });
|
|
293
|
+
var w = {
|
|
294
|
+
...C,
|
|
295
|
+
firstCreatedAt: /* @__PURE__ */ u(/* @__PURE__ */ d()),
|
|
296
|
+
lastUpdatedAt: /* @__PURE__ */ u(/* @__PURE__ */ d()),
|
|
297
|
+
status: /* @__PURE__ */ u(S),
|
|
298
|
+
statusId: /* @__PURE__ */ u(x)
|
|
302
299
|
};
|
|
303
|
-
({ ...
|
|
300
|
+
({ ...w });
|
|
301
|
+
var T = [
|
|
302
|
+
{
|
|
303
|
+
id: ",",
|
|
304
|
+
character: ","
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
id: ";",
|
|
308
|
+
character: ";"
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
id: " ",
|
|
312
|
+
character: " "
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
id: "|",
|
|
316
|
+
character: "|"
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
id: " ",
|
|
320
|
+
character: " "
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
id: ":",
|
|
324
|
+
character: ":"
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
id: "_",
|
|
328
|
+
character: "_"
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
id: "!",
|
|
332
|
+
character: "!"
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
id: "0x1F",
|
|
336
|
+
character: ""
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
id: "0x1E",
|
|
340
|
+
character: ""
|
|
341
|
+
}
|
|
342
|
+
];
|
|
343
|
+
function E(e) {
|
|
344
|
+
return T.find(({ id: t }) => t === e)?.character ?? e;
|
|
345
|
+
}
|
|
346
|
+
v([
|
|
304
347
|
"app",
|
|
305
348
|
"engine",
|
|
306
349
|
"connector",
|
|
@@ -308,14 +351,14 @@ var T = {
|
|
|
308
351
|
"presenter",
|
|
309
352
|
"tool"
|
|
310
353
|
]);
|
|
311
|
-
var
|
|
312
|
-
...
|
|
313
|
-
vendorAccountURL: /* @__PURE__ */
|
|
314
|
-
vendorDocumentationURL: /* @__PURE__ */
|
|
315
|
-
vendorHomeURL: /* @__PURE__ */
|
|
316
|
-
version: /* @__PURE__ */
|
|
354
|
+
var D = {
|
|
355
|
+
...w,
|
|
356
|
+
vendorAccountURL: /* @__PURE__ */ u(/* @__PURE__ */ m()),
|
|
357
|
+
vendorDocumentationURL: /* @__PURE__ */ u(/* @__PURE__ */ m()),
|
|
358
|
+
vendorHomeURL: /* @__PURE__ */ u(/* @__PURE__ */ m()),
|
|
359
|
+
version: /* @__PURE__ */ m()
|
|
317
360
|
};
|
|
318
|
-
({ ...
|
|
361
|
+
({ ...D }), v([
|
|
319
362
|
"abortOperation",
|
|
320
363
|
"auditObjectContent",
|
|
321
364
|
"closeStore",
|
|
@@ -335,575 +378,936 @@ var E = {
|
|
|
335
378
|
"retrieveChunks",
|
|
336
379
|
"retrieveRecords",
|
|
337
380
|
"upsertRecords"
|
|
338
|
-
]),
|
|
381
|
+
]), v([
|
|
339
382
|
"application",
|
|
340
383
|
"curatedDataset",
|
|
341
384
|
"database",
|
|
342
385
|
"fileStore"
|
|
343
|
-
]),
|
|
386
|
+
]), v([
|
|
344
387
|
"apiEndpoint",
|
|
345
388
|
"file",
|
|
346
389
|
"table"
|
|
347
|
-
]),
|
|
390
|
+
]), v([
|
|
348
391
|
"bidirectional",
|
|
349
392
|
"destination",
|
|
350
393
|
"source",
|
|
351
394
|
"unknown"
|
|
352
|
-
]),
|
|
395
|
+
]), v([
|
|
353
396
|
"apiKey",
|
|
354
397
|
"disabled",
|
|
355
398
|
"oAuth2",
|
|
356
399
|
"none"
|
|
357
|
-
]), { ...
|
|
358
|
-
var
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
super(e, t, n, r), this.name = "ConnectorError";
|
|
367
|
-
}
|
|
368
|
-
};
|
|
369
|
-
function k(e) {
|
|
370
|
-
try {
|
|
371
|
-
e();
|
|
372
|
-
} catch {}
|
|
373
|
-
}
|
|
374
|
-
y([
|
|
375
|
-
"arrow",
|
|
376
|
-
"avro",
|
|
377
|
-
"dtv",
|
|
378
|
-
"json",
|
|
379
|
-
"jsonl",
|
|
380
|
-
"markdown",
|
|
381
|
-
"ods",
|
|
382
|
-
"parquet",
|
|
383
|
-
"sav",
|
|
384
|
-
"sqlite",
|
|
385
|
-
"xlsx",
|
|
386
|
-
"xml"
|
|
387
|
-
]), { ...E };
|
|
388
|
-
async function A(e, t, n) {
|
|
389
|
-
let r = j(e), { issues: i, parsedRecords: a, valueDelimiterId: o } = await M(e, t.valueDelimiterIds, t.isComplete, n);
|
|
390
|
-
return {
|
|
391
|
-
issues: i,
|
|
392
|
-
parsedRecords: a,
|
|
393
|
-
recordDelimiterId: r,
|
|
394
|
-
valueDelimiterId: o
|
|
395
|
-
};
|
|
396
|
-
}
|
|
397
|
-
function j(e) {
|
|
398
|
-
let t = (e.match(/\r\n/g) ?? []).length, n = (e.match(/(?<!\r)\n/g) ?? []).length, r = (e.match(/\r(?!\n)/g) ?? []).length;
|
|
399
|
-
return t >= n && t >= r ? "\r\n" : n >= t && n >= r ? "\n" : r >= t && r >= n ? "\r" : "\n";
|
|
400
|
-
}
|
|
401
|
-
async function M(e, t, n, r) {
|
|
402
|
-
let i, a, o, s = [], c, l = !1;
|
|
403
|
-
for (let u of t) {
|
|
404
|
-
let { issues: t, records: d } = await r(e, u, n);
|
|
405
|
-
if (t.length > 0) {
|
|
406
|
-
c = N(c, {
|
|
407
|
-
delimiter: u,
|
|
408
|
-
issues: t,
|
|
409
|
-
records: d
|
|
410
|
-
});
|
|
411
|
-
continue;
|
|
412
|
-
}
|
|
413
|
-
if (l = !0, d.length === 0) continue;
|
|
414
|
-
let { averageValueCount: f, sumOfValueCountDiffs: p } = P(d);
|
|
415
|
-
(!o || p <= o) && (!a || f > a) && (i = u, a = f, o = p, s = d);
|
|
416
|
-
}
|
|
417
|
-
if (!l && c != null) {
|
|
418
|
-
let { delimiter: e, issues: t, records: n } = c;
|
|
419
|
-
return {
|
|
420
|
-
issues: t,
|
|
421
|
-
parsedRecords: n,
|
|
422
|
-
valueDelimiterId: F(n) ? e : void 0
|
|
423
|
-
};
|
|
424
|
-
}
|
|
425
|
-
return {
|
|
426
|
-
issues: [],
|
|
427
|
-
parsedRecords: s,
|
|
428
|
-
valueDelimiterId: i != null && F(s) ? i : void 0
|
|
429
|
-
};
|
|
430
|
-
}
|
|
431
|
-
function N(e, t) {
|
|
432
|
-
return e == null || t.issues.length < e.issues.length ? t : e;
|
|
433
|
-
}
|
|
434
|
-
function P(e) {
|
|
435
|
-
let t = 0, n = 0, r;
|
|
436
|
-
for (let i of e) r != null && (n += Math.abs(i.length - r)), r = i.length, t += i.length;
|
|
437
|
-
return {
|
|
438
|
-
averageValueCount: t / e.length,
|
|
439
|
-
sumOfValueCountDiffs: n
|
|
440
|
-
};
|
|
441
|
-
}
|
|
442
|
-
function F(e) {
|
|
443
|
-
let t = /* @__PURE__ */ new Map();
|
|
444
|
-
for (let n of e) t.set(n.length, (t.get(n.length) ?? 0) + 1);
|
|
445
|
-
let [n = 0, r = 0] = [...t].toSorted((e, t) => t[1] - e[1])[0] ?? [];
|
|
446
|
-
return n > 1 && r * 2 > e.length;
|
|
447
|
-
}
|
|
448
|
-
y(["list"]), { ...E }, y([
|
|
449
|
-
"list",
|
|
450
|
-
"render",
|
|
451
|
-
"setColorMode"
|
|
452
|
-
]), { ...E };
|
|
453
|
-
var I = {
|
|
400
|
+
]), { ...D };
|
|
401
|
+
var O = {
|
|
402
|
+
"armscii-8": {
|
|
403
|
+
id: "armscii-8",
|
|
404
|
+
groupId: "armenian",
|
|
405
|
+
isDetectable: !1,
|
|
406
|
+
textDecoderId: null,
|
|
407
|
+
iconvLiteDecoderId: "armscii8"
|
|
408
|
+
},
|
|
454
409
|
ascii: {
|
|
455
410
|
id: "ascii",
|
|
456
411
|
groupId: null,
|
|
457
|
-
|
|
412
|
+
isDetectable: !0,
|
|
413
|
+
textDecoderId: "windows-1252",
|
|
414
|
+
iconvLiteDecoderId: "ascii"
|
|
458
415
|
},
|
|
459
416
|
big5: {
|
|
460
417
|
id: "big5",
|
|
461
418
|
groupId: "chineseTraditional",
|
|
462
|
-
|
|
419
|
+
isDetectable: !0,
|
|
420
|
+
textDecoderId: "big5",
|
|
421
|
+
iconvLiteDecoderId: "big5hkscs"
|
|
422
|
+
},
|
|
423
|
+
"cesu-8": {
|
|
424
|
+
id: "cesu-8",
|
|
425
|
+
groupId: "unicode",
|
|
426
|
+
isDetectable: !1,
|
|
427
|
+
textDecoderId: null,
|
|
428
|
+
iconvLiteDecoderId: "cesu8"
|
|
463
429
|
},
|
|
464
430
|
cp273: {
|
|
465
431
|
id: "cp273",
|
|
466
432
|
groupId: "western",
|
|
467
|
-
|
|
433
|
+
isDetectable: !0,
|
|
434
|
+
textDecoderId: null,
|
|
435
|
+
iconvLiteDecoderId: null
|
|
468
436
|
},
|
|
469
437
|
cp424: {
|
|
470
438
|
id: "cp424",
|
|
471
439
|
groupId: "hebrew",
|
|
472
|
-
|
|
440
|
+
isDetectable: !0,
|
|
441
|
+
textDecoderId: null,
|
|
442
|
+
iconvLiteDecoderId: null
|
|
473
443
|
},
|
|
474
444
|
cp437: {
|
|
475
445
|
id: "cp437",
|
|
476
446
|
groupId: "western",
|
|
477
|
-
|
|
447
|
+
isDetectable: !0,
|
|
448
|
+
textDecoderId: null,
|
|
449
|
+
iconvLiteDecoderId: "cp437"
|
|
478
450
|
},
|
|
479
451
|
cp500: {
|
|
480
452
|
id: "cp500",
|
|
481
453
|
groupId: "western",
|
|
482
|
-
|
|
454
|
+
isDetectable: !0,
|
|
455
|
+
textDecoderId: null,
|
|
456
|
+
iconvLiteDecoderId: null
|
|
483
457
|
},
|
|
484
458
|
cp720: {
|
|
485
459
|
id: "cp720",
|
|
486
460
|
groupId: "arabic",
|
|
487
|
-
|
|
461
|
+
isDetectable: !0,
|
|
462
|
+
textDecoderId: null,
|
|
463
|
+
iconvLiteDecoderId: "cp720"
|
|
488
464
|
},
|
|
489
465
|
cp737: {
|
|
490
466
|
id: "cp737",
|
|
491
467
|
groupId: "greek",
|
|
492
|
-
|
|
468
|
+
isDetectable: !0,
|
|
469
|
+
textDecoderId: null,
|
|
470
|
+
iconvLiteDecoderId: "cp737"
|
|
493
471
|
},
|
|
494
472
|
cp775: {
|
|
495
473
|
id: "cp775",
|
|
496
474
|
groupId: "baltic",
|
|
497
|
-
|
|
475
|
+
isDetectable: !0,
|
|
476
|
+
textDecoderId: null,
|
|
477
|
+
iconvLiteDecoderId: "cp775"
|
|
478
|
+
},
|
|
479
|
+
cp808: {
|
|
480
|
+
id: "cp808",
|
|
481
|
+
groupId: "cyrillic",
|
|
482
|
+
isDetectable: !1,
|
|
483
|
+
textDecoderId: null,
|
|
484
|
+
iconvLiteDecoderId: "cp808"
|
|
498
485
|
},
|
|
499
486
|
cp850: {
|
|
500
487
|
id: "cp850",
|
|
501
488
|
groupId: "western",
|
|
502
|
-
|
|
489
|
+
isDetectable: !0,
|
|
490
|
+
textDecoderId: null,
|
|
491
|
+
iconvLiteDecoderId: "cp850"
|
|
503
492
|
},
|
|
504
493
|
cp852: {
|
|
505
494
|
id: "cp852",
|
|
506
495
|
groupId: "centralEuropean",
|
|
507
|
-
|
|
496
|
+
isDetectable: !0,
|
|
497
|
+
textDecoderId: null,
|
|
498
|
+
iconvLiteDecoderId: "cp852"
|
|
508
499
|
},
|
|
509
500
|
cp856: {
|
|
510
501
|
id: "cp856",
|
|
511
502
|
groupId: "hebrew",
|
|
512
|
-
|
|
503
|
+
isDetectable: !0,
|
|
504
|
+
textDecoderId: null,
|
|
505
|
+
iconvLiteDecoderId: "cp856"
|
|
513
506
|
},
|
|
514
507
|
cp857: {
|
|
515
508
|
id: "cp857",
|
|
516
509
|
groupId: "turkish",
|
|
517
|
-
|
|
510
|
+
isDetectable: !0,
|
|
511
|
+
textDecoderId: null,
|
|
512
|
+
iconvLiteDecoderId: "cp857"
|
|
518
513
|
},
|
|
519
514
|
cp858: {
|
|
520
515
|
id: "cp858",
|
|
521
516
|
groupId: "western",
|
|
522
|
-
|
|
517
|
+
isDetectable: !0,
|
|
518
|
+
textDecoderId: null,
|
|
519
|
+
iconvLiteDecoderId: "cp858"
|
|
523
520
|
},
|
|
524
521
|
cp860: {
|
|
525
522
|
id: "cp860",
|
|
526
523
|
groupId: "western",
|
|
527
|
-
|
|
524
|
+
isDetectable: !0,
|
|
525
|
+
textDecoderId: null,
|
|
526
|
+
iconvLiteDecoderId: "cp860"
|
|
528
527
|
},
|
|
529
528
|
cp861: {
|
|
530
529
|
id: "cp861",
|
|
531
530
|
groupId: "nordic",
|
|
532
|
-
|
|
531
|
+
isDetectable: !0,
|
|
532
|
+
textDecoderId: null,
|
|
533
|
+
iconvLiteDecoderId: "cp861"
|
|
533
534
|
},
|
|
534
535
|
cp862: {
|
|
535
536
|
id: "cp862",
|
|
536
537
|
groupId: "hebrew",
|
|
537
|
-
|
|
538
|
+
isDetectable: !0,
|
|
539
|
+
textDecoderId: null,
|
|
540
|
+
iconvLiteDecoderId: "cp862"
|
|
538
541
|
},
|
|
539
542
|
cp863: {
|
|
540
543
|
id: "cp863",
|
|
541
544
|
groupId: "western",
|
|
542
|
-
|
|
545
|
+
isDetectable: !0,
|
|
546
|
+
textDecoderId: null,
|
|
547
|
+
iconvLiteDecoderId: "cp863"
|
|
543
548
|
},
|
|
544
549
|
cp864: {
|
|
545
550
|
id: "cp864",
|
|
546
551
|
groupId: "arabic",
|
|
547
|
-
|
|
552
|
+
isDetectable: !0,
|
|
553
|
+
textDecoderId: null,
|
|
554
|
+
iconvLiteDecoderId: "cp864"
|
|
548
555
|
},
|
|
549
556
|
cp865: {
|
|
550
557
|
id: "cp865",
|
|
551
558
|
groupId: "nordic",
|
|
552
|
-
|
|
559
|
+
isDetectable: !0,
|
|
560
|
+
textDecoderId: null,
|
|
561
|
+
iconvLiteDecoderId: "cp865"
|
|
553
562
|
},
|
|
554
563
|
cp869: {
|
|
555
564
|
id: "cp869",
|
|
556
565
|
groupId: "greek",
|
|
557
|
-
|
|
566
|
+
isDetectable: !0,
|
|
567
|
+
textDecoderId: null,
|
|
568
|
+
iconvLiteDecoderId: "cp869"
|
|
558
569
|
},
|
|
559
570
|
cp874: {
|
|
560
571
|
id: "cp874",
|
|
561
572
|
groupId: "thai",
|
|
562
|
-
|
|
573
|
+
isDetectable: !0,
|
|
574
|
+
textDecoderId: "windows-874",
|
|
575
|
+
iconvLiteDecoderId: "windows874"
|
|
563
576
|
},
|
|
564
577
|
cp875: {
|
|
565
578
|
id: "cp875",
|
|
566
579
|
groupId: "greek",
|
|
567
|
-
|
|
580
|
+
isDetectable: !0,
|
|
581
|
+
textDecoderId: null,
|
|
582
|
+
iconvLiteDecoderId: null
|
|
583
|
+
},
|
|
584
|
+
cp922: {
|
|
585
|
+
id: "cp922",
|
|
586
|
+
groupId: "baltic",
|
|
587
|
+
isDetectable: !1,
|
|
588
|
+
textDecoderId: null,
|
|
589
|
+
iconvLiteDecoderId: "cp922"
|
|
568
590
|
},
|
|
569
591
|
cp932: {
|
|
570
592
|
id: "cp932",
|
|
571
593
|
groupId: "japanese",
|
|
572
|
-
|
|
594
|
+
isDetectable: !0,
|
|
595
|
+
textDecoderId: "shift_jis",
|
|
596
|
+
iconvLiteDecoderId: "shiftjis"
|
|
597
|
+
},
|
|
598
|
+
cp936: {
|
|
599
|
+
id: "cp936",
|
|
600
|
+
groupId: "chineseSimplified",
|
|
601
|
+
isDetectable: !1,
|
|
602
|
+
textDecoderId: null,
|
|
603
|
+
iconvLiteDecoderId: "cp936"
|
|
573
604
|
},
|
|
574
605
|
cp949: {
|
|
575
606
|
id: "cp949",
|
|
576
607
|
groupId: "korean",
|
|
577
|
-
|
|
608
|
+
isDetectable: !0,
|
|
609
|
+
textDecoderId: "euc-kr",
|
|
610
|
+
iconvLiteDecoderId: "cp949"
|
|
611
|
+
},
|
|
612
|
+
cp950: {
|
|
613
|
+
id: "cp950",
|
|
614
|
+
groupId: "chineseTraditional",
|
|
615
|
+
isDetectable: !1,
|
|
616
|
+
textDecoderId: null,
|
|
617
|
+
iconvLiteDecoderId: "cp950"
|
|
578
618
|
},
|
|
579
619
|
cp1006: {
|
|
580
620
|
id: "cp1006",
|
|
581
621
|
groupId: "arabic",
|
|
582
|
-
|
|
622
|
+
isDetectable: !0,
|
|
623
|
+
textDecoderId: null,
|
|
624
|
+
iconvLiteDecoderId: null
|
|
583
625
|
},
|
|
584
626
|
cp1026: {
|
|
585
627
|
id: "cp1026",
|
|
586
628
|
groupId: "turkish",
|
|
587
|
-
|
|
629
|
+
isDetectable: !0,
|
|
630
|
+
textDecoderId: null,
|
|
631
|
+
iconvLiteDecoderId: null
|
|
632
|
+
},
|
|
633
|
+
cp1046: {
|
|
634
|
+
id: "cp1046",
|
|
635
|
+
groupId: "arabic",
|
|
636
|
+
isDetectable: !1,
|
|
637
|
+
textDecoderId: null,
|
|
638
|
+
iconvLiteDecoderId: "cp1046"
|
|
639
|
+
},
|
|
640
|
+
cp1124: {
|
|
641
|
+
id: "cp1124",
|
|
642
|
+
groupId: "cyrillic",
|
|
643
|
+
isDetectable: !1,
|
|
644
|
+
textDecoderId: null,
|
|
645
|
+
iconvLiteDecoderId: "cp1124"
|
|
588
646
|
},
|
|
589
647
|
cp1125: {
|
|
590
648
|
id: "cp1125",
|
|
591
649
|
groupId: "cyrillic",
|
|
592
|
-
|
|
650
|
+
isDetectable: !0,
|
|
651
|
+
textDecoderId: null,
|
|
652
|
+
iconvLiteDecoderId: "cp1125"
|
|
653
|
+
},
|
|
654
|
+
cp1129: {
|
|
655
|
+
id: "cp1129",
|
|
656
|
+
groupId: "vietnamese",
|
|
657
|
+
isDetectable: !1,
|
|
658
|
+
textDecoderId: null,
|
|
659
|
+
iconvLiteDecoderId: "cp1129"
|
|
660
|
+
},
|
|
661
|
+
cp1133: {
|
|
662
|
+
id: "cp1133",
|
|
663
|
+
groupId: "lao",
|
|
664
|
+
isDetectable: !1,
|
|
665
|
+
textDecoderId: null,
|
|
666
|
+
iconvLiteDecoderId: "cp1133"
|
|
593
667
|
},
|
|
594
668
|
cp1140: {
|
|
595
669
|
id: "cp1140",
|
|
596
670
|
groupId: "western",
|
|
597
|
-
|
|
671
|
+
isDetectable: !0,
|
|
672
|
+
textDecoderId: null,
|
|
673
|
+
iconvLiteDecoderId: null
|
|
674
|
+
},
|
|
675
|
+
cp1161: {
|
|
676
|
+
id: "cp1161",
|
|
677
|
+
groupId: "thai",
|
|
678
|
+
isDetectable: !1,
|
|
679
|
+
textDecoderId: null,
|
|
680
|
+
iconvLiteDecoderId: "cp1161"
|
|
681
|
+
},
|
|
682
|
+
cp1162: {
|
|
683
|
+
id: "cp1162",
|
|
684
|
+
groupId: "thai",
|
|
685
|
+
isDetectable: !1,
|
|
686
|
+
textDecoderId: null,
|
|
687
|
+
iconvLiteDecoderId: "cp1162"
|
|
688
|
+
},
|
|
689
|
+
cp1163: {
|
|
690
|
+
id: "cp1163",
|
|
691
|
+
groupId: "vietnamese",
|
|
692
|
+
isDetectable: !1,
|
|
693
|
+
textDecoderId: null,
|
|
694
|
+
iconvLiteDecoderId: "cp1163"
|
|
598
695
|
},
|
|
599
696
|
cp1258: {
|
|
600
697
|
id: "cp1258",
|
|
601
698
|
groupId: "vietnamese",
|
|
602
|
-
|
|
699
|
+
isDetectable: !0,
|
|
700
|
+
textDecoderId: "windows-1258",
|
|
701
|
+
iconvLiteDecoderId: "windows1258"
|
|
603
702
|
},
|
|
604
703
|
"euc-jp": {
|
|
605
704
|
id: "euc-jp",
|
|
606
705
|
groupId: "japanese",
|
|
607
|
-
|
|
706
|
+
isDetectable: !0,
|
|
707
|
+
textDecoderId: "euc-jp",
|
|
708
|
+
iconvLiteDecoderId: "eucjp"
|
|
608
709
|
},
|
|
609
710
|
"euc-kr": {
|
|
610
711
|
id: "euc-kr",
|
|
611
712
|
groupId: "korean",
|
|
612
|
-
|
|
713
|
+
isDetectable: !0,
|
|
714
|
+
textDecoderId: "euc-kr",
|
|
715
|
+
iconvLiteDecoderId: "cp949"
|
|
613
716
|
},
|
|
614
717
|
gb18030: {
|
|
615
718
|
id: "gb18030",
|
|
616
719
|
groupId: "chineseSimplified",
|
|
617
|
-
|
|
720
|
+
isDetectable: !0,
|
|
721
|
+
textDecoderId: "gb18030",
|
|
722
|
+
iconvLiteDecoderId: "gb18030"
|
|
723
|
+
},
|
|
724
|
+
gbk: {
|
|
725
|
+
id: "gbk",
|
|
726
|
+
groupId: "chineseSimplified",
|
|
727
|
+
isDetectable: !1,
|
|
728
|
+
textDecoderId: "gbk",
|
|
729
|
+
iconvLiteDecoderId: "gbk"
|
|
730
|
+
},
|
|
731
|
+
"georgian-academy": {
|
|
732
|
+
id: "georgian-academy",
|
|
733
|
+
groupId: "georgian",
|
|
734
|
+
isDetectable: !1,
|
|
735
|
+
textDecoderId: null,
|
|
736
|
+
iconvLiteDecoderId: "georgianacademy"
|
|
737
|
+
},
|
|
738
|
+
"georgian-ps": {
|
|
739
|
+
id: "georgian-ps",
|
|
740
|
+
groupId: "georgian",
|
|
741
|
+
isDetectable: !1,
|
|
742
|
+
textDecoderId: null,
|
|
743
|
+
iconvLiteDecoderId: "georgianps"
|
|
618
744
|
},
|
|
619
745
|
"hp-roman8": {
|
|
620
746
|
id: "hp-roman8",
|
|
621
747
|
groupId: "western",
|
|
622
|
-
|
|
748
|
+
isDetectable: !0,
|
|
749
|
+
textDecoderId: null,
|
|
750
|
+
iconvLiteDecoderId: "hproman8"
|
|
623
751
|
},
|
|
624
752
|
"hz-gb-2312": {
|
|
625
753
|
id: "hz-gb-2312",
|
|
626
754
|
groupId: "chineseSimplified",
|
|
627
|
-
|
|
755
|
+
isDetectable: !0,
|
|
756
|
+
textDecoderId: null,
|
|
757
|
+
iconvLiteDecoderId: null
|
|
628
758
|
},
|
|
629
759
|
ibm855: {
|
|
630
760
|
id: "ibm855",
|
|
631
761
|
groupId: "cyrillic",
|
|
632
|
-
|
|
762
|
+
isDetectable: !0,
|
|
763
|
+
textDecoderId: null,
|
|
764
|
+
iconvLiteDecoderId: "cp855"
|
|
633
765
|
},
|
|
634
766
|
ibm866: {
|
|
635
767
|
id: "ibm866",
|
|
636
768
|
groupId: "cyrillic",
|
|
637
|
-
|
|
769
|
+
isDetectable: !0,
|
|
770
|
+
textDecoderId: "ibm866",
|
|
771
|
+
iconvLiteDecoderId: "cp866"
|
|
638
772
|
},
|
|
639
773
|
"iso-2022-jp": {
|
|
640
774
|
id: "iso-2022-jp",
|
|
641
775
|
groupId: "japanese",
|
|
642
|
-
|
|
776
|
+
isDetectable: !0,
|
|
777
|
+
textDecoderId: "iso-2022-jp",
|
|
778
|
+
iconvLiteDecoderId: null
|
|
643
779
|
},
|
|
644
780
|
"iso-2022-kr": {
|
|
645
781
|
id: "iso-2022-kr",
|
|
646
782
|
groupId: "korean",
|
|
647
|
-
|
|
783
|
+
isDetectable: !0,
|
|
784
|
+
textDecoderId: null,
|
|
785
|
+
iconvLiteDecoderId: null
|
|
648
786
|
},
|
|
649
787
|
"iso-8859-1": {
|
|
650
788
|
id: "iso-8859-1",
|
|
651
789
|
groupId: "western",
|
|
652
|
-
|
|
790
|
+
isDetectable: !0,
|
|
791
|
+
textDecoderId: "windows-1252",
|
|
792
|
+
iconvLiteDecoderId: "iso88591"
|
|
653
793
|
},
|
|
654
794
|
"iso-8859-2": {
|
|
655
795
|
id: "iso-8859-2",
|
|
656
796
|
groupId: "centralEuropean",
|
|
657
|
-
|
|
797
|
+
isDetectable: !0,
|
|
798
|
+
textDecoderId: "iso-8859-2",
|
|
799
|
+
iconvLiteDecoderId: "iso88592"
|
|
658
800
|
},
|
|
659
801
|
"iso-8859-5": {
|
|
660
802
|
id: "iso-8859-5",
|
|
661
803
|
groupId: "cyrillic",
|
|
662
|
-
|
|
804
|
+
isDetectable: !0,
|
|
805
|
+
textDecoderId: "iso-8859-5",
|
|
806
|
+
iconvLiteDecoderId: "iso88595"
|
|
663
807
|
},
|
|
664
808
|
"iso-8859-6": {
|
|
665
809
|
id: "iso-8859-6",
|
|
666
810
|
groupId: "arabic",
|
|
667
|
-
|
|
811
|
+
isDetectable: !0,
|
|
812
|
+
textDecoderId: "iso-8859-6",
|
|
813
|
+
iconvLiteDecoderId: "iso88596"
|
|
668
814
|
},
|
|
669
815
|
"iso-8859-7": {
|
|
670
816
|
id: "iso-8859-7",
|
|
671
817
|
groupId: "greek",
|
|
672
|
-
|
|
818
|
+
isDetectable: !0,
|
|
819
|
+
textDecoderId: "iso-8859-7",
|
|
820
|
+
iconvLiteDecoderId: "iso88597"
|
|
673
821
|
},
|
|
674
822
|
"iso-8859-8": {
|
|
675
823
|
id: "iso-8859-8",
|
|
676
824
|
groupId: "hebrew",
|
|
677
|
-
|
|
825
|
+
isDetectable: !0,
|
|
826
|
+
textDecoderId: "iso-8859-8-i",
|
|
827
|
+
iconvLiteDecoderId: "iso88598"
|
|
678
828
|
},
|
|
679
829
|
"iso-8859-9": {
|
|
680
830
|
id: "iso-8859-9",
|
|
681
831
|
groupId: "turkish",
|
|
682
|
-
|
|
832
|
+
isDetectable: !0,
|
|
833
|
+
textDecoderId: "windows-1254",
|
|
834
|
+
iconvLiteDecoderId: "iso88599"
|
|
835
|
+
},
|
|
836
|
+
"iso-8859-11": {
|
|
837
|
+
id: "iso-8859-11",
|
|
838
|
+
groupId: "thai",
|
|
839
|
+
isDetectable: !1,
|
|
840
|
+
textDecoderId: "windows-874",
|
|
841
|
+
iconvLiteDecoderId: "iso885911"
|
|
683
842
|
},
|
|
684
843
|
"iso-8859-13": {
|
|
685
844
|
id: "iso-8859-13",
|
|
686
845
|
groupId: "baltic",
|
|
687
|
-
|
|
846
|
+
isDetectable: !0,
|
|
847
|
+
textDecoderId: "iso-8859-13",
|
|
848
|
+
iconvLiteDecoderId: "iso885913"
|
|
849
|
+
},
|
|
850
|
+
"iso646-cn": {
|
|
851
|
+
id: "iso646-cn",
|
|
852
|
+
groupId: "chineseSimplified",
|
|
853
|
+
isDetectable: !1,
|
|
854
|
+
textDecoderId: null,
|
|
855
|
+
iconvLiteDecoderId: "iso646cn"
|
|
856
|
+
},
|
|
857
|
+
"iso646-jp": {
|
|
858
|
+
id: "iso646-jp",
|
|
859
|
+
groupId: "japanese",
|
|
860
|
+
isDetectable: !1,
|
|
861
|
+
textDecoderId: null,
|
|
862
|
+
iconvLiteDecoderId: "iso646jp"
|
|
688
863
|
},
|
|
689
864
|
iso2022_jp_2004: {
|
|
690
865
|
id: "iso2022_jp_2004",
|
|
691
866
|
groupId: "japanese",
|
|
692
|
-
|
|
867
|
+
isDetectable: !0,
|
|
868
|
+
textDecoderId: null,
|
|
869
|
+
iconvLiteDecoderId: null
|
|
693
870
|
},
|
|
694
871
|
iso2022_jp_ext: {
|
|
695
872
|
id: "iso2022_jp_ext",
|
|
696
873
|
groupId: "japanese",
|
|
697
|
-
|
|
874
|
+
isDetectable: !0,
|
|
875
|
+
textDecoderId: null,
|
|
876
|
+
iconvLiteDecoderId: null
|
|
698
877
|
},
|
|
699
878
|
"iso8859-3": {
|
|
700
879
|
id: "iso8859-3",
|
|
701
880
|
groupId: "southernEuropean",
|
|
702
|
-
|
|
881
|
+
isDetectable: !0,
|
|
882
|
+
textDecoderId: "iso-8859-3",
|
|
883
|
+
iconvLiteDecoderId: "iso88593"
|
|
703
884
|
},
|
|
704
885
|
"iso8859-4": {
|
|
705
886
|
id: "iso8859-4",
|
|
706
887
|
groupId: "baltic",
|
|
707
|
-
|
|
888
|
+
isDetectable: !0,
|
|
889
|
+
textDecoderId: "iso-8859-4",
|
|
890
|
+
iconvLiteDecoderId: "iso88594"
|
|
708
891
|
},
|
|
709
892
|
"iso8859-10": {
|
|
710
893
|
id: "iso8859-10",
|
|
711
894
|
groupId: "nordic",
|
|
712
|
-
|
|
895
|
+
isDetectable: !0,
|
|
896
|
+
textDecoderId: "iso-8859-10",
|
|
897
|
+
iconvLiteDecoderId: "iso885910"
|
|
713
898
|
},
|
|
714
899
|
"iso8859-14": {
|
|
715
900
|
id: "iso8859-14",
|
|
716
901
|
groupId: "celtic",
|
|
717
|
-
|
|
902
|
+
isDetectable: !0,
|
|
903
|
+
textDecoderId: "iso-8859-14",
|
|
904
|
+
iconvLiteDecoderId: "iso885914"
|
|
718
905
|
},
|
|
719
906
|
"iso8859-15": {
|
|
720
907
|
id: "iso8859-15",
|
|
721
908
|
groupId: "western",
|
|
722
|
-
|
|
909
|
+
isDetectable: !0,
|
|
910
|
+
textDecoderId: "iso-8859-15",
|
|
911
|
+
iconvLiteDecoderId: "iso885915"
|
|
723
912
|
},
|
|
724
913
|
"iso8859-16": {
|
|
725
914
|
id: "iso8859-16",
|
|
726
|
-
groupId: "
|
|
727
|
-
|
|
915
|
+
groupId: "southEasternEuropean",
|
|
916
|
+
isDetectable: !0,
|
|
917
|
+
textDecoderId: "iso-8859-16",
|
|
918
|
+
iconvLiteDecoderId: "iso885916"
|
|
728
919
|
},
|
|
729
920
|
johab: {
|
|
730
921
|
id: "johab",
|
|
731
922
|
groupId: "korean",
|
|
732
|
-
|
|
923
|
+
isDetectable: !0,
|
|
924
|
+
textDecoderId: null,
|
|
925
|
+
iconvLiteDecoderId: null
|
|
733
926
|
},
|
|
734
927
|
"koi8-r": {
|
|
735
928
|
id: "koi8-r",
|
|
736
929
|
groupId: "cyrillic",
|
|
737
|
-
|
|
930
|
+
isDetectable: !0,
|
|
931
|
+
textDecoderId: "koi8-r",
|
|
932
|
+
iconvLiteDecoderId: "koi8r"
|
|
933
|
+
},
|
|
934
|
+
"koi8-ru": {
|
|
935
|
+
id: "koi8-ru",
|
|
936
|
+
groupId: "cyrillic",
|
|
937
|
+
isDetectable: !1,
|
|
938
|
+
textDecoderId: "koi8-u",
|
|
939
|
+
iconvLiteDecoderId: "koi8ru"
|
|
738
940
|
},
|
|
739
941
|
"koi8-t": {
|
|
740
942
|
id: "koi8-t",
|
|
741
943
|
groupId: "cyrillic",
|
|
742
|
-
|
|
944
|
+
isDetectable: !0,
|
|
945
|
+
textDecoderId: null,
|
|
946
|
+
iconvLiteDecoderId: "koi8t"
|
|
743
947
|
},
|
|
744
948
|
"koi8-u": {
|
|
745
949
|
id: "koi8-u",
|
|
746
950
|
groupId: "cyrillic",
|
|
747
|
-
|
|
951
|
+
isDetectable: !0,
|
|
952
|
+
textDecoderId: "koi8-u",
|
|
953
|
+
iconvLiteDecoderId: "koi8u"
|
|
748
954
|
},
|
|
749
955
|
kz1048: {
|
|
750
956
|
id: "kz1048",
|
|
751
957
|
groupId: "cyrillic",
|
|
752
|
-
|
|
958
|
+
isDetectable: !0,
|
|
959
|
+
textDecoderId: null,
|
|
960
|
+
iconvLiteDecoderId: "rk1048"
|
|
961
|
+
},
|
|
962
|
+
maccroatian: {
|
|
963
|
+
id: "maccroatian",
|
|
964
|
+
groupId: "centralEuropean",
|
|
965
|
+
isDetectable: !1,
|
|
966
|
+
textDecoderId: null,
|
|
967
|
+
iconvLiteDecoderId: "maccroatian"
|
|
753
968
|
},
|
|
754
969
|
maccyrillic: {
|
|
755
970
|
id: "maccyrillic",
|
|
756
971
|
groupId: "cyrillic",
|
|
757
|
-
|
|
972
|
+
isDetectable: !0,
|
|
973
|
+
textDecoderId: "x-mac-cyrillic",
|
|
974
|
+
iconvLiteDecoderId: "maccyrillic"
|
|
758
975
|
},
|
|
759
976
|
macgreek: {
|
|
760
977
|
id: "macgreek",
|
|
761
978
|
groupId: "greek",
|
|
762
|
-
|
|
979
|
+
isDetectable: !0,
|
|
980
|
+
textDecoderId: null,
|
|
981
|
+
iconvLiteDecoderId: "macgreek"
|
|
763
982
|
},
|
|
764
983
|
maciceland: {
|
|
765
984
|
id: "maciceland",
|
|
766
985
|
groupId: "nordic",
|
|
767
|
-
|
|
986
|
+
isDetectable: !0,
|
|
987
|
+
textDecoderId: null,
|
|
988
|
+
iconvLiteDecoderId: "maciceland"
|
|
768
989
|
},
|
|
769
990
|
maclatin2: {
|
|
770
991
|
id: "maclatin2",
|
|
771
992
|
groupId: "centralEuropean",
|
|
772
|
-
|
|
993
|
+
isDetectable: !0,
|
|
994
|
+
textDecoderId: null,
|
|
995
|
+
iconvLiteDecoderId: "maccenteuro"
|
|
773
996
|
},
|
|
774
997
|
macroman: {
|
|
775
998
|
id: "macroman",
|
|
776
999
|
groupId: "western",
|
|
777
|
-
|
|
1000
|
+
isDetectable: !0,
|
|
1001
|
+
textDecoderId: "macintosh",
|
|
1002
|
+
iconvLiteDecoderId: "macroman"
|
|
1003
|
+
},
|
|
1004
|
+
macromania: {
|
|
1005
|
+
id: "macromania",
|
|
1006
|
+
groupId: "southEasternEuropean",
|
|
1007
|
+
isDetectable: !1,
|
|
1008
|
+
textDecoderId: null,
|
|
1009
|
+
iconvLiteDecoderId: "macromania"
|
|
1010
|
+
},
|
|
1011
|
+
macthai: {
|
|
1012
|
+
id: "macthai",
|
|
1013
|
+
groupId: "thai",
|
|
1014
|
+
isDetectable: !1,
|
|
1015
|
+
textDecoderId: null,
|
|
1016
|
+
iconvLiteDecoderId: "macthai"
|
|
778
1017
|
},
|
|
779
1018
|
macturkish: {
|
|
780
1019
|
id: "macturkish",
|
|
781
1020
|
groupId: "turkish",
|
|
782
|
-
|
|
1021
|
+
isDetectable: !0,
|
|
1022
|
+
textDecoderId: null,
|
|
1023
|
+
iconvLiteDecoderId: "macturkish"
|
|
1024
|
+
},
|
|
1025
|
+
macukraine: {
|
|
1026
|
+
id: "macukraine",
|
|
1027
|
+
groupId: "cyrillic",
|
|
1028
|
+
isDetectable: !1,
|
|
1029
|
+
textDecoderId: null,
|
|
1030
|
+
iconvLiteDecoderId: "macukraine"
|
|
1031
|
+
},
|
|
1032
|
+
mik: {
|
|
1033
|
+
id: "mik",
|
|
1034
|
+
groupId: "cyrillic",
|
|
1035
|
+
isDetectable: !1,
|
|
1036
|
+
textDecoderId: null,
|
|
1037
|
+
iconvLiteDecoderId: "mik"
|
|
783
1038
|
},
|
|
784
1039
|
ptcp154: {
|
|
785
1040
|
id: "ptcp154",
|
|
786
1041
|
groupId: "cyrillic",
|
|
787
|
-
|
|
1042
|
+
isDetectable: !0,
|
|
1043
|
+
textDecoderId: null,
|
|
1044
|
+
iconvLiteDecoderId: "pt154"
|
|
788
1045
|
},
|
|
789
1046
|
shift_jis: {
|
|
790
1047
|
id: "shift_jis",
|
|
791
1048
|
groupId: "japanese",
|
|
792
|
-
|
|
1049
|
+
isDetectable: !0,
|
|
1050
|
+
textDecoderId: "shift_jis",
|
|
1051
|
+
iconvLiteDecoderId: "shiftjis"
|
|
1052
|
+
},
|
|
1053
|
+
tcvn: {
|
|
1054
|
+
id: "tcvn",
|
|
1055
|
+
groupId: "vietnamese",
|
|
1056
|
+
isDetectable: !1,
|
|
1057
|
+
textDecoderId: null,
|
|
1058
|
+
iconvLiteDecoderId: "tcvn"
|
|
793
1059
|
},
|
|
794
1060
|
"tis-620": {
|
|
795
1061
|
id: "tis-620",
|
|
796
1062
|
groupId: "thai",
|
|
797
|
-
|
|
1063
|
+
isDetectable: !0,
|
|
1064
|
+
textDecoderId: "windows-874",
|
|
1065
|
+
iconvLiteDecoderId: "tis620"
|
|
798
1066
|
},
|
|
799
1067
|
"utf-7": {
|
|
800
1068
|
id: "utf-7",
|
|
801
|
-
groupId: "
|
|
802
|
-
|
|
1069
|
+
groupId: "unicode",
|
|
1070
|
+
isDetectable: !0,
|
|
1071
|
+
textDecoderId: null,
|
|
1072
|
+
iconvLiteDecoderId: "utf7"
|
|
803
1073
|
},
|
|
804
1074
|
"utf-8": {
|
|
805
1075
|
id: "utf-8",
|
|
806
|
-
groupId:
|
|
807
|
-
|
|
1076
|
+
groupId: "unicode",
|
|
1077
|
+
isDetectable: !0,
|
|
1078
|
+
textDecoderId: "utf-8",
|
|
1079
|
+
iconvLiteDecoderId: "utf-8"
|
|
808
1080
|
},
|
|
809
1081
|
"utf-8-sig": {
|
|
810
1082
|
id: "utf-8-sig",
|
|
811
|
-
groupId:
|
|
812
|
-
|
|
1083
|
+
groupId: "unicode",
|
|
1084
|
+
isDetectable: !0,
|
|
1085
|
+
textDecoderId: "utf-8",
|
|
1086
|
+
iconvLiteDecoderId: "utf-8"
|
|
813
1087
|
},
|
|
814
1088
|
"utf-16": {
|
|
815
1089
|
id: "utf-16",
|
|
816
|
-
groupId: "
|
|
817
|
-
|
|
1090
|
+
groupId: "unicode",
|
|
1091
|
+
isDetectable: !0,
|
|
1092
|
+
textDecoderId: null,
|
|
1093
|
+
iconvLiteDecoderId: "utf16"
|
|
818
1094
|
},
|
|
819
1095
|
"utf-16-be": {
|
|
820
1096
|
id: "utf-16-be",
|
|
821
|
-
groupId: "
|
|
822
|
-
|
|
1097
|
+
groupId: "unicode",
|
|
1098
|
+
isDetectable: !0,
|
|
1099
|
+
textDecoderId: "utf-16be",
|
|
1100
|
+
iconvLiteDecoderId: "utf16be"
|
|
823
1101
|
},
|
|
824
1102
|
"utf-16-le": {
|
|
825
1103
|
id: "utf-16-le",
|
|
826
|
-
groupId: "
|
|
827
|
-
|
|
1104
|
+
groupId: "unicode",
|
|
1105
|
+
isDetectable: !0,
|
|
1106
|
+
textDecoderId: "utf-16le",
|
|
1107
|
+
iconvLiteDecoderId: "utf16le"
|
|
828
1108
|
},
|
|
829
1109
|
"utf-32": {
|
|
830
1110
|
id: "utf-32",
|
|
831
|
-
groupId: "
|
|
832
|
-
|
|
1111
|
+
groupId: "unicode",
|
|
1112
|
+
isDetectable: !0,
|
|
1113
|
+
textDecoderId: null,
|
|
1114
|
+
iconvLiteDecoderId: "utf32"
|
|
833
1115
|
},
|
|
834
1116
|
"utf-32-be": {
|
|
835
1117
|
id: "utf-32-be",
|
|
836
|
-
groupId: "
|
|
837
|
-
|
|
1118
|
+
groupId: "unicode",
|
|
1119
|
+
isDetectable: !0,
|
|
1120
|
+
textDecoderId: null,
|
|
1121
|
+
iconvLiteDecoderId: "utf32be"
|
|
838
1122
|
},
|
|
839
1123
|
"utf-32-le": {
|
|
840
1124
|
id: "utf-32-le",
|
|
841
|
-
groupId: "
|
|
842
|
-
|
|
1125
|
+
groupId: "unicode",
|
|
1126
|
+
isDetectable: !0,
|
|
1127
|
+
textDecoderId: null,
|
|
1128
|
+
iconvLiteDecoderId: "utf32le"
|
|
1129
|
+
},
|
|
1130
|
+
viscii: {
|
|
1131
|
+
id: "viscii",
|
|
1132
|
+
groupId: "vietnamese",
|
|
1133
|
+
isDetectable: !1,
|
|
1134
|
+
textDecoderId: null,
|
|
1135
|
+
iconvLiteDecoderId: "viscii"
|
|
843
1136
|
},
|
|
844
1137
|
"windows-1250": {
|
|
845
1138
|
id: "windows-1250",
|
|
846
1139
|
groupId: "centralEuropean",
|
|
847
|
-
|
|
1140
|
+
isDetectable: !0,
|
|
1141
|
+
textDecoderId: "windows-1250",
|
|
1142
|
+
iconvLiteDecoderId: "windows1250"
|
|
848
1143
|
},
|
|
849
1144
|
"windows-1251": {
|
|
850
1145
|
id: "windows-1251",
|
|
851
1146
|
groupId: "cyrillic",
|
|
852
|
-
|
|
1147
|
+
isDetectable: !0,
|
|
1148
|
+
textDecoderId: "windows-1251",
|
|
1149
|
+
iconvLiteDecoderId: "windows1251"
|
|
853
1150
|
},
|
|
854
1151
|
"windows-1252": {
|
|
855
1152
|
id: "windows-1252",
|
|
856
1153
|
groupId: "western",
|
|
857
|
-
|
|
1154
|
+
isDetectable: !0,
|
|
1155
|
+
textDecoderId: "windows-1252",
|
|
1156
|
+
iconvLiteDecoderId: "windows1252"
|
|
858
1157
|
},
|
|
859
1158
|
"windows-1253": {
|
|
860
1159
|
id: "windows-1253",
|
|
861
1160
|
groupId: "greek",
|
|
862
|
-
|
|
1161
|
+
isDetectable: !0,
|
|
1162
|
+
textDecoderId: "windows-1253",
|
|
1163
|
+
iconvLiteDecoderId: "windows1253"
|
|
863
1164
|
},
|
|
864
1165
|
"windows-1254": {
|
|
865
1166
|
id: "windows-1254",
|
|
866
1167
|
groupId: "turkish",
|
|
867
|
-
|
|
1168
|
+
isDetectable: !0,
|
|
1169
|
+
textDecoderId: "windows-1254",
|
|
1170
|
+
iconvLiteDecoderId: "windows1254"
|
|
868
1171
|
},
|
|
869
1172
|
"windows-1255": {
|
|
870
1173
|
id: "windows-1255",
|
|
871
1174
|
groupId: "hebrew",
|
|
872
|
-
|
|
1175
|
+
isDetectable: !0,
|
|
1176
|
+
textDecoderId: "windows-1255",
|
|
1177
|
+
iconvLiteDecoderId: "windows1255"
|
|
873
1178
|
},
|
|
874
1179
|
"windows-1256": {
|
|
875
1180
|
id: "windows-1256",
|
|
876
1181
|
groupId: "arabic",
|
|
877
|
-
|
|
1182
|
+
isDetectable: !0,
|
|
1183
|
+
textDecoderId: "windows-1256",
|
|
1184
|
+
iconvLiteDecoderId: "windows1256"
|
|
878
1185
|
},
|
|
879
1186
|
"windows-1257": {
|
|
880
1187
|
id: "windows-1257",
|
|
881
1188
|
groupId: "baltic",
|
|
882
|
-
|
|
1189
|
+
isDetectable: !0,
|
|
1190
|
+
textDecoderId: "windows-1257",
|
|
1191
|
+
iconvLiteDecoderId: "windows1257"
|
|
883
1192
|
}
|
|
884
1193
|
};
|
|
885
|
-
function
|
|
886
|
-
return Object.hasOwn(
|
|
1194
|
+
function k(e) {
|
|
1195
|
+
return Object.hasOwn(O, e);
|
|
1196
|
+
}
|
|
1197
|
+
function A(e) {
|
|
1198
|
+
return k(e) ? O[e].textDecoderId ?? e : e;
|
|
1199
|
+
}
|
|
1200
|
+
var j = class extends Error {
|
|
1201
|
+
data;
|
|
1202
|
+
locator;
|
|
1203
|
+
constructor(e, t, n, r) {
|
|
1204
|
+
super(e, r), this.name = "DPUseError", this.data = n, this.locator = t;
|
|
1205
|
+
}
|
|
1206
|
+
}, M = class extends j {
|
|
1207
|
+
constructor(e, t, n, r) {
|
|
1208
|
+
super(e, t, n, r), this.name = "ConnectorError";
|
|
1209
|
+
}
|
|
1210
|
+
};
|
|
1211
|
+
function N(e) {
|
|
1212
|
+
try {
|
|
1213
|
+
e();
|
|
1214
|
+
} catch {}
|
|
1215
|
+
}
|
|
1216
|
+
v([
|
|
1217
|
+
"arrow",
|
|
1218
|
+
"avro",
|
|
1219
|
+
"dtv",
|
|
1220
|
+
"json",
|
|
1221
|
+
"jsonl",
|
|
1222
|
+
"markdown",
|
|
1223
|
+
"ods",
|
|
1224
|
+
"parquet",
|
|
1225
|
+
"sav",
|
|
1226
|
+
"sqlite",
|
|
1227
|
+
"xlsx",
|
|
1228
|
+
"xml"
|
|
1229
|
+
]), { ...D };
|
|
1230
|
+
async function P(e, t, n) {
|
|
1231
|
+
let r = F(e), { issues: i, parsedRecords: a, valueDelimiterId: o } = await I(e, t.valueDelimiterIds, t.isComplete, n);
|
|
1232
|
+
return {
|
|
1233
|
+
issues: i,
|
|
1234
|
+
parsedRecords: a,
|
|
1235
|
+
recordDelimiterId: r,
|
|
1236
|
+
valueDelimiterId: o
|
|
1237
|
+
};
|
|
1238
|
+
}
|
|
1239
|
+
function F(e) {
|
|
1240
|
+
let t = (e.match(/\r\n/g) ?? []).length, n = (e.match(/(?<!\r)\n/g) ?? []).length, r = (e.match(/\r(?!\n)/g) ?? []).length;
|
|
1241
|
+
return t >= n && t >= r ? "\r\n" : n >= t && n >= r ? "\n" : r >= t && r >= n ? "\r" : "\n";
|
|
1242
|
+
}
|
|
1243
|
+
async function I(e, t, n, r) {
|
|
1244
|
+
let i, a, o, s = [], c, l = !1;
|
|
1245
|
+
for (let u of t) {
|
|
1246
|
+
let { issues: t, records: d } = await r(e, u, n);
|
|
1247
|
+
if (t.length > 0) {
|
|
1248
|
+
c = L(c, {
|
|
1249
|
+
delimiter: u,
|
|
1250
|
+
issues: t,
|
|
1251
|
+
records: d
|
|
1252
|
+
});
|
|
1253
|
+
continue;
|
|
1254
|
+
}
|
|
1255
|
+
if (l = !0, d.length === 0) continue;
|
|
1256
|
+
let { averageValueCount: f, sumOfValueCountDiffs: p } = R(d);
|
|
1257
|
+
(a === void 0 || a <= 1 || p <= (o ?? 0)) && (a === void 0 || f > a) && (i = u, a = f, o = p, s = d);
|
|
1258
|
+
}
|
|
1259
|
+
if (!l && c != null) {
|
|
1260
|
+
let { delimiter: e, issues: t, records: n } = c;
|
|
1261
|
+
return {
|
|
1262
|
+
issues: t,
|
|
1263
|
+
parsedRecords: n,
|
|
1264
|
+
valueDelimiterId: z(n) ? e : void 0
|
|
1265
|
+
};
|
|
1266
|
+
}
|
|
1267
|
+
return {
|
|
1268
|
+
issues: [],
|
|
1269
|
+
parsedRecords: s,
|
|
1270
|
+
valueDelimiterId: i != null && z(s) ? i : void 0
|
|
1271
|
+
};
|
|
1272
|
+
}
|
|
1273
|
+
function L(e, t) {
|
|
1274
|
+
return e == null || t.issues.length < e.issues.length ? t : e;
|
|
887
1275
|
}
|
|
888
1276
|
function R(e) {
|
|
889
|
-
|
|
1277
|
+
let t = 0, n = 0, r;
|
|
1278
|
+
for (let i of e) r != null && (n += Math.abs(i.length - r)), r = i.length, t += i.length;
|
|
1279
|
+
return {
|
|
1280
|
+
averageValueCount: t / e.length,
|
|
1281
|
+
sumOfValueCountDiffs: n
|
|
1282
|
+
};
|
|
1283
|
+
}
|
|
1284
|
+
function z(e) {
|
|
1285
|
+
let t = /* @__PURE__ */ new Map();
|
|
1286
|
+
for (let n of e) t.set(n.length, (t.get(n.length) ?? 0) + 1);
|
|
1287
|
+
let [n = 0, r = 0] = [...t].toSorted((e, t) => t[1] - e[1])[0] ?? [];
|
|
1288
|
+
return n > 1 && r * 2 > e.length;
|
|
890
1289
|
}
|
|
1290
|
+
v(["list"]), { ...D }, v([
|
|
1291
|
+
"list",
|
|
1292
|
+
"render",
|
|
1293
|
+
"setColorMode"
|
|
1294
|
+
]), { ...D };
|
|
891
1295
|
// src/index.ts
|
|
892
|
-
var
|
|
1296
|
+
var B = {
|
|
893
1297
|
id: "rust-csv-core",
|
|
894
1298
|
name: "Rust CSV Core",
|
|
895
1299
|
version: "0.1.0"
|
|
896
|
-
},
|
|
897
|
-
config =
|
|
1300
|
+
}, V = 1e4, H = 1048576, U = { rustBindingsPromise: void 0 }, W = class {
|
|
1301
|
+
config = B;
|
|
898
1302
|
async parseStream(e, t, n) {
|
|
899
|
-
let { RecordReader: r } = await
|
|
1303
|
+
let { RecordReader: r } = await J();
|
|
900
1304
|
t.abortSignal.throwIfAborted();
|
|
901
|
-
let i = new r(
|
|
902
|
-
|
|
1305
|
+
let i = new r(G(t.valueDelimiterId)), a = K(t.encodingId), o = Math.max(1, Math.floor(t.chunkSize ?? V)), s = e.getReader(), c = () => {
|
|
1306
|
+
N(() => void s.cancel(t.abortSignal.reason));
|
|
903
1307
|
};
|
|
904
1308
|
t.abortSignal.addEventListener("abort", c, { once: !0 });
|
|
905
1309
|
let l = [], u = async (e) => {
|
|
906
|
-
for (let t of
|
|
1310
|
+
for (let t of q(e)) {
|
|
907
1311
|
if (l.push(t), l.length < o) continue;
|
|
908
1312
|
let e = l;
|
|
909
1313
|
l = [], await n("parsingRecordArray", e);
|
|
@@ -914,7 +1318,7 @@ var z = {
|
|
|
914
1318
|
for (; !e.done;) {
|
|
915
1319
|
t.abortSignal.throwIfAborted();
|
|
916
1320
|
let n = a == null ? e.value : a.transcode(e.value);
|
|
917
|
-
for (let e = 0; e < n.length; e +=
|
|
1321
|
+
for (let e = 0; e < n.length; e += H) await u(i.pushChunk(n.subarray(e, e + H)));
|
|
918
1322
|
e = await s.read();
|
|
919
1323
|
}
|
|
920
1324
|
return t.abortSignal.throwIfAborted(), a != null && await u(i.pushChunk(a.finish())), await u(i.finish()), l.length > 0 && await n("parsingRecordArray", l), {
|
|
@@ -930,12 +1334,12 @@ var z = {
|
|
|
930
1334
|
}
|
|
931
1335
|
}
|
|
932
1336
|
async parseText(e, t) {
|
|
933
|
-
let { RecordReader: n } = await
|
|
934
|
-
return await
|
|
935
|
-
let r = new n(
|
|
1337
|
+
let { RecordReader: n } = await J();
|
|
1338
|
+
return await P(e, t, (e, t) => {
|
|
1339
|
+
let r = new n(G(t));
|
|
936
1340
|
try {
|
|
937
|
-
let t =
|
|
938
|
-
return t.push(...
|
|
1341
|
+
let t = q(r.pushChunk(new TextEncoder().encode(e)));
|
|
1342
|
+
return t.push(...q(r.finish())), Promise.resolve({
|
|
939
1343
|
issues: [],
|
|
940
1344
|
records: t
|
|
941
1345
|
});
|
|
@@ -945,7 +1349,7 @@ var z = {
|
|
|
945
1349
|
});
|
|
946
1350
|
}
|
|
947
1351
|
async processWithTransferableStream(e, t = {}, n) {
|
|
948
|
-
let r = await
|
|
1352
|
+
let r = await J(), i = t.delimiter?.codePointAt(0) ?? 44, a = t.hasHeaders ?? !0, o = performance.now(), s = 0, c = (e) => {
|
|
949
1353
|
s += e, n && n(e);
|
|
950
1354
|
};
|
|
951
1355
|
try {
|
|
@@ -955,11 +1359,11 @@ var z = {
|
|
|
955
1359
|
durationMs: performance.now() - o
|
|
956
1360
|
};
|
|
957
1361
|
} catch (e) {
|
|
958
|
-
throw new
|
|
1362
|
+
throw new M("Failed to process CSV stream.", "dpuse-tool-rust-csv-core-parser|Tool|processWithTransferableStream", { cause: e });
|
|
959
1363
|
}
|
|
960
1364
|
}
|
|
961
1365
|
async processWithChunks(e, t = {}, n) {
|
|
962
|
-
let { CsvSession: r } = await
|
|
1366
|
+
let { CsvSession: r } = await J(), i = t.delimiter?.codePointAt(0) ?? 44, a = t.hasHeaders ?? !0, o = performance.now(), s = 0, c = new r(i, a);
|
|
963
1367
|
try {
|
|
964
1368
|
let t = e.getReader();
|
|
965
1369
|
try {
|
|
@@ -979,19 +1383,17 @@ var z = {
|
|
|
979
1383
|
t.releaseLock();
|
|
980
1384
|
}
|
|
981
1385
|
} catch (e) {
|
|
982
|
-
throw new
|
|
1386
|
+
throw new M("Failed to process CSV chunks.", "dpuse-tool-rust-csv-core-parser|Tool|processWithChunks", { cause: e });
|
|
983
1387
|
}
|
|
984
1388
|
}
|
|
985
1389
|
};
|
|
986
|
-
function
|
|
987
|
-
|
|
988
|
-
if (e === "0x1F") return 31;
|
|
989
|
-
let t = e.codePointAt(0);
|
|
1390
|
+
function G(e) {
|
|
1391
|
+
let t = E(e).codePointAt(0);
|
|
990
1392
|
if (t == null || t > 127) throw Error(`Delimiter '${e}' is not a single ASCII character.`);
|
|
991
1393
|
return t;
|
|
992
1394
|
}
|
|
993
|
-
function
|
|
994
|
-
let t = new TextDecoder(
|
|
1395
|
+
function K(e) {
|
|
1396
|
+
let t = new TextDecoder(A(e));
|
|
995
1397
|
if (t.encoding === "utf-8") return;
|
|
996
1398
|
let n = new TextEncoder();
|
|
997
1399
|
return {
|
|
@@ -999,7 +1401,7 @@ function G(e) {
|
|
|
999
1401
|
transcode: (e) => n.encode(t.decode(e, { stream: !0 }))
|
|
1000
1402
|
};
|
|
1001
1403
|
}
|
|
1002
|
-
function
|
|
1404
|
+
function q(e) {
|
|
1003
1405
|
let { recordValueCounts: t, text: n, valueEnds: r, valueQuoted: i } = e;
|
|
1004
1406
|
e.free();
|
|
1005
1407
|
let a = [], o = 0, s = 0;
|
|
@@ -1016,10 +1418,10 @@ function K(e) {
|
|
|
1016
1418
|
}
|
|
1017
1419
|
return a;
|
|
1018
1420
|
}
|
|
1019
|
-
async function
|
|
1020
|
-
return
|
|
1421
|
+
async function J() {
|
|
1422
|
+
return U.rustBindingsPromise ??= (async () => {
|
|
1021
1423
|
let e = await import("./dpuse_tool_rust_csv_core_parser-BZJW07sd.js");
|
|
1022
1424
|
return await e.default(), e;
|
|
1023
|
-
})(),
|
|
1425
|
+
})(), U.rustBindingsPromise;
|
|
1024
1426
|
}
|
|
1025
|
-
export {
|
|
1427
|
+
export { W as Tool, B as config };
|