Skip to content

Commit

Permalink
return promise
Browse files Browse the repository at this point in the history
  • Loading branch information
roger committed Jul 27, 2017
1 parent e26650c commit 404650b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/zipcelx.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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');
});
};
4 changes: 2 additions & 2 deletions src/zipcelx.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const generateXMLWorksheet = (rows) => {

export default (config) => {
if (!validator(config)) {
return;
return undefined;
}

const zip = new JSZip();
Expand All @@ -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`);
});
Expand Down

0 comments on commit 404650b

Please sign in to comment.