This commit is contained in:
parent
fa2be029a2
commit
724d70e58b
3339 changed files with 1075535 additions and 0 deletions
26
frontend/node_modules/tus-js-client/lib.es5/browser/uriToBlob.js
generated
vendored
Normal file
26
frontend/node_modules/tus-js-client/lib.es5/browser/uriToBlob.js
generated
vendored
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = uriToBlob;
|
||||
/**
|
||||
* uriToBlob resolves a URI to a Blob object. This is used for
|
||||
* React Native to retrieve a file (identified by a file://
|
||||
* URI) as a blob.
|
||||
*/
|
||||
function uriToBlob(uri) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.responseType = 'blob';
|
||||
xhr.onload = function () {
|
||||
var blob = xhr.response;
|
||||
resolve(blob);
|
||||
};
|
||||
xhr.onerror = function (err) {
|
||||
reject(err);
|
||||
};
|
||||
xhr.open('GET', uri);
|
||||
xhr.send();
|
||||
});
|
||||
}
|
||||
Reference in a new issue