General refactoring
This commit is contained in:
@@ -16,3 +16,13 @@ export function shuffleArray(array) {
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
export function urltoFile(url, filename, mimeType) {
|
||||
return fetch(url)
|
||||
.then(function (res) {
|
||||
return res.arrayBuffer();
|
||||
})
|
||||
.then(function (buf) {
|
||||
return new File([buf], filename, { type: mimeType });
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user