download as buffer
This commit is contained in:
parent
d9aa6bb0e9
commit
33c6f57150
@ -10,6 +10,15 @@ class Util {
|
||||
throw new Error("Class may not be instantiated.");
|
||||
}
|
||||
|
||||
static downloadAsBuffer(source) {
|
||||
return new Promise((resolve, reject) => {
|
||||
fetch(source).then(res => {
|
||||
if(res.ok) resolve(res.buffer());
|
||||
else reject(res.statusText);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
static readdirRecursive(directory) {
|
||||
|
||||
const result = [];
|
||||
|
Loading…
Reference in New Issue
Block a user