Fully implement getConfiguration
[e-mobility-charging-stations-simulator.git] / src / utils / Utils.js
index f25f48b2b8a81d03b78a72a2c56dd6a4fd5ebf6e..5b26a4f8b9d2a7d473415843e67ae5c00602882c 100644 (file)
@@ -121,9 +121,9 @@ class Utils {
 
   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 = '') {
@@ -145,6 +145,13 @@ class Utils {
     }
     return false;
   }
+
+  static isEmptyArray(object) {
+    if (Array.isArray(object) && object.length > 0) {
+      return false;
+    }
+    return true;
+  }
 }
 
 module.exports = Utils;