diff --git a/lib/zipcelx.js b/lib/zipcelx.js index d178fb3..b1a1d9a 100644 --- a/lib/zipcelx.js +++ b/lib/zipcelx.js @@ -50,7 +50,7 @@ var generateXMLWorksheet = exports.generateXMLWorksheet = function generateXMLWo exports.default = function (config) { if (!(0, _validator2.default)(config)) { - return; + return undefined; } var zip = new _jszip2.default(); @@ -63,7 +63,7 @@ exports.default = function (config) { var worksheet = generateXMLWorksheet(config.sheet.data); xl.file('worksheets/sheet1.xml', worksheet); - zip.generateAsync({ type: 'blob' }).then(function (blob) { + return zip.generateAsync({ type: 'blob' }).then(function (blob) { _fileSaver2.default.saveAs(blob, config.filename + '.xlsx'); }); }; \ No newline at end of file diff --git a/src/zipcelx.js b/src/zipcelx.js index ea18823..58dad26 100644 --- a/src/zipcelx.js +++ b/src/zipcelx.js @@ -17,7 +17,7 @@ export const generateXMLWorksheet = (rows) => { export default (config) => { if (!validator(config)) { - return; + return undefined; } const zip = new JSZip(); @@ -30,7 +30,7 @@ export default (config) => { const worksheet = generateXMLWorksheet(config.sheet.data); xl.file('worksheets/sheet1.xml', worksheet); - zip.generateAsync({ type: 'blob' }) + return zip.generateAsync({ type: 'blob' }) .then((blob) => { FileSaver.saveAs(blob, `${config.filename}.xlsx`); });