@design-edito/tools 0.2.4 → 0.2.6

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 (125) hide show
  1. package/agnostic/arrays/index.js +3 -3
  2. package/agnostic/colors/index.js +3 -3
  3. package/agnostic/css/index.js +13 -13
  4. package/agnostic/html/hyper-json/cast/index.js +3 -3
  5. package/agnostic/html/hyper-json/index.js +4 -4
  6. package/agnostic/html/hyper-json/smart-tags/coalesced/add/index.js +3 -3
  7. package/agnostic/html/hyper-json/smart-tags/coalesced/addclass/index.js +3 -3
  8. package/agnostic/html/hyper-json/smart-tags/coalesced/and/index.js +3 -3
  9. package/agnostic/html/hyper-json/smart-tags/coalesced/append/index.js +3 -3
  10. package/agnostic/html/hyper-json/smart-tags/coalesced/at/index.js +3 -3
  11. package/agnostic/html/hyper-json/smart-tags/coalesced/call/index.js +3 -3
  12. package/agnostic/html/hyper-json/smart-tags/coalesced/clone/index.js +3 -3
  13. package/agnostic/html/hyper-json/smart-tags/coalesced/deleteproperties/index.js +3 -3
  14. package/agnostic/html/hyper-json/smart-tags/coalesced/equals/index.js +3 -3
  15. package/agnostic/html/hyper-json/smart-tags/coalesced/getattribute/index.js +3 -3
  16. package/agnostic/html/hyper-json/smart-tags/coalesced/getproperties/index.js +3 -3
  17. package/agnostic/html/hyper-json/smart-tags/coalesced/getproperty/index.js +3 -3
  18. package/agnostic/html/hyper-json/smart-tags/coalesced/if/index.js +3 -3
  19. package/agnostic/html/hyper-json/smart-tags/coalesced/initialize/index.js +3 -3
  20. package/agnostic/html/hyper-json/smart-tags/coalesced/join/index.js +3 -3
  21. package/agnostic/html/hyper-json/smart-tags/coalesced/length/index.js +3 -3
  22. package/agnostic/html/hyper-json/smart-tags/coalesced/map/index.js +3 -3
  23. package/agnostic/html/hyper-json/smart-tags/coalesced/negate/index.js +3 -3
  24. package/agnostic/html/hyper-json/smart-tags/coalesced/notrailing/index.js +3 -3
  25. package/agnostic/html/hyper-json/smart-tags/coalesced/or/index.js +3 -3
  26. package/agnostic/html/hyper-json/smart-tags/coalesced/pickrandom/index.js +3 -3
  27. package/agnostic/html/hyper-json/smart-tags/coalesced/populate/index.js +3 -3
  28. package/agnostic/html/hyper-json/smart-tags/coalesced/print/index.js +3 -3
  29. package/agnostic/html/hyper-json/smart-tags/coalesced/push/index.js +3 -3
  30. package/agnostic/html/hyper-json/smart-tags/coalesced/pusheach/index.js +3 -3
  31. package/agnostic/html/hyper-json/smart-tags/coalesced/recordtoarray/index.js +3 -3
  32. package/agnostic/html/hyper-json/smart-tags/coalesced/removeattribute/index.js +3 -3
  33. package/agnostic/html/hyper-json/smart-tags/coalesced/removeclass/index.js +3 -3
  34. package/agnostic/html/hyper-json/smart-tags/coalesced/renameproperty/index.js +3 -3
  35. package/agnostic/html/hyper-json/smart-tags/coalesced/replace/index.js +3 -3
  36. package/agnostic/html/hyper-json/smart-tags/coalesced/select/index.js +3 -3
  37. package/agnostic/html/hyper-json/smart-tags/coalesced/set/index.js +3 -3
  38. package/agnostic/html/hyper-json/smart-tags/coalesced/setattribute/index.js +3 -3
  39. package/agnostic/html/hyper-json/smart-tags/coalesced/setproperty/index.js +3 -3
  40. package/agnostic/html/hyper-json/smart-tags/coalesced/sorton/index.js +3 -3
  41. package/agnostic/html/hyper-json/smart-tags/coalesced/split/index.js +3 -3
  42. package/agnostic/html/hyper-json/smart-tags/coalesced/spread/index.js +3 -3
  43. package/agnostic/html/hyper-json/smart-tags/coalesced/toarray/index.js +3 -3
  44. package/agnostic/html/hyper-json/smart-tags/coalesced/toboolean/index.js +3 -3
  45. package/agnostic/html/hyper-json/smart-tags/coalesced/toelement/index.js +3 -3
  46. package/agnostic/html/hyper-json/smart-tags/coalesced/toggleclass/index.js +3 -3
  47. package/agnostic/html/hyper-json/smart-tags/coalesced/tonodelist/index.js +3 -3
  48. package/agnostic/html/hyper-json/smart-tags/coalesced/tonull/index.js +3 -3
  49. package/agnostic/html/hyper-json/smart-tags/coalesced/tonumber/index.js +3 -3
  50. package/agnostic/html/hyper-json/smart-tags/coalesced/torecord/index.js +3 -3
  51. package/agnostic/html/hyper-json/smart-tags/coalesced/toref/index.js +3 -3
  52. package/agnostic/html/hyper-json/smart-tags/coalesced/tostring/index.js +3 -3
  53. package/agnostic/html/hyper-json/smart-tags/coalesced/totext/index.js +3 -3
  54. package/agnostic/html/hyper-json/smart-tags/coalesced/transformselected/index.js +3 -3
  55. package/agnostic/html/hyper-json/smart-tags/coalesced/trim/index.js +3 -3
  56. package/agnostic/html/hyper-json/smart-tags/isolated/boolean/index.js +3 -3
  57. package/agnostic/html/hyper-json/smart-tags/isolated/element/index.js +3 -3
  58. package/agnostic/html/hyper-json/smart-tags/isolated/get/index.js +3 -3
  59. package/agnostic/html/hyper-json/smart-tags/isolated/global/index.js +3 -3
  60. package/agnostic/html/hyper-json/smart-tags/isolated/guess/index.js +3 -3
  61. package/agnostic/html/hyper-json/smart-tags/isolated/nodelist/index.js +3 -3
  62. package/agnostic/html/hyper-json/smart-tags/isolated/number/index.js +3 -3
  63. package/agnostic/html/hyper-json/smart-tags/isolated/record/index.js +3 -3
  64. package/agnostic/html/hyper-json/smart-tags/isolated/ref/index.js +3 -3
  65. package/agnostic/html/hyper-json/smart-tags/isolated/string/index.js +3 -3
  66. package/agnostic/html/hyper-json/smart-tags/isolated/text/index.js +3 -3
  67. package/agnostic/html/hyper-json/tree/index.js +3 -3
  68. package/agnostic/html/hyper-json/utils/index.js +3 -3
  69. package/agnostic/html/index.js +4 -4
  70. package/agnostic/misc/index.js +19 -19
  71. package/agnostic/misc/lorem-ipsum/index.js +8 -8
  72. package/agnostic/numbers/index.js +6 -6
  73. package/agnostic/objects/index.js +12 -12
  74. package/agnostic/optim/index.js +3 -3
  75. package/agnostic/strings/index.d.ts +2 -2
  76. package/agnostic/strings/index.js +16 -16
  77. package/agnostic/strings/matches/index.d.ts +4 -3
  78. package/agnostic/strings/matches/index.js +1 -1
  79. package/agnostic/strings/parse-table/index.d.ts +87 -0
  80. package/agnostic/strings/{read-table → parse-table}/index.js +3 -3
  81. package/agnostic/time/index.js +4 -4
  82. package/chunks/{chunk-T4HGXBXC.js → chunk-62OUFTLX.js} +5 -5
  83. package/chunks/{chunk-HGCG2J77.js → chunk-F3WCF6DL.js} +1 -1
  84. package/chunks/chunk-FESC3CF3.js +81 -0
  85. package/chunks/{chunk-QHQ3WLN4.js → chunk-LC3QKFGF.js} +1 -1
  86. package/chunks/{chunk-K2SL55BG.js → chunk-QGV62GWS.js} +2 -2
  87. package/chunks/{chunk-LQFKUNVQ.js → chunk-R3AWQXMY.js} +1 -0
  88. package/chunks/{chunk-VQUF2TSY.js → chunk-VZ5NCIDH.js} +3 -3
  89. package/node/@aws-s3/index.js +7 -7
  90. package/node/@aws-s3/storage/directory/index.js +4 -4
  91. package/node/@aws-s3/storage/file/index.js +7 -7
  92. package/node/@aws-s3/storage/index.js +7 -7
  93. package/node/@google-cloud/index.js +9 -9
  94. package/node/@google-cloud/storage/bucket/index.js +4 -4
  95. package/node/@google-cloud/storage/directory/index.js +4 -4
  96. package/node/@google-cloud/storage/file/index.js +9 -9
  97. package/node/@google-cloud/storage/index.js +11 -11
  98. package/node/cloud-storage/index.js +21 -21
  99. package/node/cloud-storage/operations/index.js +28 -28
  100. package/node/files/index.js +5 -5
  101. package/node/files/subpaths/index.js +2 -2
  102. package/node/ftps/directory/index.js +4 -4
  103. package/node/ftps/file/index.js +7 -7
  104. package/node/ftps/index.js +6 -6
  105. package/node/images/index.js +4 -4
  106. package/node/images/transform/index.js +4 -4
  107. package/node/sftp/directory/index.js +4 -4
  108. package/node/sftp/file/index.js +7 -7
  109. package/node/sftp/index.js +6 -6
  110. package/package.json +1 -1
  111. package/agnostic/strings/read-table/index.d.ts +0 -38
  112. package/chunks/chunk-BLWSRM7I.js +0 -38
  113. package/chunks/{chunk-AIEEEZLK.js → chunk-2GM4JNN6.js} +8 -8
  114. package/chunks/{chunk-HJARCTOH.js → chunk-CATUHE6P.js} +3 -3
  115. package/chunks/{chunk-MUOULXIW.js → chunk-E3TOIVFR.js} +3 -3
  116. package/chunks/{chunk-2WIWINVL.js → chunk-FYYLWTSR.js} +3 -3
  117. package/chunks/{chunk-4ZPWZQVR.js → chunk-INGSSBWK.js} +6 -6
  118. package/chunks/{chunk-GFQMBB2J.js → chunk-IWZAUQGO.js} +6 -6
  119. package/chunks/{chunk-ZMR2PK34.js → chunk-KBFSUJ57.js} +6 -6
  120. package/chunks/{chunk-OMTDHKJI.js → chunk-QJMBTRGK.js} +3 -3
  121. package/chunks/{chunk-AMJDX7MB.js → chunk-RLE5EX57.js} +11 -11
  122. package/chunks/{chunk-42B5RQDS.js → chunk-WVZLCXVN.js} +3 -3
  123. package/chunks/{chunk-BJVLBGZH.js → chunk-X7HEBG3G.js} +10 -10
  124. package/chunks/{chunk-E4MMN22Y.js → chunk-XMTCLFKS.js} +6 -6
  125. package/chunks/{chunk-PENYZ6S7.js → chunk-Z3TF5XAN.js} +6 -6
