@utilix-tech/sdk 0.1.0

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.
Files changed (106) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +199 -0
  3. package/dist/api-8aZtWhSj.d.cts +308 -0
  4. package/dist/api-8aZtWhSj.d.ts +308 -0
  5. package/dist/chunk-2CJSLYWI.js +520 -0
  6. package/dist/chunk-3BAHSW4C.js +1385 -0
  7. package/dist/chunk-6YPV2AB5.js +1246 -0
  8. package/dist/chunk-BPVAB4P2.js +1126 -0
  9. package/dist/chunk-FL53T24A.js +257 -0
  10. package/dist/chunk-L6KCTHUW.js +1086 -0
  11. package/dist/chunk-MLKGABMK.js +7 -0
  12. package/dist/chunk-ROTPLW7T.js +265 -0
  13. package/dist/chunk-TSAGO3XP.js +1253 -0
  14. package/dist/chunk-UC656APA.js +1080 -0
  15. package/dist/chunk-W4UBLYFU.js +1219 -0
  16. package/dist/chunk-XST6X3HT.js +896 -0
  17. package/dist/chunk-XXYZLLHI.js +2227 -0
  18. package/dist/chunk-ZKL2VX2G.js +2215 -0
  19. package/dist/chunk-ZPQZEIXP.js +685 -0
  20. package/dist/code-QNrdLIR3.d.cts +327 -0
  21. package/dist/code-QNrdLIR3.d.ts +327 -0
  22. package/dist/color-tPwZCr9H.d.cts +229 -0
  23. package/dist/color-tPwZCr9H.d.ts +229 -0
  24. package/dist/css-Cf7AMGM-.d.cts +318 -0
  25. package/dist/css-Cf7AMGM-.d.ts +318 -0
  26. package/dist/data-rMjWNiOJ.d.cts +215 -0
  27. package/dist/data-rMjWNiOJ.d.ts +215 -0
  28. package/dist/encoding-7gmq-vkV.d.cts +108 -0
  29. package/dist/encoding-7gmq-vkV.d.ts +108 -0
  30. package/dist/generators-BGtRGpJZ.d.cts +118 -0
  31. package/dist/generators-BGtRGpJZ.d.ts +118 -0
  32. package/dist/hashing-CnetQFD_.d.cts +76 -0
  33. package/dist/hashing-CnetQFD_.d.ts +76 -0
  34. package/dist/index.cjs +15466 -0
  35. package/dist/index.d.cts +18 -0
  36. package/dist/index.d.ts +18 -0
  37. package/dist/index.js +20 -0
  38. package/dist/json-BjSoIS1h.d.cts +198 -0
  39. package/dist/json-BjSoIS1h.d.ts +198 -0
  40. package/dist/misc-DcVBManm.d.cts +201 -0
  41. package/dist/misc-DcVBManm.d.ts +201 -0
  42. package/dist/network-CNtmrDeN.d.cts +170 -0
  43. package/dist/network-CNtmrDeN.d.ts +170 -0
  44. package/dist/text-DqAjPtQ0.d.cts +319 -0
  45. package/dist/text-DqAjPtQ0.d.ts +319 -0
  46. package/dist/time-DbT8fjaF.d.cts +145 -0
  47. package/dist/time-DbT8fjaF.d.ts +145 -0
  48. package/dist/tools/api.cjs +1216 -0
  49. package/dist/tools/api.d.cts +1 -0
  50. package/dist/tools/api.d.ts +1 -0
  51. package/dist/tools/api.js +2 -0
  52. package/dist/tools/code.cjs +2212 -0
  53. package/dist/tools/code.d.cts +1 -0
  54. package/dist/tools/code.d.ts +1 -0
  55. package/dist/tools/code.js +2 -0
  56. package/dist/tools/color.cjs +1122 -0
  57. package/dist/tools/color.d.cts +1 -0
  58. package/dist/tools/color.d.ts +1 -0
  59. package/dist/tools/color.js +2 -0
  60. package/dist/tools/css.cjs +1242 -0
  61. package/dist/tools/css.d.cts +1 -0
  62. package/dist/tools/css.d.ts +1 -0
  63. package/dist/tools/css.js +2 -0
  64. package/dist/tools/data.cjs +1097 -0
  65. package/dist/tools/data.d.cts +1 -0
  66. package/dist/tools/data.d.ts +1 -0
  67. package/dist/tools/data.js +2 -0
  68. package/dist/tools/encoding.cjs +261 -0
  69. package/dist/tools/encoding.d.cts +1 -0
  70. package/dist/tools/encoding.d.ts +1 -0
  71. package/dist/tools/encoding.js +2 -0
  72. package/dist/tools/generators.cjs +521 -0
  73. package/dist/tools/generators.d.cts +1 -0
  74. package/dist/tools/generators.d.ts +1 -0
  75. package/dist/tools/generators.js +2 -0
  76. package/dist/tools/hashing.cjs +259 -0
  77. package/dist/tools/hashing.d.cts +1 -0
  78. package/dist/tools/hashing.d.ts +1 -0
  79. package/dist/tools/hashing.js +2 -0
  80. package/dist/tools/json.cjs +1270 -0
  81. package/dist/tools/json.d.cts +1 -0
  82. package/dist/tools/json.d.ts +1 -0
  83. package/dist/tools/json.js +2 -0
  84. package/dist/tools/misc.cjs +1082 -0
  85. package/dist/tools/misc.d.cts +1 -0
  86. package/dist/tools/misc.d.ts +1 -0
  87. package/dist/tools/misc.js +2 -0
  88. package/dist/tools/network.cjs +1381 -0
  89. package/dist/tools/network.d.cts +1 -0
  90. package/dist/tools/network.d.ts +1 -0
  91. package/dist/tools/network.js +2 -0
  92. package/dist/tools/text.cjs +2224 -0
  93. package/dist/tools/text.d.cts +1 -0
  94. package/dist/tools/text.d.ts +1 -0
  95. package/dist/tools/text.js +2 -0
  96. package/dist/tools/time.cjs +681 -0
  97. package/dist/tools/time.d.cts +1 -0
  98. package/dist/tools/time.d.ts +1 -0
  99. package/dist/tools/time.js +2 -0
  100. package/dist/tools/units.cjs +892 -0
  101. package/dist/tools/units.d.cts +1 -0
  102. package/dist/tools/units.d.ts +1 -0
  103. package/dist/tools/units.js +2 -0
  104. package/dist/units-6lwDYBvX.d.cts +302 -0
  105. package/dist/units-6lwDYBvX.d.ts +302 -0
  106. package/package.json +148 -0
