static getRandomInt(max, min) {
if (min) {
- return Math.floor((Math.random() * (max - min)) + min);
+ return Math.floor((Math.random() * (max - min + 1)) + min);
}
- return Math.floor((Math.random() * max));
+ return Math.floor((Math.random() * max + 1));
}
static basicFormatLog(prefixString = '') {
const date = new Date();
- return date.toISOString().substr(0, 19) + prefixString;
+ return date.toLocaleString() + prefixString;
}
static objectHasOwnProperty(object, property) {
}
return false;
}
+
+ static isEmptyArray(object) {
+ if (Array.isArray(object) && object.length > 0) {
+ return false;
+ }
+ return true;
+ }
}
module.exports = Utils;