@@ -1,10 +1,10 @@
1
- import {
2
- memoize
3
- } from "../../chunks/chunk-JWBDZPQG.js";
4
1
  import {
5
2
  debounce,
6
3
  throttle
7
4
  } from "../../chunks/chunk-VZDUZTW6.js";
5
+ import {
6
+ memoize
7
+ } from "../../chunks/chunk-JWBDZPQG.js";
8
8
  import "../../chunks/chunk-WSFCRVEQ.js";
9
9
 
10
10
  // src/agnostic/optim/index.ts
@@ -1,6 +1,6 @@
1
1
  import { CharCodes as CharCodesNamespace } from './char-codes';
2
2
  import { matches as matchesFunc, matchesSome as matchesSomeFunc, matchesEvery as matchesEveryFunc } from './matches';
3
- import { readTable as readTableFunc } from './read-table';
3
+ import { parseTable as parseTableFunc } from './parse-table';
4
4
  import { replaceAll as replaceAllFunc } from './replace-all';
5
5
  import { normalizeIndent as normalizeIndentFunc } from './normalize-indent';
6
6
  import { toAlphanum as toAlphanumFunc } from './to-alphanum';
@@ -11,7 +11,7 @@ export declare namespace Strings {
11
11
  const matchesSome: typeof matchesSomeFunc;
12
12
  const matchesEvery: typeof matchesEveryFunc;
13
13
  const normalizeIndent: typeof normalizeIndentFunc;
14
- const readTable: typeof readTableFunc;
14
+ const parseTable: typeof parseTableFunc;
15
15
  const replaceAll: typeof replaceAllFunc;
16
16
  const toAlphanum: typeof toAlphanumFunc;
17
17
  const trimStart: typeof trimStartFunc;
@@ -1,28 +1,28 @@
1
1
  import {
2
- normalizeIndent
3
- } from "../../chunks/chunk-JQXNEJAP.js";
2
+ replaceAll
3
+ } from "../../chunks/chunk-ZTDVUXPR.js";
4
4
  import {
5
- CharCodes
6
- } from "../../chunks/chunk-34U4HX4V.js";
5
+ toAlphanum
6
+ } from "../../chunks/chunk-COVPTTAD.js";
7
+ import {
8
+ trimEnd,
9
+ trimStart
10
+ } from "../../chunks/chunk-6XL25OZX.js";
7
11
  import {
8
- readTable
9
- } from "../../chunks/chunk-BLWSRM7I.js";
12
+ parseTable
13
+ } from "../../chunks/chunk-FESC3CF3.js";
10
14
  import "../../chunks/chunk-JMU5PDBD.js";
