randomRange util function

This commit is contained in:
Daniel Odendahl Jr
2017-10-30 18:13:00 +00:00
parent e6bbebb6ff
commit 4984318fc4
6 changed files with 22 additions and 15 deletions
+4
View File
@@ -48,6 +48,10 @@ class Util {
return `${prefix.slice(text.length)}${text}`;
}
static randomRange(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
static promisifyAll(obj, suffix = 'Async') {
for (const key of Object.keys(obj)) {
if (typeof obj[key] !== 'function') continue;