Comparing version 0.7.0 to 0.7.1
@@ -32,2 +32,4 @@ 'use strict'; | ||
var buildSheetFromMatrix = function buildSheetFromMatrix(data) { | ||
var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; | ||
var workSheet = {}; | ||
@@ -63,2 +65,8 @@ var range = { s: { c: 1e7, r: 1e7 }, e: { c: 0, r: 0 } }; | ||
} | ||
if (options['!cols']) { | ||
workSheet['!cols'] = options['!cols']; | ||
} | ||
if (options['!merges']) { | ||
workSheet['!merges'] = options['!merges']; | ||
} | ||
return workSheet; | ||
@@ -65,0 +73,0 @@ }; |
@@ -42,3 +42,3 @@ 'use strict'; | ||
var name = worksheet.name || 'Sheet'; | ||
var data = (0, _helpers.buildSheetFromMatrix)(worksheet.data || []); | ||
var data = (0, _helpers.buildSheetFromMatrix)(worksheet.data || [], options); | ||
workBook.SheetNames.push(name); | ||
@@ -45,0 +45,0 @@ workBook.Sheets[name] = data; |
{ | ||
"name": "node-xlsx", | ||
"author": "Olivier Louvignes <olivier@mg-crea.com>", | ||
"version": "0.7.0", | ||
"version": "0.7.1", | ||
"description": "NodeJS Excel files parser & builder", | ||
@@ -6,0 +6,0 @@ "main": "lib/index.js", |
@@ -14,3 +14,3 @@ import XLSX from 'xlsx'; | ||
const buildSheetFromMatrix = (data) => { | ||
const buildSheetFromMatrix = (data, options = {}) => { | ||
const workSheet = {}; | ||
@@ -46,2 +46,8 @@ const range = {s: {c: 1e7, r: 1e7}, e: {c: 0, r: 0}}; | ||
} | ||
if (options['!cols']) { | ||
workSheet['!cols'] = options['!cols']; | ||
} | ||
if (options['!merges']) { | ||
workSheet['!merges'] = options['!merges']; | ||
} | ||
return workSheet; | ||
@@ -48,0 +54,0 @@ }; |
@@ -23,3 +23,3 @@ | ||
const name = worksheet.name || 'Sheet'; | ||
const data = buildSheetFromMatrix(worksheet.data || []); | ||
const data = buildSheetFromMatrix(worksheet.data || [], options); | ||
workBook.SheetNames.push(name); | ||
@@ -26,0 +26,0 @@ workBook.Sheets[name] = data; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
35542
262
0