diff --git a/index.js b/index.js index d6bd6b4..f228522 100644 --- a/index.js +++ b/index.js @@ -22,7 +22,7 @@ module.exports = (data, config) => { $rows.push(`| ${config.headers.map(hd => `${hd.title || capitalize(hd.name)}`).join(' | ')} |`); $rows.push(`| ${config.headers.map(hd => `${hd.align || ':---:'}`).join(' | ')} |`); $rows = $rows.concat(data.map(rowData => { - let $tds = config.headers.map(hd => `${(rowData[hd.name] || '').replace(/[\n]/g, ' ') || ''}`); + let $tds = config.headers.map(hd => `${(rowData[hd.name] || '').toString().replace(/[\n]/g, ' ') || ''}`); return `| ${$tds.join(' | ')} |`; })); return $rows.join('\n');