fix(simulator): fix mocha tests
[e-mobility-charging-stations-simulator.git] / src / utils / Utils.ts
index bac9705da1ba8e37f67418f86aebbc630529595e..f701cea041ab831d1b1ff323123e02c60b69b11b 100644 (file)
@@ -3,7 +3,8 @@ import util from 'node:util';
 
 import clone from 'just-clone';
 
-import { Constants } from './internal';
+// import { Constants } from './internal';
+import { Constants } from './Constants';
 import { WebSocketCloseEventStatusString } from '../types';
 
 export class Utils {
@@ -185,6 +186,14 @@ export class Utils {
     return clone<T>(object);
   }
 
+  public static hasOwnProp(object: unknown, property: PropertyKey): boolean {
+    return Utils.isObject(object) && Object.hasOwn(object as object, property);
+  }
+
+  public static isCFEnvironment(): boolean {
+    return process.env.VCAP_APPLICATION !== undefined;
+  }
+
   public static isIterable<T>(obj: T): boolean {
     return !Utils.isNullOrUndefined(obj) ? typeof obj[Symbol.iterator] === 'function' : false;
   }