@kadena/kadena-cli
Version:
Kadena CLI tool to interact with the Kadena blockchain (manage keys, transactions, etc.)
18 lines • 560 B
JavaScript
export const tableFormatPrompt = (choices) => {
const columnLengths = choices.reduce((acc, row) => {
row.name.forEach((column, i) => {
if (acc[i] === undefined)
acc[i] = 0;
if (column.length > acc[i])
acc[i] = column.length;
});
return acc;
}, []);
return choices.map((x) => {
return {
name: x.name.map((name, i) => name.padEnd(columnLengths[i])).join(' '),
value: x.value,
};
});
};
//# sourceMappingURL=tableDisplay.js.map