MCPcopy
hub / github.com/apache/pouchdb / createBlob

Function createBlob

lib/index-browser.js:781–801  ·  view source on GitHub ↗
(parts, properties)

Source from the content-addressed store, hash-verified

779// browsers that don't support the native Blob constructor (e.g.
780// old QtWebKit versions, Android < 4.4).
781function createBlob(parts, properties) {
782 /* global BlobBuilder,MSBlobBuilder,MozBlobBuilder,WebKitBlobBuilder */
783 parts = parts || [];
784 properties = properties || {};
785 try {
786 return new Blob(parts, properties);
787 } catch (e) {
788 if (e.name !== "TypeError") {
789 throw e;
790 }
791 var Builder = typeof BlobBuilder !== 'undefined' ? BlobBuilder :
792 typeof MSBlobBuilder !== 'undefined' ? MSBlobBuilder :
793 typeof MozBlobBuilder !== 'undefined' ? MozBlobBuilder :
794 WebKitBlobBuilder;
795 var builder = new Builder();
796 for (var i = 0; i < parts.length; i += 1) {
797 builder.append(parts[i]);
798 }
799 return builder.getBlob(properties.type);
800 }
801}
802
803// From http://stackoverflow.com/questions/14967647/ (continues on next line)
804// encode-decode-image-with-base64-breaks-image (2013-04-21)

Callers 3

binStringToBlufferFunction · 0.70
checkBlobSupportFunction · 0.70
readBlobDataFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…