@design-edito/tools 0.2.6 → 0.2.8

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 (136) hide show
  1. package/agnostic/arrays/index.js +11 -11
  2. package/agnostic/arrays/random-pick/index.js +6 -6
  3. package/agnostic/colors/index.js +9 -9
  4. package/agnostic/css/bem/index.js +2 -2
  5. package/agnostic/css/index.js +19 -19
  6. package/agnostic/css/styles-set/index.js +8 -8
  7. package/agnostic/errors/index.js +2 -2
  8. package/agnostic/html/hyper-json/cast/index.js +4 -4
  9. package/agnostic/html/hyper-json/index.js +5 -5
  10. package/agnostic/html/hyper-json/smart-tags/coalesced/add/index.js +4 -4
  11. package/agnostic/html/hyper-json/smart-tags/coalesced/addclass/index.js +4 -4
  12. package/agnostic/html/hyper-json/smart-tags/coalesced/and/index.js +4 -4
  13. package/agnostic/html/hyper-json/smart-tags/coalesced/append/index.js +4 -4
  14. package/agnostic/html/hyper-json/smart-tags/coalesced/at/index.js +4 -4
  15. package/agnostic/html/hyper-json/smart-tags/coalesced/call/index.js +4 -4
  16. package/agnostic/html/hyper-json/smart-tags/coalesced/clone/index.js +4 -4
  17. package/agnostic/html/hyper-json/smart-tags/coalesced/deleteproperties/index.js +4 -4
  18. package/agnostic/html/hyper-json/smart-tags/coalesced/equals/index.js +4 -4
  19. package/agnostic/html/hyper-json/smart-tags/coalesced/getattribute/index.js +4 -4
  20. package/agnostic/html/hyper-json/smart-tags/coalesced/getproperties/index.js +4 -4
  21. package/agnostic/html/hyper-json/smart-tags/coalesced/getproperty/index.js +4 -4
  22. package/agnostic/html/hyper-json/smart-tags/coalesced/if/index.js +4 -4
  23. package/agnostic/html/hyper-json/smart-tags/coalesced/initialize/index.js +4 -4
  24. package/agnostic/html/hyper-json/smart-tags/coalesced/join/index.js +4 -4
  25. package/agnostic/html/hyper-json/smart-tags/coalesced/length/index.js +4 -4
  26. package/agnostic/html/hyper-json/smart-tags/coalesced/map/index.js +4 -4
  27. package/agnostic/html/hyper-json/smart-tags/coalesced/negate/index.js +4 -4
  28. package/agnostic/html/hyper-json/smart-tags/coalesced/notrailing/index.js +4 -4
  29. package/agnostic/html/hyper-json/smart-tags/coalesced/or/index.js +4 -4
  30. package/agnostic/html/hyper-json/smart-tags/coalesced/pickrandom/index.js +4 -4
  31. package/agnostic/html/hyper-json/smart-tags/coalesced/populate/index.js +4 -4
  32. package/agnostic/html/hyper-json/smart-tags/coalesced/print/index.js +4 -4
  33. package/agnostic/html/hyper-json/smart-tags/coalesced/push/index.js +4 -4
  34. package/agnostic/html/hyper-json/smart-tags/coalesced/pusheach/index.js +4 -4
  35. package/agnostic/html/hyper-json/smart-tags/coalesced/recordtoarray/index.js +4 -4
  36. package/agnostic/html/hyper-json/smart-tags/coalesced/removeattribute/index.js +4 -4
  37. package/agnostic/html/hyper-json/smart-tags/coalesced/removeclass/index.js +4 -4
  38. package/agnostic/html/hyper-json/smart-tags/coalesced/renameproperty/index.js +4 -4
  39. package/agnostic/html/hyper-json/smart-tags/coalesced/replace/index.js +4 -4
  40. package/agnostic/html/hyper-json/smart-tags/coalesced/select/index.js +4 -4
  41. package/agnostic/html/hyper-json/smart-tags/coalesced/set/index.js +4 -4
  42. package/agnostic/html/hyper-json/smart-tags/coalesced/setattribute/index.js +4 -4
  43. package/agnostic/html/hyper-json/smart-tags/coalesced/setproperty/index.js +4 -4
  44. package/agnostic/html/hyper-json/smart-tags/coalesced/sorton/index.js +4 -4
  45. package/agnostic/html/hyper-json/smart-tags/coalesced/split/index.js +4 -4
  46. package/agnostic/html/hyper-json/smart-tags/coalesced/spread/index.js +4 -4
  47. package/agnostic/html/hyper-json/smart-tags/coalesced/toarray/index.js +4 -4
  48. package/agnostic/html/hyper-json/smart-tags/coalesced/toboolean/index.js +4 -4
  49. package/agnostic/html/hyper-json/smart-tags/coalesced/toelement/index.js +4 -4
  50. package/agnostic/html/hyper-json/smart-tags/coalesced/toggleclass/index.js +4 -4
  51. package/agnostic/html/hyper-json/smart-tags/coalesced/tonodelist/index.js +4 -4
  52. package/agnostic/html/hyper-json/smart-tags/coalesced/tonull/index.js +4 -4
  53. package/agnostic/html/hyper-json/smart-tags/coalesced/tonumber/index.js +4 -4
  54. package/agnostic/html/hyper-json/smart-tags/coalesced/torecord/index.js +4 -4
  55. package/agnostic/html/hyper-json/smart-tags/coalesced/toref/index.js +4 -4
  56. package/agnostic/html/hyper-json/smart-tags/coalesced/tostring/index.js +4 -4
  57. package/agnostic/html/hyper-json/smart-tags/coalesced/totext/index.js +4 -4
  58. package/agnostic/html/hyper-json/smart-tags/coalesced/transformselected/index.js +4 -4
  59. package/agnostic/html/hyper-json/smart-tags/coalesced/trim/index.js +4 -4
  60. package/agnostic/html/hyper-json/smart-tags/isolated/boolean/index.js +4 -4
  61. package/agnostic/html/hyper-json/smart-tags/isolated/element/index.js +4 -4
  62. package/agnostic/html/hyper-json/smart-tags/isolated/get/index.js +4 -4
  63. package/agnostic/html/hyper-json/smart-tags/isolated/global/index.js +4 -4
  64. package/agnostic/html/hyper-json/smart-tags/isolated/guess/index.js +4 -4
  65. package/agnostic/html/hyper-json/smart-tags/isolated/nodelist/index.js +4 -4
  66. package/agnostic/html/hyper-json/smart-tags/isolated/number/index.js +4 -4
  67. package/agnostic/html/hyper-json/smart-tags/isolated/record/index.js +4 -4
  68. package/agnostic/html/hyper-json/smart-tags/isolated/ref/index.js +4 -4
  69. package/agnostic/html/hyper-json/smart-tags/isolated/string/index.js +4 -4
  70. package/agnostic/html/hyper-json/smart-tags/isolated/text/index.js +4 -4
  71. package/agnostic/html/hyper-json/tree/index.js +4 -4
  72. package/agnostic/html/hyper-json/utils/index.js +4 -4
  73. package/agnostic/html/index.js +13 -13
  74. package/agnostic/html/sanitize/index.js +6 -6
  75. package/agnostic/html/selector-to-element/index.js +6 -6
  76. package/agnostic/html/string-to-nodes/index.js +7 -7
  77. package/agnostic/misc/assert/index.js +3 -3
  78. package/agnostic/misc/crossenv/index.js +2 -2
  79. package/agnostic/misc/index.js +30 -30
  80. package/agnostic/misc/lorem-ipsum/index.js +15 -15
  81. package/agnostic/numbers/index.js +4 -4
  82. package/agnostic/objects/index.js +13 -13
  83. package/agnostic/random/index.js +2 -2
  84. package/agnostic/strings/index.js +16 -16
  85. package/agnostic/strings/parse-table/index.d.ts +32 -31
  86. package/agnostic/strings/parse-table/index.js +1 -3
  87. package/chunks/{chunk-Z3TF5XAN.js → chunk-32FNUJVW.js} +7 -7
  88. package/chunks/{chunk-CQEDNACN.js → chunk-36CTYZYA.js} +2 -2
  89. package/chunks/{chunk-VZ5NCIDH.js → chunk-3K3NHJZZ.js} +4 -4
  90. package/chunks/{chunk-XJ23DJY4.js → chunk-6KWNKTNI.js} +2 -2
  91. package/chunks/{chunk-C7SRAQMW.js → chunk-B446JIN3.js} +1 -1
  92. package/chunks/{chunk-P2H6PV4O.js → chunk-CHUOCTRP.js} +2 -2
  93. package/chunks/{chunk-LC3QKFGF.js → chunk-FJVSOGTY.js} +1 -1
  94. package/chunks/{chunk-62OUFTLX.js → chunk-JMFMBWLB.js} +5 -5
  95. package/chunks/{chunk-RDQJSWRC.js → chunk-JWF5EKM2.js} +1 -1
  96. package/chunks/{chunk-X5HMM3LD.js → chunk-SA2IY5LN.js} +1 -1
  97. package/chunks/{chunk-FESC3CF3.js → chunk-USMLAPA7.js} +21 -29
  98. package/chunks/{chunk-E4FJHD5R.js → chunk-WAMSK4A3.js} +1 -1
  99. package/chunks/{chunk-QGV62GWS.js → chunk-Y2LIJQVY.js} +2 -2
  100. package/node/@aws-s3/index.js +6 -6
  101. package/node/@aws-s3/storage/directory/index.js +4 -4
  102. package/node/@aws-s3/storage/file/index.js +7 -7
  103. package/node/@aws-s3/storage/index.js +6 -6
  104. package/node/@google-cloud/index.js +9 -9
  105. package/node/@google-cloud/storage/bucket/index.js +4 -4
  106. package/node/@google-cloud/storage/directory/index.js +4 -4
  107. package/node/@google-cloud/storage/file/index.js +12 -12
  108. package/node/@google-cloud/storage/index.js +11 -11
  109. package/node/cloud-storage/index.js +16 -16
  110. package/node/cloud-storage/operations/index.js +21 -21
  111. package/node/files/index.js +3 -3
  112. package/node/ftps/directory/index.js +4 -4
  113. package/node/ftps/file/index.js +7 -7
  114. package/node/ftps/index.js +5 -5
  115. package/node/images/index.js +8 -8
  116. package/node/images/transform/index.js +8 -8
  117. package/node/sftp/directory/index.js +4 -4
  118. package/node/sftp/file/index.js +7 -7
  119. package/node/sftp/index.js +5 -5
  120. package/package.json +1 -1
  121. package/chunks/{chunk-FYYLWTSR.js → chunk-4OK2UH4M.js} +3 -3
  122. package/chunks/{chunk-2GM4JNN6.js → chunk-646NPVCJ.js} +11 -11
  123. package/chunks/{chunk-IWZAUQGO.js → chunk-6T7A6ZNA.js} +6 -6
  124. package/chunks/{chunk-E3TOIVFR.js → chunk-74CFPDKM.js} +3 -3
  125. package/chunks/{chunk-WVZLCXVN.js → chunk-7KSMK42F.js} +3 -3
  126. package/chunks/{chunk-CATUHE6P.js → chunk-AIC5YAJU.js} +3 -3
  127. package/chunks/{chunk-INGSSBWK.js → chunk-DEQWCMAL.js} +6 -6
  128. package/chunks/{chunk-KBFSUJ57.js → chunk-JSW6R3ZH.js} +6 -6
  129. package/chunks/{chunk-7YW5HL6N.js → chunk-KIONYWA7.js} +3 -3
  130. package/chunks/{chunk-RLE5EX57.js → chunk-M72MN5UQ.js} +8 -8
  131. package/chunks/{chunk-S32K7POB.js → chunk-OVG5RGI3.js} +4 -4
  132. package/chunks/{chunk-X7HEBG3G.js → chunk-Q3WTFQUX.js} +22 -22
  133. package/chunks/{chunk-FR5H2OCV.js → chunk-UFKH5WD2.js} +3 -3
  134. package/chunks/{chunk-QJMBTRGK.js → chunk-UXEKCYL7.js} +3 -3
  135. package/chunks/{chunk-2KT7AKRW.js → chunk-WH6BPDAC.js} +3 -3
  136. package/chunks/{chunk-XMTCLFKS.js → chunk-WYQI4224.js} +9 -9
