This commit is contained in:
Histmy 2021-07-27 01:44:23 +02:00
parent 9d9d655e8c
commit cbaaa29b43

22
addons/utils.js Normal file
View File

@ -0,0 +1,22 @@
module.exports = {
shitFormat: obj => {
if (!obj) return console.log(obj, "\n");
const keys = Object.keys(obj);
const vals = Object.values(obj);
keys.forEach((key, i) => {
let output = vals[i];
if (typeof output === "object") output = "object";
console.log(key, output);
});
console.log("");
},
formatCas: c => {
const h = Math.floor(c / 3600);
const m = Math.floor(c % 3600 / 60);
const s = Math.floor(c % 3600 % 60);
return `${h} hodin ${m} mynut a ${s} se kund`;
}
};