11
15
  import {
12
16
  matches,
13
17
  matchesEvery,
14
18
  matchesSome
15
- } from "../../chunks/chunk-LQFKUNVQ.js";
19
+ } from "../../chunks/chunk-R3AWQXMY.js";
16
20
  import {
17
- replaceAll
18
- } from "../../chunks/chunk-ZTDVUXPR.js";
19
- import {
20
- trimEnd,
21
- trimStart
22
- } from "../../chunks/chunk-6XL25OZX.js";
21
+ CharCodes
22
+ } from "../../chunks/chunk-34U4HX4V.js";
23
23
  import {
24
- toAlphanum
25
- } from "../../chunks/chunk-COVPTTAD.js";
24
+ normalizeIndent
25
+ } from "../../chunks/chunk-JQXNEJAP.js";
26
26
  import "../../chunks/chunk-WSFCRVEQ.js";
27
27
 
28
28
  // src/agnostic/strings/index.ts
@@ -33,7 +33,7 @@ var Strings;
33
33
  Strings2.matchesSome = matchesSome;
34
34
  Strings2.matchesEvery = matchesEvery;
35
35
  Strings2.normalizeIndent = normalizeIndent;
36
- Strings2.readTable = readTable;
36
+ Strings2.parseTable = parseTable;
37
37
  Strings2.replaceAll = replaceAll;
38
38
  Strings2.toAlphanum = toAlphanum;
39
39
  Strings2.trimStart = trimStart;
