Skip to content

Commit a186749

Browse files
authoredMay 22, 2019
Merge pull request #48 from lukaszflorczak/master
Thank you @lukaszflorczak for your contribution.
2 parents 431da63 + 8a2b1cf commit a186749

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎file-download.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
module.exports = function(data, filename, mime) {
2-
var blob = new Blob([data], {type: mime || 'application/octet-stream'});
1+
module.exports = function(data, filename, mime, bom = null) {
2+
var blobData = (bom) ? [bom, data] : [data]
3+
var blob = new Blob(blobData, {type: mime || 'application/octet-stream'});
34
if (typeof window.navigator.msSaveBlob !== 'undefined') {
45
// IE workaround for "HTML7007: One or more blob URLs were
56
// revoked by closing the blob for which they were created.

0 commit comments

Comments
 (0)
Please sign in to comment.