@@ -0,0 +1,1080 @@
1
+ import { __export } from './chunk-MLKGABMK.js';
2
+ import * as yaml from 'js-yaml';
3
+ import { parse, stringify } from 'smol-toml';
4
+
5
+ // src/tools/data.ts
6
+ var data_exports = {};
7
+ __export(data_exports, {
8
+ csvToJson: () => csvToJson,
9
+ detectDelimiter: () => detectDelimiter,
10
+ envToExport: () => envToExport,
11
+ envToJson: () => envToJson,
12
+ formatToml: () => formatToml,
13
+ formatXml: () => formatXml,
14
+ getSection: () => getSection,
15
+ getSectionNames: () => getSectionNames,
16
+ getTomlStats: () => getTomlStats,
17
+ getXmlStats: () => getXmlStats,
18
+ getYamlStats: () => getYamlStats,
19
+ iniToJson: () => iniToJson,
20
+ jsonToIni: () => jsonToIni,
21
+ jsonToToml: () => jsonToToml,
22
+ jsonToXml: () => jsonToXml,
23
+ minifyToml: () => minifyToml,
24
+ minifyXml: () => minifyXml,
25
+ parseCsv: () => parseCsv,
26
+ parseEnv: () => parseEnv,
27
+ parseIni: () => parseIni,
28
+ parseXmlToObject: () => parseXmlToObject,
29
+ stringifyIni: () => stringifyIni,
30
+ toCsvString: () => toCsvString,
31
+ tomlToJson: () => tomlToJson,
32
+ validateEnvKey: () => validateEnvKey,
33
+ validateIni: () => validateIni,
34
+ validateToml: () => validateToml,
35
+ validateXml: () => validateXml,
36
+ validateYaml: () => validateYaml,
37
+ xmlToJson: () => xmlToJson
38
+ });
39
+ function validateYaml(input) {
40
+ if (!input.trim()) {
41
+ return { valid: true, documentCount: 0, keyCount: 0 };
42
+ }
43
+ try {
44
+ const docs = [];
45
+ yaml.loadAll(input, (doc) => docs.push(doc));
46
+ const first = docs[0];
47
+ const keyCount = first && typeof first === "object" && first !== null ? Object.keys(first).length : 0;
48
+ return { valid: true, documentCount: docs.length, keyCount };
49
+ } catch (e) {
50
+ const err = e;
51
+ return {
52
+ valid: false,
53
+ error: {
54
+ message: err.reason ?? err.message,
55
+ line: err.mark?.line != null ? err.mark.line + 1 : void 0,
56
+ column: err.mark?.column != null ? err.mark.column + 1 : void 0
57
+ },
58
+ documentCount: 0,
59
+ keyCount: 0
60
+ };
61
+ }
62
+ }
63
+ function _yamlMaxDepth(value, current = 0) {
64
+ if (value === null || typeof value !== "object") return current;
65
+ const children = Array.isArray(value) ? value : Object.values(value);
66
+ if (children.length === 0) return current;
67
+ return Math.max(...children.map((child) => _yamlMaxDepth(child, current + 1)));
68
+ }
69
+ function _yamlCountKeys(value) {
70
+ if (value === null || typeof value !== "object") return 0;
71
+ if (Array.isArray(value))
72
+ return value.reduce((sum, item) => sum + _yamlCountKeys(item), 0);
73
+ const obj = value;
74
+ return Object.keys(obj).length + Object.values(obj).reduce((sum, v) => sum + _yamlCountKeys(v), 0);
75
+ }
76
+ function getYamlStats(input) {
77
+ if (!input.trim()) return { lines: 0, keys: 0, depth: 0 };
78
+ try {
79
+ const doc = yaml.load(input);
80
+ return {
81
+ lines: input.split("\n").length,
82
+ keys: _yamlCountKeys(doc),
83
+ depth: _yamlMaxDepth(doc)
84
+ };
85
+ } catch (e) {
86
+ const err = e;
87
+ return { error: err.reason ?? err.message };
88
+ }
89
+ }
90
+ function formatToml(input) {
91
+ try {
92
+ const parsed = parse(input);
93
+ const output = stringify(parsed);
94
+ return { output, valid: true };
95
+ } catch (e) {
96
+ return { output: input, valid: false, error: e.message };
97
+ }
98
+ }
99
+ function minifyToml(input) {
100
+ try {
101
+ const parsed = parse(input);
102
+ const output = stringify(parsed);
103
+ return { output, valid: true };
104
+ } catch (e) {
105
+ return { output: input, valid: false, error: e.message };
106
+ }
107
+ }
108
+ function validateToml(input) {
109
+ try {
110
+ parse(input);
111
+ return { valid: true };
112
+ } catch (e) {
113
+ return { valid: false, error: e.message };
114
+ }
115
+ }
116
+ function tomlToJson(input) {
117
+ try {
118
+ const parsed = parse(input);
119
+ return JSON.stringify(parsed, null, 2);
120
+ } catch (e) {
121
+ return { error: e.message };
122
+ }
123
+ }
124
+ function jsonToToml(input) {
125
+ try {
126
+ const parsed = JSON.parse(input);
127
+ return stringify(parsed);
128
+ } catch (e) {
129
+ return { error: e.message };
130
+ }
131
+ }
132
+ function _tomlCountStats(obj, stats) {
133
+ if (obj === null || typeof obj !== "object") return;
134
+ if (Array.isArray(obj)) {
135
+ for (const item of obj) {
136
+ if (item !== null && typeof item === "object" && !Array.isArray(item)) {
137
+ stats.tables++;
138
+ _tomlCountStats(item, stats);
139
+ } else if (Array.isArray(item)) {
140
+ stats.arrays++;
141
+ _tomlCountStats(item, stats);
142
+ } else {
143
+ stats.keys++;
144
+ }
145
+ }
146
+ } else {
147
+ for (const value of Object.values(obj)) {
148
+ if (value !== null && typeof value === "object" && !Array.isArray(value)) {
149
+ stats.tables++;
150
+ _tomlCountStats(value, stats);
151
+ } else if (Array.isArray(value)) {
152
+ stats.arrays++;
153
+ _tomlCountStats(value, stats);
154
+ } else {
155
+ stats.keys++;
156
+ }
157
+ }
158
+ }
159
+ }
160
+ function getTomlStats(input) {
161
+ try {
162
+ const parsed = parse(input);
163
+ const stats = { keys: 0, tables: 0, arrays: 0 };
164
+ _tomlCountStats(parsed, stats);
165
+ return stats;
166
+ } catch (e) {
167
+ return { error: e.message };
168
+ }
169
+ }
170
+ function validateXml(input) {
171
+ const stack = [];
172
+ let hasRoot = false;
173
+ const tagRegex = /<(?:[^"'<>]|"[^"]*"|'[^']*')*>/g;
174
+ let match;
175
+ while ((match = tagRegex.exec(input)) !== null) {
176
+ const tag = match[0];
177
+ if (tag.startsWith("<?")) continue;
178
+ if (tag.startsWith("<!--")) continue;
179
+ if (tag.startsWith("<![CDATA[")) continue;
180
+ if (tag.endsWith("/>")) continue;
181
+ if (tag.startsWith("</")) {
182
+ const nameMatch2 = tag.match(/^<\/([A-Za-z_][\w.-]*)/);
183
+ if (!nameMatch2) return { valid: false, error: "Invalid closing tag: " + tag };
184
+ const name2 = nameMatch2[1];
185
+ if (stack.length === 0) {
186
+ return { valid: false, error: `Unexpected closing tag </${name2}>` };
187
+ }
188
+ const top = stack.pop();
189
+ if (top !== name2) {
190
+ return {
191
+ valid: false,
192
+ error: `Mismatched tags: expected </${top}> but found </${name2}>`
193
+ };
194
+ }
195
+ continue;
196
+ }
197
+ const nameMatch = tag.match(/^<([A-Za-z_][\w.-]*)/);
198
+ if (!nameMatch) return { valid: false, error: "Invalid tag: " + tag };
199
+ const name = nameMatch[1];
200
+ stack.push(name);
201
+ hasRoot = true;
202
+ }
203
+ if (!hasRoot) {
204
+ return { valid: false, error: "No root element found" };
205
+ }
206
+ if (stack.length > 0) {
207
+ return { valid: false, error: `Unclosed tag: <${stack[stack.length - 1]}>` };
208
+ }
209
+ return { valid: true };
210
+ }
211
+ function _tokenizeXml(input) {
212
+ const tokens = [];
213
+ let pos = 0;
214
+ const len = input.length;
215
+ while (pos < len) {
216
+ if (input[pos] !== "<") {
217
+ const end = input.indexOf("<", pos);
218
+ const text = end === -1 ? input.slice(pos) : input.slice(pos, end);
219
+ if (text) tokens.push({ type: "text", value: text });
220
+ pos = end === -1 ? len : end;
221
+ continue;
222
+ }
223
+ if (input.startsWith("<?", pos)) {
224
+ const end = input.indexOf("?>", pos);
225
+ if (end === -1) {
226
+ tokens.push({ type: "pi", value: input.slice(pos) });
227
+ pos = len;
228
+ } else {
229
+ tokens.push({ type: "pi", value: input.slice(pos, end + 2) });
230
+ pos = end + 2;
231
+ }
232
+ continue;
233
+ }
234
+ if (input.startsWith("<!--", pos)) {
235
+ const end = input.indexOf("-->", pos);
236
+ if (end === -1) {
237
+ tokens.push({ type: "comment", value: input.slice(pos) });
238
+ pos = len;
239
+ } else {
240
+ tokens.push({ type: "comment", value: input.slice(pos, end + 3) });
241
+ pos = end + 3;
242
+ }
243
+ continue;
244
+ }
245
+ if (input.startsWith("<![CDATA[", pos)) {
246
+ const end = input.indexOf("]]>", pos);
247
+ if (end === -1) {
248
+ tokens.push({ type: "cdata", value: input.slice(pos) });
249
+ pos = len;
250
+ } else {
251
+ tokens.push({ type: "cdata", value: input.slice(pos, end + 3) });
252
+ pos = end + 3;
253
+ }
254
+ continue;
255
+ }
256
+ let tagEnd = pos + 1;
257
+ let inString = null;
258
+ while (tagEnd < len) {
259
+ const ch = input[tagEnd];
260
+ if (inString) {
261
+ if (ch === inString) inString = null;
262
+ } else {
263
+ if (ch === '"' || ch === "'") inString = ch;
264
+ else if (ch === ">") break;
265
+ }
266
+ tagEnd++;
267
+ }
268
+ const tag = input.slice(pos, tagEnd + 1);
269
+ pos = tagEnd + 1;
270
+ if (tag.startsWith("</")) {
271
+ const nameMatch2 = tag.match(/^<\/([A-Za-z_][\w.-]*)/);
272
+ const name2 = nameMatch2 ? nameMatch2[1] : "";
273
+ tokens.push({ type: "close", value: tag, name: name2 });
274
+ continue;
275
+ }
276
+ if (tag.endsWith("/>")) {
277
+ tokens.push({ type: "selfclose", value: tag });
278
+ continue;
279
+ }
280
+ const nameMatch = tag.match(/^<([A-Za-z_][\w.-]*)/);
281
+ const name = nameMatch ? nameMatch[1] : "";
282
+ tokens.push({ type: "open", value: tag, name });
283
+ }
284
+ return tokens;
285
+ }
286
+ function formatXml(input, indentSize = 2) {
287
+ const validation = validateXml(input);
288
+ const tokens = _tokenizeXml(input);
289
+ const indent = " ".repeat(indentSize);
290
+ const lines = [];
291
+ let level = 0;
292
+ const pad = (n) => indent.repeat(n);
293
+ for (let i = 0; i < tokens.length; i++) {
294
+ const token = tokens[i];
295
+ switch (token.type) {
296
+ case "pi":
297
+ lines.push(token.value);
298
+ break;
299
+ case "comment":
300
+ lines.push(pad(level) + token.value);
301
+ break;
302
+ case "cdata":
303
+ lines.push(pad(level) + token.value);
304
+ break;
305
+ case "open": {
306
+ const next = tokens[i + 1];
307
+ if (next && next.type === "close" && next.name === token.name) {
308
+ lines.push(pad(level) + `<${token.name}/>`);
309
+ i++;
310
+ } else {
311
+ lines.push(pad(level) + token.value);
312
+ level++;
313
+ }
314
+ break;
315
+ }
316
+ case "close":
317
+ level = Math.max(0, level - 1);
318
+ lines.push(pad(level) + token.value);
319
+ break;
320
+ case "selfclose":
321
+ lines.push(pad(level) + token.value);
322
+ break;
323
+ case "text": {
324
+ const trimmed = token.value.trim();
325
+ if (trimmed) {
326
+ lines.push(pad(level) + trimmed);
327
+ }
328
+ break;
329
+ }
330
+ }
331
+ }
332
+ const output = lines.join("\n");
333
+ return {
334
+ output,
335
+ originalSize: input.length,
336
+ outputSize: output.length,
337
+ valid: validation.valid,
338
+ error: validation.error
339
+ };
340
+ }
341
+ function minifyXml(input) {
342
+ const validation = validateXml(input);
343
+ const cdataRegex = /(<!\[CDATA\[[\s\S]*?]]>)/g;
344
+ const parts = input.split(cdataRegex);
345
+ const processed = parts.map((part, idx) => {
346
+ if (idx % 2 === 1) return part;
347
+ let result = part.replace(/<!--[\s\S]*?-->/g, "");
348
+ result = result.replace(/>\s+</g, "><");
349
+ return result;
350
+ }).join("");
351
+ const output = processed.trim();
352
+ return {
353
+ output,
354
+ originalSize: input.length,
355
+ outputSize: output.length,
356
+ valid: validation.valid,
357
+ error: validation.error
358
+ };
359
+ }
360
+ function _parseAttributes(attrStr) {
361
+ const attrs = {};
362
+ const re = /([^\s=]+)\s*=\s*(?:"([^"]*)"|'([^']*)'|(\S+))/g;
363
+ let m;
364
+ while ((m = re.exec(attrStr)) !== null) {
365
+ attrs[m[1]] = m[2] ?? m[3] ?? m[4] ?? "";
366
+ }
367
+ return attrs;
368
+ }
369
+ function _xmlTokenize(xml) {
370
+ const tokens = [];
371
+ let i = 0;
372
+ const len = xml.length;
373
+ while (i < len) {
374
+ if (xml[i] !== "<") {
375
+ const start = i;
376
+ while (i < len && xml[i] !== "<") i++;
377
+ const text = xml.slice(start, i);
378
+ if (text.trim().length > 0) {
379
+ tokens.push({ type: "TEXT", value: text.trim() });
380
+ }
381
+ continue;
382
+ }
383
+ if (xml.startsWith("<?", i)) {
384
+ const end = xml.indexOf("?>", i);
385
+ if (end === -1) {
386
+ i = len;
387
+ } else {
388
+ tokens.push({ type: "XML_DECL" });
389
+ i = end + 2;
390
+ }
391
+ } else if (xml.startsWith("<!--", i)) {
392
+ const end = xml.indexOf("-->", i);
393
+ if (end === -1) {
394
+ i = len;
395
+ } else {
396
+ tokens.push({ type: "COMMENT" });
397
+ i = end + 3;
398
+ }
399
+ } else if (xml.startsWith("<![CDATA[", i)) {
400
+ const end = xml.indexOf("]]>", i);
401
+ if (end === -1) {
402
+ i = len;
403
+ } else {
404
+ const cdataValue = xml.slice(i + 9, end);
405
+ tokens.push({ type: "CDATA", value: cdataValue });
406
+ i = end + 3;
407
+ }
408
+ } else if (xml.startsWith("</", i)) {
409
+ const end = xml.indexOf(">", i);
410
+ if (end === -1) {
411
+ i = len;
412
+ } else {
413
+ const name = xml.slice(i + 2, end).trim();
414
+ tokens.push({ type: "CLOSE_TAG", name });
415
+ i = end + 1;
416
+ }
417
+ } else {
418
+ const end = xml.indexOf(">", i);
419
+ if (end === -1) {
420
+ i = len;
421
+ } else {
422
+ const raw = xml.slice(i + 1, end);
423
+ const selfClose = raw.endsWith("/");
424
+ const content = selfClose ? raw.slice(0, -1).trim() : raw.trim();
425
+ const spaceIdx = content.search(/\s/);
426
+ const name = spaceIdx === -1 ? content : content.slice(0, spaceIdx);
427
+ const attrStr = spaceIdx === -1 ? "" : content.slice(spaceIdx + 1);
428
+ const attrs = _parseAttributes(attrStr);
429
+ tokens.push({
430
+ type: selfClose ? "SELF_CLOSE" : "OPEN_TAG",
431
+ name,
432
+ attrs
433
+ });
434
+ i = end + 1;
435
+ }
436
+ }
437
+ }
438
+ return tokens;
439
+ }
440
+ function _buildTree(tokens) {
441
+ const root = { name: "__root__", attrs: {}, children: [], text: "" };
442
+ const stack = [root];
443
+ for (const tok of tokens) {
444
+ const current = stack[stack.length - 1];
445
+ if (tok.type === "OPEN_TAG") {
446
+ const node = { name: tok.name, attrs: tok.attrs ?? {}, children: [], text: "" };
447
+ current.children.push(node);
448
+ stack.push(node);
449
+ } else if (tok.type === "SELF_CLOSE") {
450
+ const node = { name: tok.name, attrs: tok.attrs ?? {}, children: [], text: "" };
451
+ current.children.push(node);
452
+ } else if (tok.type === "CLOSE_TAG") {
453
+ if (stack.length > 1) stack.pop();
454
+ } else if (tok.type === "TEXT") {
455
+ current.text += tok.value ?? "";
456
+ } else if (tok.type === "CDATA") {
457
+ current.text += tok.value ?? "";
458
+ }
459
+ }
460
+ return root.children[0] ?? null;
461
+ }
462
+ function _nodeToObject(node, opts) {
463
+ const obj = {};
464
+ if (!opts.ignoreAttributes) {
465
+ for (const [k, v] of Object.entries(node.attrs)) {
466
+ obj[opts.attributePrefix + k] = v;
467
+ }
468
+ }
469
+ const childGroups = {};
470
+ for (const child of node.children) {
471
+ if (!childGroups[child.name]) childGroups[child.name] = [];
472
+ childGroups[child.name].push(child);
473
+ }
474
+ for (const [childName, childNodes] of Object.entries(childGroups)) {
475
+ const converted = childNodes.map((c) => _nodeToObject(c, opts));
476
+ if (opts.arrayMode || childNodes.length > 1) {
477
+ obj[childName] = converted;
478
+ } else {
479
+ obj[childName] = converted[0];
480
+ }
481
+ }
482
+ const hasText = node.text.length > 0;
483
+ const hasChildren = node.children.length > 0;
484
+ const hasAttrs = Object.keys(obj).length > 0;
485
+ if (hasText) {
486
+ if (!hasChildren && !hasAttrs && opts.compact) {
487
+ return node.text;
488
+ }
489
+ obj[opts.textKey] = node.text;
490
+ }
491
+ if (!hasText && !hasChildren && !hasAttrs) {
492
+ return opts.compact ? "" : obj;
493
+ }
494
+ return obj;
495
+ }
496
+ function _resolvedXmlOptions(options) {
497
+ return {
498
+ compact: options?.compact ?? true,
499
+ ignoreAttributes: options?.ignoreAttributes ?? false,
500
+ attributePrefix: options?.attributePrefix ?? "@_",
501
+ textKey: options?.textKey ?? "#text",
502
+ arrayMode: options?.arrayMode ?? false,
503
+ spaces: options?.spaces ?? 2
504
+ };
505
+ }
506
+ function parseXmlToObject(xml, options) {
507
+ try {
508
+ const trimmed = xml.trim();
509
+ if (!trimmed) return { error: "Input is empty" };
510
+ const opts = _resolvedXmlOptions(options);
511
+ const tokens = _xmlTokenize(trimmed);
512
+ const tree = _buildTree(tokens);
513
+ if (!tree) return { error: "No root element found" };
514
+ const value = _nodeToObject(tree, opts);
515
+ return { [tree.name]: value };
516
+ } catch (err) {
517
+ return { error: err instanceof Error ? err.message : String(err) };
518
+ }
519
+ }
520
+ function xmlToJson(xml, options) {
521
+ const result = parseXmlToObject(xml, options);
522
+ if ("error" in result) return { error: result.error };
523
+ const spaces = options?.spaces ?? 2;
524
+ return JSON.stringify(result, null, spaces);
525
+ }
526
+ function getXmlStats(xml) {
527
+ try {
528
+ const trimmed = xml.trim();
529
+ if (!trimmed) return { elements: 0, attributes: 0, depth: 0, rootElement: "" };
530
+ const tokens = _xmlTokenize(trimmed);
531
+ let elements = 0;
532
+ let attributes = 0;
533
+ let depth = 0;
534
+ let maxDepth = 0;
535
+ let rootElement = "";
536
+ let rootFound = false;
537
+ for (const tok of tokens) {
538
+ if (tok.type === "OPEN_TAG") {
539
+ elements++;
540
+ depth++;
541
+ if (!rootFound) {
542
+ rootElement = tok.name;
543
+ rootFound = true;
544
+ }
545
+ if (depth > maxDepth) maxDepth = depth;
546
+ attributes += Object.keys(tok.attrs ?? {}).length;
547
+ } else if (tok.type === "SELF_CLOSE") {
548
+ elements++;
549
+ if (!rootFound) {
550
+ rootElement = tok.name;
551
+ rootFound = true;
552
+ }
553
+ const selfDepth = depth + 1;
554
+ if (selfDepth > maxDepth) maxDepth = selfDepth;
555
+ attributes += Object.keys(tok.attrs ?? {}).length;
556
+ } else if (tok.type === "CLOSE_TAG") {
557
+ depth--;
558
+ }
559
+ }
560
+ return { elements, attributes, depth: maxDepth, rootElement };
561
+ } catch {
562
+ return { elements: 0, attributes: 0, depth: 0, rootElement: "" };
563
+ }
564
+ }
565
+ function _valueToXml(tag, value, indent, spaces) {
566
+ const pad = " ".repeat(spaces);
567
+ if (Array.isArray(value)) {
568
+ return value.map((item) => _valueToXml(tag, item, indent, spaces)).join("\n");
569
+ }
570
+ if (value === null || value === void 0) {
571
+ return `${indent}<${tag} />`;
572
+ }
573
+ if (typeof value !== "object") {
574
+ return `${indent}<${tag}>${String(value)}</${tag}>`;
575
+ }
576
+ const obj = value;
577
+ const attrParts = [];
578
+ let textContent;
579
+ const children = [];
580
+ for (const [k, v] of Object.entries(obj)) {
581
+ if (k.startsWith("@_")) {
582
+ attrParts.push(`${k.slice(2)}="${String(v)}"`);
583
+ } else if (k === "#text") {
584
+ textContent = String(v);
585
+ } else {
586
+ children.push([k, v]);
587
+ }
588
+ }
589
+ const attrStr = attrParts.length > 0 ? " " + attrParts.join(" ") : "";
590
+ if (children.length === 0 && textContent !== void 0) {
591
+ return `${indent}<${tag}${attrStr}>${textContent}</${tag}>`;
592
+ }
593
+ if (children.length === 0 && textContent === void 0) {
594
+ return `${indent}<${tag}${attrStr} />`;
595
+ }
596
+ const childLines = children.map(([childTag, childVal]) => _valueToXml(childTag, childVal, indent + pad, spaces)).join("\n");
597
+ const textLine = textContent !== void 0 ? `${indent}${pad}${textContent}
598
+ ` : "";
599
+ return `${indent}<${tag}${attrStr}>
600
+ ${textLine}${childLines}
601
+ ${indent}</${tag}>`;
602
+ }
603
+ function jsonToXml(json, options) {
604
+ try {
605
+ const parsed = JSON.parse(json);
606
+ const spaces = options?.spaces ?? 2;
607
+ if (options?.rootElement) {
608
+ return _valueToXml(options.rootElement, parsed, "", spaces);
609
+ }
610
+ if (typeof parsed === "object" && parsed !== null && !Array.isArray(parsed)) {
611
+ const entries = Object.entries(parsed);
612
+ if (entries.length === 1) {
613
+ return _valueToXml(entries[0][0], entries[0][1], "", spaces);
614
+ }
615
+ const lines = entries.map(([k, v]) => _valueToXml(k, v, " ".repeat(spaces), spaces)).join("\n");
616
+ return `<root>
617
+ ${lines}
618
+ </root>`;
619
+ }
620
+ return _valueToXml("root", parsed, "", spaces);
621
+ } catch (err) {
622
+ return { error: err instanceof Error ? err.message : String(err) };
623
+ }
624
+ }
625
+ function detectDelimiter(input) {
626
+ const firstLine = input.split("\n")[0] ?? "";
627
+ const commaCount = (firstLine.match(/,/g) ?? []).length;
628
+ const tabCount = (firstLine.match(/\t/g) ?? []).length;
629
+ const semicolonCount = (firstLine.match(/;/g) ?? []).length;
630
+ if (tabCount > commaCount && tabCount > semicolonCount) return " ";
631
+ if (semicolonCount > commaCount) return ";";
632
+ return ",";
633
+ }
634
+ function _parseRow(line, delimiter, trim) {
635
+ const fields = [];
636
+ let i = 0;
637
+ while (i <= line.length) {
638
+ if (i === line.length) {
639
+ fields.push("");
640
+ break;
641
+ }
642
+ if (line[i] === '"') {
643
+ i++;
644
+ let field = "";
645
+ while (i < line.length) {
646
+ if (line[i] === '"') {
647
+ if (i + 1 < line.length && line[i + 1] === '"') {
648
+ field += '"';
649
+ i += 2;
650
+ } else {
651
+ i++;
652
+ break;
653
+ }
654
+ } else {
655
+ field += line[i];
656
+ i++;
657
+ }
658
+ }
659
+ if (trim) field = field.trim();
660
+ fields.push(field);
661
+ if (i < line.length && line.slice(i, i + delimiter.length) === delimiter) {
662
+ i += delimiter.length;
663
+ } else if (i < line.length) {
664
+ return { error: `Unexpected character after quoted field at position ${i}` };
665
+ }
666
+ } else {
667
+ const nextDelim = line.indexOf(delimiter, i);
668
+ const raw = nextDelim === -1 ? line.slice(i) : line.slice(i, nextDelim);
669
+ fields.push(trim ? raw.trim() : raw);
670
+ i = nextDelim === -1 ? line.length + 1 : nextDelim + delimiter.length;
671
+ }
672
+ }
673
+ return fields;
674
+ }
675
+ function _splitIntoLines(input, _delimiter) {
676
+ const lines = [];
677
+ let current = "";
678
+ let inQuotes = false;
679
+ let i = 0;
680
+ while (i < input.length) {
681
+ const ch = input[i];
682
+ if (ch === '"') {
683
+ if (inQuotes && i + 1 < input.length && input[i + 1] === '"') {
684
+ current += '""';
685
+ i += 2;
686
+ continue;
687
+ }
688
+ inQuotes = !inQuotes;
689
+ current += ch;
690
+ i++;
691
+ } else if (!inQuotes && (ch === "\n" || ch === "\r" && input[i + 1] === "\n")) {
692
+ lines.push(current);
693
+ current = "";
694
+ if (ch === "\r") i++;
695
+ i++;
696
+ } else if (!inQuotes && ch === "\r") {
697
+ lines.push(current);
698
+ current = "";
699
+ i++;
700
+ } else {
701
+ current += ch;
702
+ i++;
703
+ }
704
+ }
705
+ if (current.length > 0) lines.push(current);
706
+ return lines;
707
+ }
708
+ function parseCsv(input, options) {
709
+ if (!input || input.trim() === "") return { error: "Input is empty" };
710
+ const delimiter = options?.delimiter ?? ",";
711
+ const hasHeader = options?.hasHeader !== false;
712
+ const trim = options?.trimWhitespace ?? false;
713
+ const maxRows = options?.maxRows;
714
+ const lines = _splitIntoLines(input);
715
+ if (lines.length === 0) return { error: "No data found" };
716
+ const warnings = [];
717
+ const allRows = [];
718
+ for (let i = 0; i < lines.length; i++) {
719
+ const line = lines[i];
720
+ if (line.trim() === "") continue;
721
+ const result = _parseRow(line, delimiter, trim);
722
+ if ("error" in result) return { error: `Line ${i + 1}: ${result.error}` };
723
+ allRows.push(result);
724
+ }
725
+ if (allRows.length === 0) return { error: "No data found after parsing" };
726
+ const maxCols = Math.max(...allRows.map((r) => r.length));
727
+ let headers;
728
+ let dataRows;
729
+ if (hasHeader) {
730
+ headers = allRows[0];
731
+ dataRows = allRows.slice(1);
732
+ } else {
733
+ headers = Array.from({ length: maxCols }, (_, idx) => `Column ${idx + 1}`);
734
+ dataRows = allRows;
735
+ }
736
+ for (let i = 0; i < dataRows.length; i++) {
737
+ if (dataRows[i].length !== maxCols) {
738
+ warnings.push(`Row ${i + 1} has ${dataRows[i].length} columns, expected ${maxCols}`);
739
+ }
740
+ }
741
+ const totalRows = dataRows.length;
742
+ if (maxRows !== void 0 && dataRows.length > maxRows) {
743
+ warnings.push(`Truncated to ${maxRows} rows (${dataRows.length} total)`);
744
+ dataRows = dataRows.slice(0, maxRows);
745
+ }
746
+ return {
747
+ headers,
748
+ rows: dataRows,
749
+ totalRows,
750
+ totalCols: maxCols,
751
+ warnings
752
+ };
753
+ }
754
+ function csvToJson(input, options) {
755
+ const result = parseCsv(input, options);
756
+ if ("error" in result) return result;
757
+ const objects = result.rows.map((row) => {
758
+ const obj = {};
759
+ result.headers.forEach((header, i) => {
760
+ obj[header] = row[i] ?? "";
761
+ });
762
+ return obj;
763
+ });
764
+ return JSON.stringify(objects, null, 2);
765
+ }
766
+ function toCsvString(headers, rows) {
767
+ const escapeField = (field) => {
768
+ if (field.includes(",") || field.includes('"') || field.includes("\n") || field.includes("\r")) {
769
+ return `"${field.replace(/"/g, '""')}"`;
770
+ }
771
+ return field;
772
+ };
773
+ const lines = [];
774
+ lines.push(headers.map(escapeField).join(","));
775
+ for (const row of rows) {
776
+ lines.push(row.map(escapeField).join(","));
777
+ }
778
+ return lines.join("\n");
779
+ }
780
+ function parseIni(input) {
781
+ if (typeof input !== "string") {
782
+ return { error: "Input must be a string" };
783
+ }
784
+ const lines = input.split("\n");
785
+ const sections = [];
786
+ let currentSection = {
787
+ name: "",
788
+ keys: {},
789
+ comments: [],
790
+ lineStart: 1,
791
+ lineEnd: lines.length
792
+ };
793
+ for (let i = 0; i < lines.length; i++) {
794
+ const lineNum = i + 1;
795
+ const line = lines[i];
796
+ const trimmed = line.trim();
797
+ if (trimmed === "") continue;
798
+ if (trimmed.startsWith("#") || trimmed.startsWith(";")) {
799
+ currentSection.comments.push(trimmed);
800
+ continue;
801
+ }
802
+ if (trimmed.startsWith("[") && trimmed.endsWith("]")) {
803
+ currentSection.lineEnd = lineNum - 1;
804
+ sections.push(currentSection);
805
+ const sectionName = trimmed.slice(1, -1).trim();
806
+ currentSection = {
807
+ name: sectionName,
808
+ keys: {},
809
+ comments: [],
810
+ lineStart: lineNum,
811
+ lineEnd: lines.length
812
+ };
813
+ continue;
814
+ }
815
+ const eqIndex = trimmed.indexOf("=");
816
+ const colonIndex = trimmed.indexOf(":");
817
+ let sepIndex = -1;
818
+ if (eqIndex !== -1 && colonIndex !== -1) {
819
+ sepIndex = Math.min(eqIndex, colonIndex);
820
+ } else if (eqIndex !== -1) {
821
+ sepIndex = eqIndex;
822
+ } else if (colonIndex !== -1) {
823
+ sepIndex = colonIndex;
824
+ }
825
+ if (sepIndex !== -1) {
826
+ const key = trimmed.slice(0, sepIndex).trim();
827
+ let value = trimmed.slice(sepIndex + 1).trim();
828
+ if (value.startsWith('"') && value.endsWith('"') || value.startsWith("'") && value.endsWith("'")) {
829
+ value = value.slice(1, -1);
830
+ }
831
+ currentSection.keys[key] = value;
832
+ }
833
+ }
834
+ currentSection.lineEnd = lines.length;
835
+ sections.push(currentSection);
836
+ const globalSection = sections.find((s) => s.name === "");
837
+ const globalKeys = globalSection ? { ...globalSection.keys } : {};
838
+ return {
839
+ sections,
840
+ global: globalKeys,
841
+ raw: input
842
+ };
843
+ }
844
+ function stringifyIni(parsed) {
845
+ const parts = [];
846
+ const globalSection = parsed.sections.find((s) => s.name === "");
847
+ if (globalSection) {
848
+ for (const comment of globalSection.comments) {
849
+ parts.push(comment);
850
+ }
851
+ for (const [key, value] of Object.entries(globalSection.keys)) {
852
+ parts.push(`${key} = ${value}`);
853
+ }
854
+ }
855
+ for (const section of parsed.sections) {
856
+ if (section.name === "") continue;
857
+ if (parts.length > 0) {
858
+ parts.push("");
859
+ }
860
+ parts.push(`[${section.name}]`);
861
+ for (const comment of section.comments) {
862
+ parts.push(comment);
863
+ }
864
+ for (const [key, value] of Object.entries(section.keys)) {
865
+ parts.push(`${key} = ${value}`);
866
+ }
867
+ }
868
+ return parts.join("\n");
869
+ }
870
+ function iniToJson(input) {
871
+ const result = parseIni(input);
872
+ if (typeof result === "object" && "error" in result) {
873
+ return result;
874
+ }
875
+ const obj = {};
876
+ for (const [key, value] of Object.entries(result.global)) {
877
+ obj[key] = value;
878
+ }
879
+ for (const section of result.sections) {
880
+ if (section.name === "") continue;
881
+ obj[section.name] = { ...section.keys };
882
+ }
883
+ return JSON.stringify(obj, null, 2);
884
+ }
885
+ function jsonToIni(json) {
886
+ let parsed;
887
+ try {
888
+ parsed = JSON.parse(json);
889
+ } catch {
890
+ return { error: "Invalid JSON input" };
891
+ }
892
+ if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
893
+ return { error: "JSON must be a plain object" };
894
+ }
895
+ const globalLines = [];
896
+ const sectionLines = [];
897
+ for (const [key, value] of Object.entries(parsed)) {
898
+ if (typeof value === "object" && value !== null && !Array.isArray(value)) {
899
+ sectionLines.push(`[${key}]`);
900
+ for (const [k, v] of Object.entries(value)) {
901
+ sectionLines.push(`${k} = ${v}`);
902
+ }
903
+ sectionLines.push("");
904
+ } else {
905
+ globalLines.push(`${key} = ${value}`);
906
+ }
907
+ }
908
+ const parts = [...globalLines];
909
+ if (globalLines.length > 0 && sectionLines.length > 0) {
910
+ parts.push("");
911
+ }
912
+ parts.push(...sectionLines);
913
+ return parts.join("\n").trimEnd();
914
+ }
915
+ function getSection(parsed, name) {
916
+ const section = parsed.sections.find((s) => s.name === name);
917
+ return section ? { ...section.keys } : null;
918
+ }
919
+ function getSectionNames(parsed) {
920
+ return parsed.sections.filter((s) => s.name !== "").map((s) => s.name);
921
+ }
922
+ function validateIni(input) {
923
+ const errors = [];
924
+ if (typeof input !== "string") {
925
+ return { valid: false, errors: ["Input must be a string"] };
926
+ }
927
+ const lines = input.split("\n");
928
+ const seenKeys = {};
929
+ let currentSection = "";
930
+ for (let i = 0; i < lines.length; i++) {
931
+ const lineNum = i + 1;
932
+ const line = lines[i];
933
+ const trimmed = line.trim();
934
+ if (trimmed === "") continue;
935
+ if (trimmed.startsWith("#") || trimmed.startsWith(";")) continue;
936
+ if (trimmed.startsWith("[") && trimmed.endsWith("]")) {
937
+ currentSection = trimmed.slice(1, -1).trim();
938
+ if (!seenKeys[currentSection]) {
939
+ seenKeys[currentSection] = /* @__PURE__ */ new Set();
940
+ }
941
+ continue;
942
+ }
943
+ const eqIndex = trimmed.indexOf("=");
944
+ const colonIndex = trimmed.indexOf(":");
945
+ let sepIndex = -1;
946
+ if (eqIndex !== -1 && colonIndex !== -1) {
947
+ sepIndex = Math.min(eqIndex, colonIndex);
948
+ } else if (eqIndex !== -1) {
949
+ sepIndex = eqIndex;
950
+ } else if (colonIndex !== -1) {
951
+ sepIndex = colonIndex;
952
+ }
953
+ if (sepIndex !== -1) {
954
+ const key = trimmed.slice(0, sepIndex).trim();
955
+ if (!seenKeys[currentSection]) {
956
+ seenKeys[currentSection] = /* @__PURE__ */ new Set();
957
+ }
958
+ if (seenKeys[currentSection].has(key)) {
959
+ errors.push(
960
+ `Duplicate key "${key}" in section "${currentSection || "global"}" at line ${lineNum}`
961
+ );
962
+ } else {
963
+ seenKeys[currentSection].add(key);
964
+ }
965
+ } else {
966
+ errors.push(`Malformed line at line ${lineNum}: "${trimmed}"`);
967
+ }
968
+ }
969
+ return { valid: errors.length === 0, errors };
970
+ }
971
+ function parseEnv(input) {
972
+ const entries = [];
973
+ const comments = [];
974
+ const errors = [];
975
+ const keyCount = {};
976
+ const rawLines = input.split("\n");
977
+ const lines = [];
978
+ let i = 0;
979
+ while (i < rawLines.length) {
980
+ let line = rawLines[i];
981
+ while (line.endsWith("\\") && i + 1 < rawLines.length) {
982
+ line = line.slice(0, -1) + rawLines[i + 1];
983
+ i++;
984
+ }
985
+ lines.push(line);
986
+ i++;
987
+ }
988
+ for (let lineIdx = 0; lineIdx < lines.length; lineIdx++) {
989
+ const lineNum = lineIdx + 1;
990
+ const line = lines[lineIdx];
991
+ const trimmed = line.trim();
992
+ if (trimmed === "") continue;
993
+ if (trimmed.startsWith("#")) {
994
+ comments.push({ line: lineNum, text: trimmed.slice(1).trim() });
995
+ continue;
996
+ }
997
+ const eqIdx = trimmed.indexOf("=");
998
+ if (eqIdx === -1) {
999
+ errors.push({ line: lineNum, message: `Invalid line: missing '='` });
1000
+ continue;
1001
+ }
1002
+ const key = trimmed.slice(0, eqIdx).trim();
1003
+ if (!validateEnvKey(key)) {
1004
+ errors.push({ line: lineNum, message: `Invalid key: '${key}'` });
1005
+ continue;
1006
+ }
1007
+ const rest = trimmed.slice(eqIdx + 1);
1008
+ let value = "";
1009
+ let hasQuotes = false;
1010
+ let inlineComment;
1011
+ if (rest.startsWith('"')) {
1012
+ hasQuotes = true;
1013
+ const closeIdx = rest.indexOf('"', 1);
1014
+ if (closeIdx === -1) {
1015
+ errors.push({ line: lineNum, message: `Unclosed double quote for key '${key}'` });
1016
+ continue;
1017
+ }
1018
+ value = rest.slice(1, closeIdx);
1019
+ const afterQuote = rest.slice(closeIdx + 1).trim();
1020
+ if (afterQuote.startsWith("#")) {
1021
+ inlineComment = afterQuote.slice(1).trim();
1022
+ }
1023
+ } else if (rest.startsWith("'")) {
1024
+ hasQuotes = true;
1025
+ const closeIdx = rest.indexOf("'", 1);
1026
+ if (closeIdx === -1) {
1027
+ errors.push({ line: lineNum, message: `Unclosed single quote for key '${key}'` });
1028
+ continue;
1029
+ }
1030
+ value = rest.slice(1, closeIdx);
1031
+ const afterQuote = rest.slice(closeIdx + 1).trim();
1032
+ if (afterQuote.startsWith("#")) {
1033
+ inlineComment = afterQuote.slice(1).trim();
1034
+ }
1035
+ } else {
1036
+ const hashIdx = rest.indexOf("#");
1037
+ if (hashIdx !== -1) {
1038
+ inlineComment = rest.slice(hashIdx + 1).trim();
1039
+ value = rest.slice(0, hashIdx).trim();
1040
+ } else {
1041
+ value = rest.trim();
1042
+ }
1043
+ }
1044
+ const interpolated = /\$\{[^}]+\}/.test(value);
1045
+ keyCount[key] = (keyCount[key] ?? 0) + 1;
1046
+ const entry = {
1047
+ key,
1048
+ value,
1049
+ line: lineNum,
1050
+ hasQuotes,
1051
+ interpolated
1052
+ };
1053
+ if (inlineComment !== void 0) {
1054
+ entry.comment = inlineComment;
1055
+ }
1056
+ entries.push(entry);
1057
+ }
1058
+ const duplicates = Object.entries(keyCount).filter(([, count]) => count > 1).map(([key]) => key);
1059
+ return { entries, comments, errors, duplicates };
1060
+ }
1061
+ function envToJson(input) {
1062
+ const result = parseEnv(input);
1063
+ if (result.errors.length > 0) {
1064
+ return { error: result.errors.map((e) => `Line ${e.line}: ${e.message}`).join("; ") };
1065
+ }
1066
+ const obj = {};
1067
+ for (const entry of result.entries) {
1068
+ obj[entry.key] = entry.value;
1069
+ }
1070
+ return JSON.stringify(obj, null, 2);
1071
+ }
1072
+ function envToExport(input) {
1073
+ const result = parseEnv(input);
1074
+ return result.entries.map((entry) => `export ${entry.key}="${entry.value.replace(/"/g, '\\"')}"`).join("\n");
1075
+ }
1076
+ function validateEnvKey(key) {
1077
+ return /^[A-Za-z_][A-Za-z0-9_]*$/.test(key);
1078
+ }
1079
+
1080
+ export { csvToJson, data_exports, detectDelimiter, envToExport, envToJson, formatToml, formatXml, getSection, getSectionNames, getTomlStats, getXmlStats, getYamlStats, iniToJson, jsonToIni, jsonToToml, jsonToXml, minifyToml, minifyXml, parseCsv, parseEnv, parseIni, parseXmlToObject, stringifyIni, toCsvString, tomlToJson, validateEnvKey, validateIni, validateToml, validateXml, validateYaml, xmlToJson };