mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-16 15:57:54 +02:00
randomRange util function
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user