@@ -1,3 +1,4 @@
1
- export declare function matches(input: string, matcher: string | RegExp): boolean;
2
- export declare function matchesSome(input: string, matchers: string | RegExp | Array<string | RegExp>): boolean;
3
- export declare function matchesEvery(input: string, matchers: string | RegExp | Array<string | RegExp>): boolean;
1
+ export type Matcher = string | RegExp | ((input: string) => boolean);
2
+ export declare function matches(input: string, matcher: Matcher): boolean;
3
+ export declare function matchesSome(input: string, matchers: Matcher | Array<Matcher>): boolean;
4
+ export declare function matchesEvery(input: string, matchers: Matcher | Array<Matcher>): boolean;
@@ -2,7 +2,7 @@ import {
2
2
  matches,
3
3
  matchesEvery,
4
4
  matchesSome
5
- } from "../../../chunks/chunk-LQFKUNVQ.js";
5
+ } from "../../../chunks/chunk-R3AWQXMY.js";
6
6
  import "../../../chunks/chunk-WSFCRVEQ.js";
7
7
  export {
8
8
  matches,
@@ -0,0 +1,87 @@
1
+ import { Outcome } from '../../misc/outcome';
2
+ type ParseTableOptionsDelimiterBased<T extends Record<string, string>> = {
3
+ inputToLines: (input: string) => string[];
4
+ headLinePos: number;
5
+ headLineToHeaders: (input: string) => string[];
6
+ bodyLinesBounds: [number, number];
7
+ bodyLineToCellValue: (input: string) => string[];
8
+ schema: (obj: unknown) => T;
9
+ };
10
+ type ParseTableOptionsColumnSlice<T extends Record<string, string>> = {
11
+ inputToLines: (input: string) => string[];
12
+ headLinePos: number;
13
+ bodyLinesBounds: [number, number];
14
+ columns: number[];
15
+ headerRefine: (header: string) => string;
16
+ valueRefine: (value: string) => string;
17
+ schema: (obj: unknown) => T;
18
+ };
19
+ export type ParseTableOptions<T extends Record<string, string>> = ParseTableOptionsDelimiterBased<T> | ParseTableOptionsColumnSlice<T>;
20
+ export declare const defaultOptions: ParseTableOptions<any>;
21
+ /**
22
+ * Parses a tabular string input into an array of objects, where each object represents a row in the table.
23
+ *
24
+ * There are two parsing modes:
25
+ *
26
+ * 1. **Delimiter-based parsing**
27
+ * - The table is split into rows and then into cells using user-provided functions (e.g., splitting on `\n` and `\t`).
28
+ * - The header row is parsed into an array of header names, which are mapped to each cell value.
29
+ *
30
+ * 2. **Column-slice parsing**
31
+ * - The table is split into fixed-width columns based on start indices provided in `options.columns`.
32
+ * - The header row and body rows are sliced using these column boundaries.
33
+ * - Each header and cell value can be refined with user-provided functions.
34
+ *
35
+ * @template T - The type of the objects in the resulting array, extending `Record<string, string>`.
36
+ * @param {string} table - The string representation of the table to be parsed.
37
+ * @param {ParseTableOptions<T>} [options=defaultOptions] - Configuration options for parsing the table.
38
+ *
39
+ * ### Common Options
40
+ * @param {function(string): string[]} options.inputToLines - Function to split the input string into lines.
41
+ * @param {number} options.headLinePos - The index of the header line in the lines array.
42
+ * @param {[number, number]} options.bodyLinesBounds - Tuple `[start, end]` indicating the range of lines to parse as body rows.
43
+ * @param {function(unknown): T} options.schema - Function to validate and transform each row object.
44
+ *
45
+ * ### Delimiter-based Options
46
+ * @param {function(string): string[]} options.headLineToHeaders - Function to parse the header line into an array of header names.
47
+ * @param {function(string): string[]} options.bodyLineToCellValue - Function to parse each body line into an array of cell values.
48
+ *
49
+ * ### Column-slice Options
50
+ * @param {number[]} options.columns - An array of starting indices for each column. The last column extends to the end of the line.
51
+ * @param {function(string): string} options.headerRefine - Function to clean or normalize header names.
52
+ * @param {function(string): string} options.valueRefine - Function to clean or normalize cell values.
53
+ *
54
+ * @returns {Outcome.Either<T[], string>} An `Outcome` object containing either:
55
+ * - `success = true` with an array of parsed row objects, or
56
+ * - `success = false` with an error message.
57
+ *
58
+ * @throws Will throw an error if the header line cannot be found.
59
+ *
60
+ * @example
61
+ * // Delimiter-based parsing
62
+ * const table = 'name\tage\nAlice\t30\nBob\t25';
63
+ * const result = parseTable(table);
64
+ * if (result.success) {
65
+ * console.log(result.payload); // [{ name: 'Alice', age: '30' }, { name: 'Bob', age: '25' }]
66
+ * }
67
+ *
68
+ * @example
69
+ * // Column-slice parsing
70
+ * const table = 'Name Age\nAlice 30 \nBob 25 ';
71
+ * const result = parseTable(table, {
72
+ * inputToLines: i => i.split('\n'),
73
+ * headLinePos: 0,
74
+ * bodyLinesBounds: [1, Infinity],
75
+ * columns: [0, 10, 15], // start indices for each column
76
+ * headerRefine: h => h.trim(),
77
+ * valueRefine: v => v.trim(),
78
+ * schema: row => row
79
+ * });
80
+ * if (result.success) {
81
+ * console.log(result.payload); // [{ Name: 'Alice', Age: '30' }, { Name: 'Bob', Age: '25' }]
82
+ * }
83
+ */
84
+ export declare function parseTable<T extends Record<string, string>>(table: string, _options: Partial<ParseTableOptions<T>> & {
85
+ schema: (obj: unknown) => T;
86
+ }): Outcome.Either<T[], string>;
87
+ export {};
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  defaultOptions,
3
- readTable
4
- } from "../../../chunks/chunk-BLWSRM7I.js";
3
+ parseTable
4
+ } from "../../../chunks/chunk-FESC3CF3.js";
5
5
  import "../../../chunks/chunk-JMU5PDBD.js";
