@budibase/shared-core 3.13.7 → 3.13.9

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.
@@ -0,0 +1,27 @@
1
+ import { Row } from "@budibase/types";
2
+ /**
3
+ * Converts an array of rows to a CSV string.
4
+ * - Uses the provided columns to determine column order
5
+ * - Escapes values appropriately for CSV format
6
+ */
7
+ export declare function convertRowsToCsv(rows: Row[], columns: string[], delimiter?: string): string;
8
+ /**
9
+ * Converts an array of rows to a JSON string with pretty-printing.
10
+ */
11
+ export declare function convertRowsToJson(rows: Row[]): string;
12
+ /**
13
+ * Escapes a value for CSV export.
14
+ * - Wraps the value in quotes
15
+ * - Escapes any existing quotes by doubling them
16
+ * - Converts null/undefined to empty string
17
+ * - Converts objects to JSON strings
18
+ */
19
+ export declare function escapeCsvValue(value: unknown, delimiter?: string): string;
20
+ /**
21
+ * Converts data rows to the specified export format (CSV or JSON).
22
+ * - Builds normalized rows matching the schema keys
23
+ * - Delegates to specific format converters
24
+ */
25
+ export declare function convertDataToExportFormat(rows: Row[], format: "csv" | "json", columns?: {
26
+ name: string;
27
+ }[], delimiter?: string): string;
package/dist/index.d.ts CHANGED
@@ -8,3 +8,4 @@ export * from "./themes";
8
8
  export * as automations from "./automations";
9
9
  export * from "./ids";
10
10
  export * from "./login";
11
+ export * from "./helpers/rowsHelper";