Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
VB.prototype.getCsv = function(ws) {
return csv_file = xlsjs.utils.make_csv(ws)
}
reporter.beforeRenderListeners.add(definition.name, this, function(req, res) {
if (req.files && req.files.file) {
var file = req.files.file;
if (path.extname(file.path) === ".xls") {
//TODO async!!!!
var xls = XLS.readFile(file.path);
var data = XLS.utils.sheet_to_row_object_array(xls.Sheets.Sheet1);
req.data = { rows: [] };
data.forEach(function(r) {
var item = {};
for (var key in r) {
if (r.hasOwnProperty(key))
item[key] = r[key];
}
req.data.rows.push(item);
});
}
}
});
};