Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const util = require('util')
const fs = require('fs')
const XlsxPopulate = require('html-to-xlsx').XlsxPopulate
const getXlsxStyleNames = require('html-to-xlsx').getXlsxStyleNames
const toArray = require('stream-to-array')
const writeFileAsync = util.promisify(fs.writeFile)
const toArrayAsync = util.promisify(toArray)
module.exports = async (reporter, request, response) => {
let xlsxTemplateBuf
let tableXlsxBuf
reporter.logger.debug('Merging html-to-xlsx result into xlsx template is starting', request)
if (response.stream.path == null) {
throw reporter.createError('No path was found in xlsx response stream', {
weak: true
})
}