mirror of
https://github.com/supabase/supabase.git
synced 2026-07-03 20:54:33 +08:00
14 lines
364 B
TypeScript
14 lines
364 B
TypeScript
// @ts-ignore
|
|
import MarkdownTable from 'markdown-table'
|
|
|
|
export const getResultsMarkdown = (results: any[]) => {
|
|
const columns = Object.keys(results[0])
|
|
const rows = results.map((x: any) => {
|
|
const temp: any[] = []
|
|
columns.forEach((col) => temp.push(x[col]))
|
|
return temp
|
|
})
|
|
const table = [columns].concat(rows)
|
|
return MarkdownTable(table)
|
|
}
|