-
Notifications
You must be signed in to change notification settings - Fork 412
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2b7d9e7
commit 8cde8c3
Showing
3 changed files
with
46 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
"use strict"; | ||
|
||
/** | ||
* From https://gist.github.com/nolanlawson/10340255 | ||
*/ | ||
module.exports = function createBlob(parts, properties) { | ||
parts = parts || []; | ||
properties = properties || {}; | ||
try { | ||
return new Blob(parts, properties); | ||
} catch (e) { | ||
if (e.name !== "TypeError") { | ||
throw e; | ||
} | ||
var BlobBuilder = window.BlobBuilder || window.MSBlobBuilder || window.MozBlobBuilder || window.WebKitBlobBuilder; | ||
var builder = new BlobBuilder(); | ||
for (var i = 0; i < parts.length; i += 1) { | ||
builder.append(parts[i]); | ||
} | ||
return builder.getBlob(properties.type); | ||
} | ||
}; |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters