General refactoring

This commit is contained in:
Ross
2020-04-28 14:31:19 +01:00
parent d116c14b7d
commit bc3d08b517
5 changed files with 361 additions and 325 deletions
+10
View File
@@ -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 });
});
}