6
6
  import "../../../chunks/chunk-WSFCRVEQ.js";
7
7
  export {
8
8
  defaultOptions,
9
- readTable
9
+ parseTable
10
10
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
- Duration
3
- } from "../../chunks/chunk-6NYUQXJT.js";
2
+ timeout
3
+ } from "../../chunks/chunk-Z7ZDDBV5.js";
4
4
  import {
5
5
  Transitions
6
6
  } from "../../chunks/chunk-ENMBK6H7.js";
@@ -9,8 +9,8 @@ import {
9
9
  } from "../../chunks/chunk-FZOU4OAW.js";
10
10
  import "../../chunks/chunk-YQWZ3EP2.js";
11
11
  import {
12
- timeout
13
- } from "../../chunks/chunk-Z7ZDDBV5.js";
12
+ Duration
13
+ } from "../../chunks/chunk-6NYUQXJT.js";
14
14
  import {
15
15
  wait
16
16
  } from "../../chunks/chunk-4CIS3R7T.js";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  file_exports
3
- } from "./chunk-AIEEEZLK.js";
4
- import {
5
- bucket_exports
6
- } from "./chunk-OMTDHKJI.js";
3
+ } from "./chunk-2GM4JNN6.js";
7
4
  import {
8
5
  directory_exports
9
- } from "./chunk-HJARCTOH.js";
6
+ } from "./chunk-CATUHE6P.js";
7
+ import {
8
+ bucket_exports
9
+ } from "./chunk-QJMBTRGK.js";
10
10
  import {
11
11
  __export
12
12
  } from "./chunk-WSFCRVEQ.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  matchesSome
3
- } from "./chunk-LQFKUNVQ.js";
3
+ } from "./chunk-R3AWQXMY.js";
4
4
 
5
5
  // src/node/files/subpaths/index.ts
6
6
  import { promises as fs } from "node:fs";
@@ -0,0 +1,81 @@
1
+ import {
2
+ Outcome
3
+ } from "./chunk-JMU5PDBD.js";
4
+
5
+ // src/agnostic/strings/parse-table/index.ts
6
+ var defaultOptions = {
7
+ inputToLines: (i) => i.split("\n"),
8
+ headLinePos: 0,
9
+ headLineToHeaders: (i) => i.split(" "),
10
+ bodyLinesBounds: [1, Infinity],
11
+ bodyLineToCellValue: (i) => i.split(" "),
12
+ schema: (i) => i
13
+ };
14
+ function parseTable(table, _options) {
15
+ let options;
16
+ if ("columns" in _options) {
17
+ options = {
18
+ inputToLines: (i) => i.split("\n"),
19
+ headLinePos: 0,
20
+ bodyLinesBounds: [1, Infinity],
21
+ columns: [],
22
+ headerRefine: (h) => h,
23
+ valueRefine: (v) => v,
24
+ ..._options
25
+ };
26
+ } else {
27
+ options = {
28
+ inputToLines: (i) => i.split("\n"),
29
+ headLinePos: 0,
30
+ headLineToHeaders: (h) => h.split(" "),
31
+ bodyLinesBounds: [0, Infinity],
32
+ bodyLineToCellValue: (i) => i.split(" "),
33
+ ..._options
34
+ };
35
+ }
36
+ const lines = options.inputToLines(table);
37
+ const headLine = lines.at(options.headLinePos);
38
+ if (headLine === void 0) return Outcome.makeFailure("Head line not found");
39
+ if ("headLineToHeaders" in options) {
40
+ const headers = options.headLineToHeaders(headLine);
41
+ const bodyLines = lines.slice(options.bodyLinesBounds[0], options.bodyLinesBounds[1]);
42
+ const bodyLinesSplit = bodyLines.map(options.bodyLineToCellValue);
43
+ const rows = bodyLinesSplit.map((line) => {
44
+ const row = {};
45
+ line.forEach((cell, cellPos) => {
46
+ const cellName = headers.at(cellPos);
47
+ if (cellName === void 0) return;
48
+ const cellValue = cell;
49
+ row[cellName] = cellValue;
50
+ });
51
+ const checked = options.schema(row);
52
+ return checked;
53
+ });
54
+ return Outcome.makeSuccess(rows);
55
+ } else {
56
+ const colBounds = options.columns.reduce((acc, colStartPos, colIndex) => {
57
+ const nextColStartPos = options.columns.at(colIndex + 1);
58
+ if (nextColStartPos === void 0) return [...acc, [colStartPos, Infinity]];
59
+ return [...acc, [colStartPos, nextColStartPos]];
60
+ }, []);
61
+ const bodyLines = lines.slice(options.bodyLinesBounds[0], options.bodyLinesBounds[1]);
62
+ const headers = colBounds.map(([start, end]) => options.headerRefine(headLine.slice(start, end)));
63
+ const rows = bodyLines.map((line) => {
64
+ const row = {};
65
+ colBounds.forEach(([start, end], colIndex) => {
66
+ const header = headers.at(colIndex);
67
+ if (header === void 0) return;
68
+ const cellValue = line.slice(start, end);
69
+ row[header] = cellValue;
70
+ });
71
+ const checked = options.schema(row);
72
+ return checked;
73
+ });
74
+ return Outcome.makeSuccess(rows);
75
+ }
76
+ }
77
+
78
+ export {
79
+ defaultOptions,
80
+ parseTable
81
+ };
@@ -2,7 +2,7 @@ import {
2
2
  Cast,
3
3
  Tree,
4
4
  Utils
5
- } from "./chunk-E4MMN22Y.js";
5
+ } from "./chunk-XMTCLFKS.js";
6
6
  import {
7
7
  Serialize
8
8
  } from "./chunk-SXRWMH3U.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  directory_exports
