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