This repository has been archived on 2023-03-25. You can view files and clone it, but cannot push or open issues or pull requests.
mightyscape-1.1-deprecated/extensions/fablabchemnitz/papercraft/openjscad/node_modules/w3c-blob/browser.js

29 lines
684 B
JavaScript
Raw Normal View History

module.exports = get_blob()
function get_blob() {
if(global.Blob) {
try {
new Blob(['asdf'], {type: 'text/plain'})
return Blob
} catch(err) {}
}
var Builder = global.WebKitBlobBuilder ||
global.MozBlobBuilder ||
global.MSBlobBuilder
return function(parts, bag) {
var builder = new Builder
, endings = bag.endings
, type = bag.type
if(endings) for(var i = 0, len = parts.length; i < len; ++i) {
builder.append(parts[i], endings)
} else for(var i = 0, len = parts.length; i < len; ++i) {
builder.append(parts[i])
}
return type ? builder.getBlob(type) : builder.getBlob()
}
}