3
- } from "./chunk-2WIWINVL.js";
3
+ } from "./chunk-FYYLWTSR.js";
4
4
  import {
5
5
  file_exports
6
- } from "./chunk-GFQMBB2J.js";
6
+ } from "./chunk-IWZAUQGO.js";
7
7
  import {
8
8
  __export
9
9
  } from "./chunk-WSFCRVEQ.js";
@@ -1,6 +1,7 @@
1
1
  // src/agnostic/strings/matches/index.ts
2
2
  function matches(input, matcher) {
3
3
  if (typeof matcher === "string") return input === matcher;
4
+ if (typeof matcher === "function") return matcher(input);
4
5
  return input.match(matcher) !== null;
5
6
  }
6
7
  function matchesSome(input, matchers) {
@@ -1,9 +1,9 @@
1
+ import {
2
+ Arrays
3
+ } from "./chunk-Z3TF5XAN.js";
1
4
  import {
2
5
  Random
3
6
  } from "./chunk-S32K7POB.js";
4
- import {
5
- Arrays
6
- } from "./chunk-PENYZ6S7.js";
7
7
 
8
8
  // src/agnostic/misc/lorem-ipsum/index.ts
9
9
  var LoremIpsum;
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  storage_exports
3
- } from "../../chunks/chunk-K2SL55BG.js";
4
- import "../../chunks/chunk-2WIWINVL.js";
5
- import "../../chunks/chunk-GFQMBB2J.js";
6
- import "../../chunks/chunk-3TKBCG7Y.js";
3
+ } from "../../chunks/chunk-QGV62GWS.js";
4
+ import "../../chunks/chunk-FYYLWTSR.js";
5
+ import "../../chunks/chunk-IWZAUQGO.js";
7
6
  import "../../chunks/chunk-QWZ4ZNFA.js";
7
+ import "../../chunks/chunk-3TKBCG7Y.js";
8
8
  import "../../chunks/chunk-VROZGPC5.js";
9
9
  import "../../chunks/chunk-FD5WR2A5.js";
10
- import "../../chunks/chunk-C6QTHDDM.js";
11
- import "../../chunks/chunk-ZEZCYPLQ.js";
12
10
  import "../../chunks/chunk-4XBUJAQU.js";
11
+ import "../../chunks/chunk-C6QTHDDM.js";
13
12
  import "../../chunks/chunk-IV75M3KE.js";
14
- import "../../chunks/chunk-ON6LC3HE.js";
13
+ import "../../chunks/chunk-ZEZCYPLQ.js";
15
14
  import "../../chunks/chunk-ZSUG52DO.js";
16
15
  import "../../chunks/chunk-4XSDRT23.js";
16
+ import "../../chunks/chunk-ON6LC3HE.js";
17
17
  import "../../chunks/chunk-JMU5PDBD.js";
18
18
  import "../../chunks/chunk-FENXVJYO.js";
19
19
  import "../../chunks/chunk-WSFCRVEQ.js";
@@ -1,16 +1,16 @@
1
- import "../../../../chunks/chunk-2WIWINVL.js";
1
+ import "../../../../chunks/chunk-FYYLWTSR.js";
2
2
  import {
3
3
  copy_dir_exports
4
4
  } from "../../../../chunks/chunk-4XBUJAQU.js";
5
- import {
6
- move_dir_exports
7
- } from "../../../../chunks/chunk-ON6LC3HE.js";
8
5
  import {
9
6
  list_exports
10
7
  } from "../../../../chunks/chunk-ZSUG52DO.js";
11
8
  import {
12
9
  remove_dir_exports
13
10
  } from "../../../../chunks/chunk-4XSDRT23.js";
11
+ import {
12
+ move_dir_exports
13
+ } from "../../../../chunks/chunk-ON6LC3HE.js";
14
14
  import "../../../../chunks/chunk-JMU5PDBD.js";
15
15
  import "../../../../chunks/chunk-FENXVJYO.js";
16
16
  import "../../../../chunks/chunk-WSFCRVEQ.js";
@@ -1,10 +1,10 @@
1
- import "../../../../chunks/chunk-GFQMBB2J.js";
2
- import {
3
- remove_exports
4
- } from "../../../../chunks/chunk-3TKBCG7Y.js";
1
+ import "../../../../chunks/chunk-IWZAUQGO.js";
5
2
  import {
6
3
  move_exports
7
4
  } from "../../../../chunks/chunk-QWZ4ZNFA.js";
5
+ import {
6
+ remove_exports
7
+ } from "../../../../chunks/chunk-3TKBCG7Y.js";
8
8
  import {
9
9
  stat_exports
10
10
  } from "../../../../chunks/chunk-VROZGPC5.js";
@@ -14,12 +14,12 @@ import {
14
14
  import {
15
15
  copy_exports
16
16
  } from "../../../../chunks/chunk-C6QTHDDM.js";
17
- import {
18
- exists_exports
19
- } from "../../../../chunks/chunk-ZEZCYPLQ.js";
20
17
  import {
21
18
  download_exports
22
19
  } from "../../../../chunks/chunk-IV75M3KE.js";
20
+ import {
21
+ exists_exports
22
+ } from "../../../../chunks/chunk-ZEZCYPLQ.js";
23
23
  import "../../../../chunks/chunk-JMU5PDBD.js";
24
24
  import "../../../../chunks/chunk-FENXVJYO.js";
25
25
  import "../../../../chunks/chunk-WSFCRVEQ.js";
@@ -1,21 +1,21 @@
1
- import "../../../chunks/chunk-K2SL55BG.js";
1
+ import "../../../chunks/chunk-QGV62GWS.js";
2
2
  import {
3
3
  directory_exports
4
- } from "../../../chunks/chunk-2WIWINVL.js";
4
+ } from "../../../chunks/chunk-FYYLWTSR.js";
5
5
  import {
6
6
  file_exports
7
- } from "../../../chunks/chunk-GFQMBB2J.js";
8
- import "../../../chunks/chunk-3TKBCG7Y.js";
7
+ } from "../../../chunks/chunk-IWZAUQGO.js";
9
8
  import "../../../chunks/chunk-QWZ4ZNFA.js";
9
+ import "../../../chunks/chunk-3TKBCG7Y.js";
10
10
  import "../../../chunks/chunk-VROZGPC5.js";
11
11
  import "../../../chunks/chunk-FD5WR2A5.js";
12
- import "../../../chunks/chunk-C6QTHDDM.js";
13
- import "../../../chunks/chunk-ZEZCYPLQ.js";
14
12
  import "../../../chunks/chunk-4XBUJAQU.js";
13
+ import "../../../chunks/chunk-C6QTHDDM.js";
15
14
  import "../../../chunks/chunk-IV75M3KE.js";
16
- import "../../../chunks/chunk-ON6LC3HE.js";
15
+ import "../../../chunks/chunk-ZEZCYPLQ.js";
17
16
  import "../../../chunks/chunk-ZSUG52DO.js";
18
17
  import "../../../chunks/chunk-4XSDRT23.js";
18
+ import "../../../chunks/chunk-ON6LC3HE.js";
19
19
  import "../../../chunks/chunk-JMU5PDBD.js";
20
20
  import "../../../chunks/chunk-FENXVJYO.js";
21
21
  import "../../../chunks/chunk-WSFCRVEQ.js";
@@ -1,26 +1,26 @@
1
1
  import {
2
2
  storage_exports
3
- } from "../../chunks/chunk-T4HGXBXC.js";
4
- import "../../chunks/chunk-AIEEEZLK.js";
3
+ } from "../../chunks/chunk-62OUFTLX.js";
4
+ import "../../chunks/chunk-2GM4JNN6.js";
5
5
  import "../../chunks/chunk-G5RRNREY.js";
6
6
  import "../../chunks/chunk-HWVEI3RH.js";
7
- import "../../chunks/chunk-YKPA3MQL.js";
8
7
  import "../../chunks/chunk-PAIUCLVK.js";
9
8
  import "../../chunks/chunk-42K3MQQ5.js";
10
- import "../../chunks/chunk-OMTDHKJI.js";
9
+ import "../../chunks/chunk-YKPA3MQL.js";
10
+ import "../../chunks/chunk-CATUHE6P.js";
11
+ import "../../chunks/chunk-QJMBTRGK.js";
11
12
  import "../../chunks/chunk-ZNA7SWFK.js";
12
- import "../../chunks/chunk-HJARCTOH.js";
13
- import "../../chunks/chunk-7J7CYOXU.js";
14
13
  import "../../chunks/chunk-6IYUA43Q.js";
14
+ import "../../chunks/chunk-7J7CYOXU.js";
15
15
  import "../../chunks/chunk-W3RXHN5I.js";
16
16
  import "../../chunks/chunk-FB3GNE2B.js";
