Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
createInputStream(options) {
options = options || {};
const worksheet = this.workbook.addWorksheet(options.sheetName);
const dateFormats = options.dateFormats || [dayjs.ISO_8601, 'MM-DD-YYYY', 'YYYY-MM-DD'];
const map =
options.map ||
function(datum) {
if (datum === '') {
return null;
}
const datumNumber = Number(datum);
if (!Number.isNaN(datumNumber) && datumNumber !== Infinity) {
return datumNumber;
}
const dt = dayjs(datum, dateFormats, true);
if (dt.isValid()) {
return new Date(dt.valueOf());
}
const special = SpecialValues[datum];
if (special !== undefined) {