UNPKG

json-to-table-format

Version:
15 lines (14 loc) 573 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.jsontoTable = void 0; const lib_1 = require("./lib"); function jsontoTable(params, style = "simple") { const data = (0, lib_1.getData)(params); const headers = Object.keys(data[0]); const startPoints = (0, lib_1.getStartPoints)(data, headers); const rows = (0, lib_1.getRows)(data, headers, startPoints, style); return rows.join("\n"); } exports.jsontoTable = jsontoTable; // Export for both CommonJS and ES6 compatibility exports.default = jsontoTable;