fix(simulator): fix empty array detection helper semantic
[e-mobility-charging-stations-simulator.git] / src / utils / Utils.ts
index 1f17fe8735dce9bb1b794075aefd318da22e06a9..fa1c7b6b610fd5fa6a2043381cd44adecd88b7a6 100644 (file)
@@ -214,13 +214,17 @@ export default class Utils {
   }
 
   public static isEmptyArray(object: unknown | unknown[]): boolean {
-    if (!Array.isArray(object)) {
+    if (Array.isArray(object) && object.length === 0) {
       return true;
     }
-    if (object.length > 0) {
-      return false;
+    return false;
+  }
+
+  public static isNotEmptyArray(object: unknown | unknown[]): boolean {
+    if (Array.isArray(object) && object.length > 0) {
+      return true;
     }
-    return true;
+    return false;
   }
 
   public static isEmptyObject(obj: object): boolean {