Apply dependencies update
[e-mobility-charging-stations-simulator.git] / src / utils / Utils.ts
index f28de9816d70771a634b7e93dcdd4ee904e000d7..86b0daa2d57a15a8f4f9893e28e49899b34b6eb1 100644 (file)
@@ -174,7 +174,11 @@ export default class Utils {
   }
 
   public static isObject(item: unknown): boolean {
-    return item && typeof item === 'object' && Array.isArray(item) === false;
+    return (
+      Utils.isNullOrUndefined(item) === false &&
+      typeof item === 'object' &&
+      Array.isArray(item) === false
+    );
   }
 
   public static cloneObject<T extends object>(object: T): T {
@@ -228,7 +232,7 @@ export default class Utils {
     `${str.slice(0, pos)}${subStr}${str.slice(pos)}`;
 
   /**
-   * @param [retryNumber=0]
+   * @param retryNumber - the number of retries that have already been attempted
    * @returns delay in milliseconds
    */
   public static exponentialDelay(retryNumber = 0): number {
@@ -267,7 +271,7 @@ export default class Utils {
   }
 
   public static JSONStringifyWithMapSupport(
-    obj: Record<string, unknown> | Record<string, unknown>[] | Map<string, unknown>,
+    obj: Record<string, unknown> | Record<string, unknown>[] | Map<unknown, unknown>,
     space?: number
   ): string {
     return JSON.stringify(
@@ -288,7 +292,7 @@ export default class Utils {
   /**
    * Convert websocket error code to human readable string message
    *
-   * @param code websocket error code
+   * @param code websocket error code
    * @returns human readable string message
    */
   public static getWebSocketCloseEventStatusString(code: number): string {