Fix a null or undefined condition
[e-mobility-charging-stations-simulator.git] / src / utils / Constants.ts
index fb9e20046ac059ef341f722645a109dfd3f43580..241018fca18fff398590e56b1440ec6d3b260827 100644 (file)
@@ -10,8 +10,8 @@ export default class Constants {
   static readonly CHARGING_STATION_ATG_DEFAULT_STOP_AFTER_HOURS = 0.25; // Hours
 
   // See https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
-  static readonly SEMVER_REGEXP =
-    /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;
+  static readonly SEMVER_PATTERN =
+    '^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$';
 
   static readonly DEFAULT_CIRCULAR_BUFFER_CAPACITY = Number.MAX_SAFE_INTEGER;
 
@@ -45,6 +45,8 @@ export default class Constants {
 
   static readonly UNKNOWN_COMMAND = 'unknown command';
 
+  static readonly MAX_RANDOM_INTEGER = 281474976710654;
+
   private constructor() {
     // This is intentional
   }