(arr: Array<Record<string, unknown>>)
| 382 | } |
| 383 | |
| 384 | export function convertToMarkdownTable(arr: Array<Record<string, unknown>>) { |
| 385 | if (!arr || arr.length === 0) { |
| 386 | return ""; |
| 387 | } |
| 388 | |
| 389 | const headers = Object.keys(arr[0]); |
| 390 | const headerRow = `| ${headers.join(" | ")} |`; |
| 391 | const separatorRow = `| ${headers.map(() => "---").join(" | ")} |`; |
| 392 | |
| 393 | const dataRows = arr.map((obj) => { |
| 394 | const row = headers.map((header) => obj[header]); |
| 395 | return `| ${row.join(" | ")} |`; |
| 396 | }); |
| 397 | |
| 398 | return [headerRow, separatorRow, ...dataRows].join("\n"); |
| 399 | } |
| 400 | |
| 401 | export function convertToSafeBranchName(str: string) { |
| 402 | return str |
no outgoing calls
no test coverage detected