@@ -1,66 +1,71 @@
1
1
  import { Outcome } from '../../misc/outcome';
2
- type ParseTableOptionsDelimiterBased<T extends Record<string, string>> = {
2
+ export type ParseTableLineModeOptions<T extends Record<string, string>> = {
3
3
  inputToLines: (input: string) => string[];
4
4
  headLinePos: number;
5
5
  headLineToHeaders: (input: string) => string[];
6
6
  bodyLinesBounds: [number, number];
7
7
  bodyLineToCellValue: (input: string) => string[];
8
- schema: (obj: unknown) => T;
8
+ schema: (obj: unknown) => T | undefined;
9
9
  };
10
- type ParseTableOptionsColumnSlice<T extends Record<string, string>> = {
10
+ export type ParseTableColumnModeOptions<T extends Record<string, string>> = {
11
11
  inputToLines: (input: string) => string[];
12
12
  headLinePos: number;
13
13
  bodyLinesBounds: [number, number];
14
14
  columns: number[];
15
15
  headerRefine: (header: string) => string;
16
16
  valueRefine: (value: string) => string;
17
- schema: (obj: unknown) => T;
17
+ schema: (obj: unknown) => T | undefined;
18
18
  };
19
- export type ParseTableOptions<T extends Record<string, string>> = ParseTableOptionsDelimiterBased<T> | ParseTableOptionsColumnSlice<T>;
20
- export declare const defaultOptions: ParseTableOptions<any>;
19
+ export type ParseTableOptions<T extends Record<string, string>> = ParseTableLineModeOptions<T> | ParseTableColumnModeOptions<T>;
21
20
  /**
22
21
  * Parses a tabular string input into an array of objects, where each object represents a row in the table.
23
22
  *
24
23
  * There are two parsing modes:
25
24
  *
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`).
25
+ * 1. **Delimiter-based parsing** (default)
26
+ * - The table is split into rows and then into cells using functions such as splitting on `\n` and `\t`.
28
27
  * - The header row is parsed into an array of header names, which are mapped to each cell value.
28
+ * - Defaults: `inputToLines = s => s.split('\n')`, `headLinePos = 0`, `headLineToHeaders = h => h.split('\t')`,
29
+ * `bodyLinesBounds = [0, Infinity]`, `bodyLineToCellValue = r => r.split('\t')`.
29
30
  *
30
31
  * 2. **Column-slice parsing**
31
32
  * - The table is split into fixed-width columns based on start indices provided in `options.columns`.
32
33
  * - The header row and body rows are sliced using these column boundaries.
33
34
  * - Each header and cell value can be refined with user-provided functions.
35
+ * - Defaults: `inputToLines = s => s.split('\n')`, `headLinePos = 0`, `bodyLinesBounds = [1, Infinity]`,
36
+ * `headerRefine = h => h`, `valueRefine = v => v`.
34
37
  *
35
38
  * @template T - The type of the objects in the resulting array, extending `Record<string, string>`.
36
39
  * @param {string} table - The string representation of the table to be parsed.
37
- * @param {ParseTableOptions<T>} [options=defaultOptions] - Configuration options for parsing the table.
40
+ * @param {Partial<ParseTableOptions<T>> & { schema: (obj: unknown) => T }} options - Configuration options for parsing the table.
38
41
  *
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.
42
+ * ### Required
43
43
  * @param {function(unknown): T} options.schema - Function to validate and transform each row object.
44
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.
45
+ * ### Common (optional)
46
+ * @param {function(string): string[]} [options.inputToLines] - Function to split the input string into lines. Default: `s => s.split('\n')`.
47
+ * @param {number} [options.headLinePos] - Index of the header line. Default: `0`.
48
+ * @param {[number, number]} [options.bodyLinesBounds] - Tuple `[start, end]` indicating the range of lines to parse as body rows.
49
+ *
50
+ * ### Delimiter-based (optional, used when `columns` is not provided)
51
+ * @param {function(string): string[]} [options.headLineToHeaders] - Function to parse the header line into an array of header names. Default: `h => h.split('\t')`.
52
+ * @param {function(string): string[]} [options.bodyLineToCellValue] - Function to parse each body line into an array of cell values. Default: `r => r.split('\t')`.
48
53
  *
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.
54
+ * ### Column-slice (optional, used when `columns` is provided)
55
+ * @param {number[]} [options.columns] - Starting indices for each column. The last column extends to the end of the line.
56
+ * @param {function(string): string} [options.headerRefine] - Function to clean or normalize header names. Default: `h => h`.
57
+ * @param {function(string): string} [options.valueRefine] - Function to clean or normalize cell values. Default: `v => v`.
53
58
  *
54
- * @returns {Outcome.Either<T[], string>} An `Outcome` object containing either:
59
+ * @returns {Outcome.Either<T[], string>} An `Outcome` containing either:
55
60
  * - `success = true` with an array of parsed row objects, or
56
61
  * - `success = false` with an error message.
57
62
  *
58
- * @throws Will throw an error if the header line cannot be found.
63
+ * @throws Will return a failure outcome if the header line cannot be found.
59
64
  *
60
65
  * @example
61
- * // Delimiter-based parsing
66
+ * // Delimiter-based parsing (default)
62
67
  * const table = 'name\tage\nAlice\t30\nBob\t25';
63
- * const result = parseTable(table);
68
+ * const result = parseTable(table, { schema: row => row });
64
69
  * if (result.success) {
65
70
  * console.log(result.payload); // [{ name: 'Alice', age: '30' }, { name: 'Bob', age: '25' }]
66
71
  * }
@@ -69,13 +74,10 @@ export declare const defaultOptions: ParseTableOptions<any>;
69
74
  * // Column-slice parsing
70
75
  * const table = 'Name Age\nAlice 30 \nBob 25 ';
71
76
  * 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
77
+ * schema: row => row,
78
+ * columns: [0, 10, 15],
76
79
  * headerRefine: h => h.trim(),
77
- * valueRefine: v => v.trim(),
78
- * schema: row => row
80
+ * valueRefine: v => v.trim()
79
81
  * });
80
82
  * if (result.success) {
81
83
  * console.log(result.payload); // [{ Name: 'Alice', Age: '30' }, { Name: 'Bob', Age: '25' }]
@@ -84,4 +86,3 @@ export declare const defaultOptions: ParseTableOptions<any>;
84
86
  export declare function parseTable<T extends Record<string, string>>(table: string, _options: Partial<ParseTableOptions<T>> & {
85
87
  schema: (obj: unknown) => T;
86
88
  }): Outcome.Either<T[], string>;
87
- export {};
@@ -1,10 +1,8 @@
1
1
  import {
2
- defaultOptions,
3
2
  parseTable
4
- } from "../../../chunks/chunk-FESC3CF3.js";
3
+ } from "../../../chunks/chunk-USMLAPA7.js";
5
4
  import "../../../chunks/chunk-JMU5PDBD.js";
6
5
  import "../../../chunks/chunk-WSFCRVEQ.js";
7
6
  export {
8
- defaultOptions,
9
7
  parseTable
10
8
  };
@@ -1,19 +1,19 @@
1
- import {
2
- findDuplicates
3
- } from "./chunk-YS6WMSWC.js";
4
1
  import {
5
2
  make
6
3
  } from "./chunk-RLAZR3NL.js";
7
- import {
8
- isArrayOf
9
- } from "./chunk-6RGDWX4A.js";
10
4
  import {
11
5
  randomPick,
12
6
  randomPickMany
13
- } from "./chunk-C7SRAQMW.js";
7
+ } from "./chunk-B446JIN3.js";
14
8
  import {
15
9
  shuffle
16
10
  } from "./chunk-VJJIYJMY.js";
11
+ import {
12
+ findDuplicates
13
+ } from "./chunk-YS6WMSWC.js";
14
+ import {
15
+ isArrayOf
16
+ } from "./chunk-6RGDWX4A.js";
17
17
 
18
18
  // src/agnostic/arrays/index.tsx
19
19
  var Arrays;
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  Sanitize
3
- } from "./chunk-RDQJSWRC.js";
3
+ } from "./chunk-JWF5EKM2.js";
4
4
  import {
5
5
  register
6
- } from "./chunk-P2H6PV4O.js";
6
+ } from "./chunk-CHUOCTRP.js";
7
7
 
8
8
  // src/agnostic/html/string-to-nodes/index.ts
9
9
  function stringToNodes(dirtyStr, options) {
@@ -1,9 +1,9 @@
1
- import {
2
- Arrays
3
- } from "./chunk-Z3TF5XAN.js";
4
1
  import {
5
2
  Random
6
- } from "./chunk-S32K7POB.js";
3
+ } from "./chunk-OVG5RGI3.js";
4
+ import {
5
+ Arrays
6
+ } from "./chunk-32FNUJVW.js";
7
7
 
8
8
  // src/agnostic/misc/lorem-ipsum/index.ts
9
9
  var LoremIpsum;
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  Random
3
- } from "./chunk-S32K7POB.js";
3
+ } from "./chunk-OVG5RGI3.js";
4
4
  import {
5
5
  register
6
- } from "./chunk-P2H6PV4O.js";
6
+ } from "./chunk-CHUOCTRP.js";
7
7
 
8
8
  // src/agnostic/css/styles-set/index.tsx
9
9
  import { Component } from "react";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  register
3
- } from "./chunk-P2H6PV4O.js";
3
+ } from "./chunk-CHUOCTRP.js";
4
4
 
5
5
  // src/agnostic/arrays/random-pick/index.ts
6
6
  function randomPick(arr, exclude = []) {
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  Crossenv
3
- } from "./chunk-FR5H2OCV.js";
3
+ } from "./chunk-UFKH5WD2.js";
4
4
  import {
5
5
  Errors
6
- } from "./chunk-2KT7AKRW.js";
6
+ } from "./chunk-WH6BPDAC.js";
7
7
 
8
8
  // src/shared/errors/index.ts
9
9
  var register = Errors.Register.from({
@@ -2,7 +2,7 @@ import {
2
2
  Cast,
3
3
  Tree,
4
4
  Utils
5
- } from "./chunk-XMTCLFKS.js";
5
+ } from "./chunk-WYQI4224.js";
6
6
  import {
7
7
  Serialize
8
8
  } from "./chunk-SXRWMH3U.js";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  file_exports
3
- } from "./chunk-2GM4JNN6.js";
4
- import {
5
- directory_exports
6
- } from "./chunk-CATUHE6P.js";
3
+ } from "./chunk-646NPVCJ.js";
7
4
  import {
8
5
  bucket_exports
9
- } from "./chunk-QJMBTRGK.js";
6
+ } from "./chunk-UXEKCYL7.js";
7
+ import {
8
+ directory_exports
9
+ } from "./chunk-AIC5YAJU.js";
10
10
  import {
11
11
  __export
12
12
  } from "./chunk-WSFCRVEQ.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  register
3
- } from "./chunk-P2H6PV4O.js";
3
+ } from "./chunk-CHUOCTRP.js";
4
4
 
5
5
  // src/agnostic/html/sanitize/index.ts
6
6
  var Sanitize;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  register
3
- } from "./chunk-P2H6PV4O.js";
3
+ } from "./chunk-CHUOCTRP.js";
4
4
 
5
5
  // src/agnostic/html/selector-to-element/index.ts
6
6
  function selectorToElement(selector, documentObj) {
@@ -3,36 +3,25 @@ import {
3
3
  } from "./chunk-JMU5PDBD.js";
4
4
 
5
5
  // src/agnostic/strings/parse-table/index.ts
6
- var defaultOptions = {
6
+ var defaultLineModeOptions = {
7
7
  inputToLines: (i) => i.split("\n"),
8
8
  headLinePos: 0,
9
- headLineToHeaders: (i) => i.split(" "),
10
- bodyLinesBounds: [1, Infinity],
9
+ headLineToHeaders: (h) => h.split(" "),
10
+ bodyLinesBounds: [0, Infinity],
11
11
  bodyLineToCellValue: (i) => i.split(" "),
12
12
  schema: (i) => i
13
13
  };
14
+ var defaultColumnModeOptions = {
15
+ inputToLines: (i) => i.split("\n"),
16
+ headLinePos: 0,
17
+ bodyLinesBounds: [1, Infinity],
18
+ columns: [],
19
+ headerRefine: (h) => h,
20
+ valueRefine: (v) => v,
21
+ schema: (i) => i
22
+ };
14
23
  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
- }
24
+ const options = "columns" in _options ? { ...defaultColumnModeOptions, ..._options } : { ...defaultLineModeOptions, ..._options };
36
25
  const lines = options.inputToLines(table);
37
26
  const headLine = lines.at(options.headLinePos);
38
27
  if (headLine === void 0) return Outcome.makeFailure("Head line not found");
@@ -40,7 +29,8 @@ function parseTable(table, _options) {
40
29
  const headers = options.headLineToHeaders(headLine);
41
30
  const bodyLines = lines.slice(options.bodyLinesBounds[0], options.bodyLinesBounds[1]);
42
31
  const bodyLinesSplit = bodyLines.map(options.bodyLineToCellValue);
43
- const rows = bodyLinesSplit.map((line) => {
32
+ const rows = [];
33
+ bodyLinesSplit.forEach((line) => {
44
34
  const row = {};
45
35
  line.forEach((cell, cellPos) => {
46
36
  const cellName = headers.at(cellPos);
@@ -49,7 +39,8 @@ function parseTable(table, _options) {
49
39
  row[cellName] = cellValue;
50
40
  });
51
41
  const checked = options.schema(row);
52
- return checked;
42
+ if (checked === void 0) return;
43
+ rows.push(checked);
53
44
  });
54
45
  return Outcome.makeSuccess(rows);
55
46
  } else {
@@ -60,7 +51,8 @@ function parseTable(table, _options) {
60
51
  }, []);
61
52
  const bodyLines = lines.slice(options.bodyLinesBounds[0], options.bodyLinesBounds[1]);
62
53
  const headers = colBounds.map(([start, end]) => options.headerRefine(headLine.slice(start, end)));
63
- const rows = bodyLines.map((line) => {
54
+ const rows = [];
55
+ bodyLines.forEach((line) => {
64
56
  const row = {};
65
57
  colBounds.forEach(([start, end], colIndex) => {
66
58
  const header = headers.at(colIndex);
@@ -69,13 +61,13 @@ function parseTable(table, _options) {
69
61
  row[header] = cellValue;
70
62
  });
71
63
  const checked = options.schema(row);
72
- return checked;
64
+ if (checked === void 0) return;
65
+ rows.push(checked);
73
66
  });
74
67
  return Outcome.makeSuccess(rows);
75
68
  }
76
69
  }
77
70
 
78
71
  export {
79
- defaultOptions,
80
72
  parseTable
81
73
  };
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-JMU5PDBD.js";
4
4
  import {
5
5
  Errors
6
- } from "./chunk-2KT7AKRW.js";
6
+ } from "./chunk-WH6BPDAC.js";
7
7
 
8
8
  // src/agnostic/misc/assert/index.ts
9
9
  var Assert;
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  directory_exports
3
- } from "./chunk-FYYLWTSR.js";
3
+ } from "./chunk-4OK2UH4M.js";
4
4
  import {
5
5
  file_exports
6
- } from "./chunk-IWZAUQGO.js";
6
+ } from "./chunk-6T7A6ZNA.js";
7
7
  import {
8
8
  __export
9
9
  } from "./chunk-WSFCRVEQ.js";
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  storage_exports
3
- } from "../../chunks/chunk-QGV62GWS.js";
4
- import "../../chunks/chunk-FYYLWTSR.js";
5
- import "../../chunks/chunk-IWZAUQGO.js";
6
- import "../../chunks/chunk-QWZ4ZNFA.js";
3
+ } from "../../chunks/chunk-Y2LIJQVY.js";
4
+ import "../../chunks/chunk-4OK2UH4M.js";
5
+ import "../../chunks/chunk-6T7A6ZNA.js";
6
+ import "../../chunks/chunk-4XSDRT23.js";
7
7
  import "../../chunks/chunk-3TKBCG7Y.js";
8
8
  import "../../chunks/chunk-VROZGPC5.js";
9
9
  import "../../chunks/chunk-FD5WR2A5.js";
10
10
  import "../../chunks/chunk-4XBUJAQU.js";
11
- import "../../chunks/chunk-C6QTHDDM.js";
12
11
  import "../../chunks/chunk-IV75M3KE.js";
12
+ import "../../chunks/chunk-C6QTHDDM.js";
13
13
  import "../../chunks/chunk-ZEZCYPLQ.js";
14
14
  import "../../chunks/chunk-ZSUG52DO.js";
15
- import "../../chunks/chunk-4XSDRT23.js";
16
15
  import "../../chunks/chunk-ON6LC3HE.js";
16
+ import "../../chunks/chunk-QWZ4ZNFA.js";
17
17
  import "../../chunks/chunk-JMU5PDBD.js";
18
18
  import "../../chunks/chunk-FENXVJYO.js";
19
19
  import "../../chunks/chunk-WSFCRVEQ.js";
@@ -1,13 +1,13 @@
1
- import "../../../../chunks/chunk-FYYLWTSR.js";
1
+ import "../../../../chunks/chunk-4OK2UH4M.js";
2
+ import {
3
+ remove_dir_exports
4
+ } from "../../../../chunks/chunk-4XSDRT23.js";
2
5
  import {
3
6
  copy_dir_exports
4
7
  } from "../../../../chunks/chunk-4XBUJAQU.js";
5
8
  import {
6
9
  list_exports
7
10
  } from "../../../../chunks/chunk-ZSUG52DO.js";
8
- import {
9
- remove_dir_exports
10
- } from "../../../../chunks/chunk-4XSDRT23.js";
11
11
  import {
12
12
  move_dir_exports
13
13
  } from "../../../../chunks/chunk-ON6LC3HE.js";
@@ -1,7 +1,4 @@
1
- import "../../../../chunks/chunk-IWZAUQGO.js";
2
- import {
3
- move_exports
4
- } from "../../../../chunks/chunk-QWZ4ZNFA.js";
1
+ import "../../../../chunks/chunk-6T7A6ZNA.js";
5
2
  import {
6
3
  remove_exports
7
4
  } from "../../../../chunks/chunk-3TKBCG7Y.js";
@@ -11,15 +8,18 @@ import {
11
8
  import {
12
9
  upload_exports
13
10
  } from "../../../../chunks/chunk-FD5WR2A5.js";
14
- import {
15
- copy_exports
16
- } from "../../../../chunks/chunk-C6QTHDDM.js";
17
11
  import {
18
12
  download_exports
19
13
  } from "../../../../chunks/chunk-IV75M3KE.js";
14
+ import {
15
+ copy_exports
16
+ } from "../../../../chunks/chunk-C6QTHDDM.js";
20
17
  import {
21
18
  exists_exports
22
19
  } from "../../../../chunks/chunk-ZEZCYPLQ.js";
20
+ import {
21
+ move_exports
22
+ } from "../../../../chunks/chunk-QWZ4ZNFA.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-QGV62GWS.js";
1
+ import "../../../chunks/chunk-Y2LIJQVY.js";
2
2
  import {
3
3
  directory_exports
4
- } from "../../../chunks/chunk-FYYLWTSR.js";
4
+ } from "../../../chunks/chunk-4OK2UH4M.js";
5
5
  import {
6
6
  file_exports
7
- } from "../../../chunks/chunk-IWZAUQGO.js";
8
- import "../../../chunks/chunk-QWZ4ZNFA.js";
7
+ } from "../../../chunks/chunk-6T7A6ZNA.js";
8
+ import "../../../chunks/chunk-4XSDRT23.js";
9
9
  import "../../../chunks/chunk-3TKBCG7Y.js";
10
10
  import "../../../chunks/chunk-VROZGPC5.js";
11
11
  import "../../../chunks/chunk-FD5WR2A5.js";
12
12
  import "../../../chunks/chunk-4XBUJAQU.js";
13
- import "../../../chunks/chunk-C6QTHDDM.js";
14
13
  import "../../../chunks/chunk-IV75M3KE.js";
14
+ import "../../../chunks/chunk-C6QTHDDM.js";
15
15
  import "../../../chunks/chunk-ZEZCYPLQ.js";
16
16
  import "../../../chunks/chunk-ZSUG52DO.js";
17
- import "../../../chunks/chunk-4XSDRT23.js";
18
17
  import "../../../chunks/chunk-ON6LC3HE.js";
18
+ import "../../../chunks/chunk-QWZ4ZNFA.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-62OUFTLX.js";
4
- import "../../chunks/chunk-2GM4JNN6.js";
5
- import "../../chunks/chunk-G5RRNREY.js";
3
+ } from "../../chunks/chunk-JMFMBWLB.js";
4
+ import "../../chunks/chunk-646NPVCJ.js";
5
+ import "../../chunks/chunk-YKPA3MQL.js";
6
6
  import "../../chunks/chunk-HWVEI3RH.js";
7
+ import "../../chunks/chunk-G5RRNREY.js";
7
8
  import "../../chunks/chunk-PAIUCLVK.js";
8
9
  import "../../chunks/chunk-42K3MQQ5.js";
9
- import "../../chunks/chunk-YKPA3MQL.js";
10
- import "../../chunks/chunk-CATUHE6P.js";
11
- import "../../chunks/chunk-QJMBTRGK.js";
10
+ import "../../chunks/chunk-UXEKCYL7.js";
12
11
  import "../../chunks/chunk-ZNA7SWFK.js";
13
- import "../../chunks/chunk-6IYUA43Q.js";
12
+ import "../../chunks/chunk-AIC5YAJU.js";
13
+ import "../../chunks/chunk-QLDN574K.js";
14
14
  import "../../chunks/chunk-7J7CYOXU.js";
15
15
  import "../../chunks/chunk-W3RXHN5I.js";
16
16
  import "../../chunks/chunk-FB3GNE2B.js";
17
17
  import "../../chunks/chunk-V3L55I2S.js";
18
- import "../../chunks/chunk-CWZFRUBS.js";
19
18
  import "../../chunks/chunk-2JH4TCT2.js";
19
+ import "../../chunks/chunk-CWZFRUBS.js";
20
20
  import "../../chunks/chunk-5VHFXWFM.js";
21
21
  import "../../chunks/chunk-37TRFYZT.js";
22
- import "../../chunks/chunk-QLDN574K.js";
23
22
  import "../../chunks/chunk-BWYH445G.js";
23
+ import "../../chunks/chunk-6IYUA43Q.js";
24
24
  import "../../chunks/chunk-JMU5PDBD.js";
25
25
  import "../../chunks/chunk-FENXVJYO.js";
26
26
  import "../../chunks/chunk-WSFCRVEQ.js";
@@ -1,13 +1,13 @@
1
- import "../../../../chunks/chunk-QJMBTRGK.js";
1
+ import "../../../../chunks/chunk-UXEKCYL7.js";
2
2
  import {
3
3
  get_metadata_exports
4
4
  } from "../../../../chunks/chunk-ZNA7SWFK.js";
5
- import {
6
- list_exports
7
- } from "../../../../chunks/chunk-37TRFYZT.js";
8
5
  import {
9
6
  remove_dir_exports
10
7
  } from "../../../../chunks/chunk-QLDN574K.js";
8
+ import {
9
+ list_exports
10
+ } from "../../../../chunks/chunk-37TRFYZT.js";
11
11
  import {
12
12
  move_dir_exports
13
13
  } from "../../../../chunks/chunk-BWYH445G.js";
@@ -1,13 +1,13 @@
1
- import "../../../../chunks/chunk-CATUHE6P.js";
1
+ import "../../../../chunks/chunk-AIC5YAJU.js";
2
+ import {
3
+ remove_dir_exports
4
+ } from "../../../../chunks/chunk-QLDN574K.js";
2
5
  import {
3
6
  copy_dir_exports
4
7
  } from "../../../../chunks/chunk-V3L55I2S.js";
5
8
  import {
6
9
  list_exports
7
10
  } from "../../../../chunks/chunk-37TRFYZT.js";
8
- import {
9
- remove_dir_exports
10
- } from "../../../../chunks/chunk-QLDN574K.js";
11
11
  import {
12
12
  move_dir_exports
13
13
  } from "../../../../chunks/chunk-BWYH445G.js";
@@ -1,22 +1,19 @@
1
- import "../../../../chunks/chunk-2GM4JNN6.js";
1
+ import "../../../../chunks/chunk-646NPVCJ.js";
2
2
  import {
3
- revoke_signed_urls_exports
4
- } from "../../../../chunks/chunk-G5RRNREY.js";
3
+ get_permissions_exports
4
+ } from "../../../../chunks/chunk-YKPA3MQL.js";
5
5
  import {
6
6
  update_metadata_exports
7
7
  } from "../../../../chunks/chunk-HWVEI3RH.js";
8
+ import {
9
+ revoke_signed_urls_exports
10
+ } from "../../../../chunks/chunk-G5RRNREY.js";
8
11
  import {
9
12
  generate_signed_url_exports
10
13
  } from "../../../../chunks/chunk-PAIUCLVK.js";
11
14
  import {
12
15
  get_metadata_exports
13
16
  } from "../../../../chunks/chunk-42K3MQQ5.js";
14
- import {
15
- get_permissions_exports
16
- } from "../../../../chunks/chunk-YKPA3MQL.js";
17
- import {
18
- move_exports
19
- } from "../../../../chunks/chunk-6IYUA43Q.js";
20
17
  import {
21
18
  remove_exports
22
19
  } from "../../../../chunks/chunk-7J7CYOXU.js";
@@ -26,15 +23,18 @@ import {
26
23
  import {
27
24
  upload_exports
28
25
  } from "../../../../chunks/chunk-FB3GNE2B.js";
29
- import {
30
- copy_exports
31
- } from "../../../../chunks/chunk-CWZFRUBS.js";
32
26
  import {
33
27
  download_exports
34
28
  } from "../../../../chunks/chunk-2JH4TCT2.js";
29
+ import {
30
+ copy_exports
31
+ } from "../../../../chunks/chunk-CWZFRUBS.js";
35
32
  import {
36
33
  exists_exports
37
34
  } from "../../../../chunks/chunk-5VHFXWFM.js";
35
+ import {
36
+ move_exports
37
+ } from "../../../../chunks/chunk-6IYUA43Q.js";
38
38
  import "../../../../chunks/chunk-JMU5PDBD.js";
39
39
  import "../../../../chunks/chunk-FENXVJYO.js";
40
40
  import "../../../../chunks/chunk-WSFCRVEQ.js";