Skip to content

Commit

Permalink
* applies changes suggested here: mapbox#48 (comment)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominik Nussbaumer committed Sep 13, 2018
1 parent 3222a8a commit f802533
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/download.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
var zip = require('./zip');

module.exports = function(gj, options) {
var content = zip(gj, options);
location.href = 'data:application/zip;base64,' + content;
};
zip(gj, options).then(function(content) {
location.href = 'data:application/zip;base64,' + content;
});
};
4 changes: 2 additions & 2 deletions src/zip.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ module.exports = function(gj, options, generateOptions) {
if (generateOptions){
generateOptions.compression = 'STORE';
}else{
generateOptions = { compression:'STORE' };
generateOptions = { compression:'STORE', type:'base64' };

if (!process.browser) {
generateOptions.type = 'nodebuffer';
}
}

return zip.generate(generateOptions);
return zip.generateAsync(generateOptions);
};

0 comments on commit f802533

Please sign in to comment.