UNPKG

@atlaskit/renderer

Version:
24 lines 650 B
import { reduce } from './'; var table = function table(node, schema) { var result = []; node.forEach(function (n) { result.push(tableRow(n, schema)); }); return result.join('\n'); }; var tableRow = function tableRow(node, schema) { var result = []; var separator = '|'; node.forEach(function (n) { result.push(tableCell(n, schema)); }); return "".concat(separator).concat(result.join("".concat(separator))).concat(separator); }; var tableCell = function tableCell(node, schema) { var result = []; node.forEach(function (n) { result.push(reduce(n, schema)); }); return result.join('\n'); }; export default table;