Removing remaining legacy objects, remove njodb error for fileExists

This commit is contained in:
advplyr 2022-04-10 10:05:05 -05:00
parent 99e2ea228d
commit c60807f998
15 changed files with 18 additions and 2602 deletions

View file

@ -27,7 +27,7 @@ const max = (a, b) => {
const convertSize = (size) => {
const sizes = ["bytes", "KB", "MB", "GB"];
var index = Math.floor(Math.log2(size)/10);
var index = Math.floor(Math.log2(size) / 10);
if (index > 3) index = 3;
return Math.round(((size / Math.pow(1024, index)) + Number.EPSILON) * 100) / 100 + " " + sizes[index];
@ -38,7 +38,7 @@ const fileExists = async (a) => {
await promisify(access)(a, constants.F_OK);
return true;
} catch (error) {
console.error(error);
// console.error(error); file does not exist no need for error
return false;
}
}