UNPKG

json-to-table-format

Version:
14 lines (11 loc) 473 B
import { getStartPoints, getRows, getData, TableStyle } from "./lib"; function jsontoTable(params: any, style: TableStyle = "simple"): string { const data = getData(params); const headers = Object.keys(data[0]); const startPoints = getStartPoints(data, headers); const rows = getRows(data, headers, startPoints, style); return rows.join("\n"); } // Export for both CommonJS and ES6 compatibility export default jsontoTable; export { jsontoTable };