From cbaaa29b43c61386c171cc1813ee55147900e3a4 Mon Sep 17 00:00:00 2001 From: Histmy Date: Tue, 27 Jul 2021 01:44:23 +0200 Subject: [PATCH] pepega --- addons/utils.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 addons/utils.js diff --git a/addons/utils.js b/addons/utils.js new file mode 100644 index 0000000..8ecd50c --- /dev/null +++ b/addons/utils.js @@ -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`; + } +};