17
- import "../../chunks/chunk-CWZFRUBS.js";
18
- import "../../chunks/chunk-5VHFXWFM.js";
19
17
  import "../../chunks/chunk-V3L55I2S.js";
18
+ import "../../chunks/chunk-CWZFRUBS.js";
20
19
  import "../../chunks/chunk-2JH4TCT2.js";
21
- import "../../chunks/chunk-BWYH445G.js";
20
+ import "../../chunks/chunk-5VHFXWFM.js";
22
21
  import "../../chunks/chunk-37TRFYZT.js";
23
22
  import "../../chunks/chunk-QLDN574K.js";
23
+ import "../../chunks/chunk-BWYH445G.js";
24
24
  import "../../chunks/chunk-JMU5PDBD.js";
25
25
  import "../../chunks/chunk-FENXVJYO.js";
26
26
  import "../../chunks/chunk-WSFCRVEQ.js";
@@ -1,16 +1,16 @@
1
- import "../../../../chunks/chunk-OMTDHKJI.js";
1
+ import "../../../../chunks/chunk-QJMBTRGK.js";
2
2
  import {
3
3
  get_metadata_exports
4
4
  } from "../../../../chunks/chunk-ZNA7SWFK.js";
5
- import {
6
- move_dir_exports
7
- } from "../../../../chunks/chunk-BWYH445G.js";
8
5
  import {
9
6
  list_exports
10
7
  } from "../../../../chunks/chunk-37TRFYZT.js";
11
8
  import {
12
9
  remove_dir_exports
13
10
  } from "../../../../chunks/chunk-QLDN574K.js";
11
+ import {
12
+ move_dir_exports
13
+ } from "../../../../chunks/chunk-BWYH445G.js";
14
14
  import "../../../../chunks/chunk-JMU5PDBD.js";
15
15
  import "../../../../chunks/chunk-FENXVJYO.js";
16
16
  import "../../../../chunks/chunk-WSFCRVEQ.js";
@@ -1,16 +1,16 @@
1
- import "../../../../chunks/chunk-HJARCTOH.js";
1
+ import "../../../../chunks/chunk-CATUHE6P.js";
2
2
  import {
3
3
  copy_dir_exports
4
4
  } from "../../../../chunks/chunk-V3L55I2S.js";
5
- import {
6
- move_dir_exports
7
- } from "../../../../chunks/chunk-BWYH445G.js";
8
5
  import {
9
6
  list_exports
10
7
  } from "../../../../chunks/chunk-37TRFYZT.js";
11
8
  import {
12
9
  remove_dir_exports
13
10
  } from "../../../../chunks/chunk-QLDN574K.js";
11
+ import {
12
+ move_dir_exports
13
+ } from "../../../../chunks/chunk-BWYH445G.js";
14
14
  import "../../../../chunks/chunk-JMU5PDBD.js";
15
15
  import "../../../../chunks/chunk-FENXVJYO.js";
16
16
  import "../../../../chunks/chunk-WSFCRVEQ.js";
@@ -1,13 +1,10 @@
1
- import "../../../../chunks/chunk-AIEEEZLK.js";
1
+ import "../../../../chunks/chunk-2GM4JNN6.js";
2
2
  import {
3
3
  revoke_signed_urls_exports
4
4
  } from "../../../../chunks/chunk-G5RRNREY.js";
5
5
  import {
6
6
  update_metadata_exports
7
7
  } from "../../../../chunks/chunk-HWVEI3RH.js";
8
- import {
9
- get_permissions_exports
10
- } from "../../../../chunks/chunk-YKPA3MQL.js";
11
8
  import {
12
9
  generate_signed_url_exports
13
10
  } from "../../../../chunks/chunk-PAIUCLVK.js";
@@ -15,11 +12,14 @@ import {
15
12
  get_metadata_exports
16
13
  } from "../../../../chunks/chunk-42K3MQQ5.js";
17
14
  import {
18
- remove_exports
19
- } from "../../../../chunks/chunk-7J7CYOXU.js";
15
+ get_permissions_exports
16
+ } from "../../../../chunks/chunk-YKPA3MQL.js";
20
17
  import {
21
18
  move_exports
22
19
  } from "../../../../chunks/chunk-6IYUA43Q.js";
20
+ import {
21
+ remove_exports
22
+ } from "../../../../chunks/chunk-7J7CYOXU.js";
23
23
  import {
24
24
  stat_exports
25
25
  } from "../../../../chunks/chunk-W3RXHN5I.js";
@@ -29,12 +29,12 @@ import {
29
29
  import {
30
30
  copy_exports
31
31
  } from "../../../../chunks/chunk-CWZFRUBS.js";
32
- import {
33
- exists_exports
34
- } from "../../../../chunks/chunk-5VHFXWFM.js";
35
32
  import {
36
33
  download_exports
37
34
  } from "../../../../chunks/chunk-2JH4TCT2.js";
35
+ import {
36
+ exists_exports
37
+ } from "../../../../chunks/chunk-5VHFXWFM.js";
38
38
  import "../../../../chunks/chunk-JMU5PDBD.js";
39
39
  import "../../../../chunks/chunk-FENXVJYO.js";
40
40
  import "../../../../chunks/chunk-WSFCRVEQ.js";