diff --git a/index.js b/index.js index add82d6..c142f9d 100755 --- a/index.js +++ b/index.js @@ -29,7 +29,7 @@ let buildExport = params => { for (let col in specification) { header.push({ value: specification[col].displayName, - style: specification[col].headerStyle || '' + style: specification[col].headerStyle }) if (specification[col].width) { diff --git a/lib/excel.js b/lib/excel.js index d2706d1..dba485c 100755 --- a/lib/excel.js +++ b/lib/excel.js @@ -19,11 +19,13 @@ function sheet_from_array_of_arrays(data, merges) { if(range.e.c < C) range.e.c = C; let cell; - if(data[R][C] && typeof data[R][C] === 'object' && data[R][C].style && !(data[R][C] instanceof Date)) { + if(data[R][C] && typeof data[R][C] === 'object' && !(data[R][C] instanceof Date)) { cell = { v: data[R][C].value, - s: data[R][C].style }; + if (data[R][C].style) { + cell.s = data[R][C].style + } } else { cell = {v: data[R][C] }; }