Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
toExcel () {
const { tables, options } = this
const workbook = new ExcelJS.Workbook() // create workbook
Object.assign(workbook, options)
// workbookCreated plugins
this._invokePlugin('workbookCreated', { workbook, tables })
tables.forEach((table, index) => {
const worksheet = workbook.addWorksheet(`Sheet ${index + 1}`)
// worksheetCreated plugins
this._invokePlugin('worksheetCreated', { worksheet, table })
this.toSheet(table, worksheet)
// worksheetCompleted plugins
this._invokePlugin('worksheetCompleted', { worksheet, table })