build(deps-dev): apply updates
[e-mobility-charging-stations-simulator.git] / src / charging-station / ChargingStation.ts
index a1bb33a9c3fcca906d65a3fb8027dc4200a7e141..7c4b098d3de215a7781d0909572b55e665518013 100644 (file)
@@ -143,7 +143,6 @@ import {
   handleFileException,
   isNotEmptyArray,
   isNotEmptyString,
-  isUndefined,
   logPrefix,
   logger,
   min,
@@ -963,20 +962,15 @@ export class ChargingStation extends EventEmitter {
     connectorId?: number
   ): boolean {
     const reservation = this.getReservationBy('reservationId', reservationId)
-    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
-    const reservationExists = !isUndefined(reservation) && !hasReservationExpired(reservation!)
+    const reservationExists = reservation !== undefined && !hasReservationExpired(reservation)
     if (arguments.length === 1) {
       return !reservationExists
     } else if (arguments.length > 1) {
-      const userReservation = !isUndefined(idTag)
-        ? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
-        this.getReservationBy('idTag', idTag!)
-        : undefined
+      const userReservation =
+        idTag !== undefined ? this.getReservationBy('idTag', idTag) : undefined
       const userReservationExists =
-        // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
-        !isUndefined(userReservation) && !hasReservationExpired(userReservation!)
-      // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
-      const notConnectorZero = isUndefined(connectorId) ? true : connectorId! > 0
+        userReservation !== undefined && !hasReservationExpired(userReservation)
+      const notConnectorZero = connectorId === undefined ? true : connectorId > 0
       const freeConnectorsAvailable = this.getNumberOfReservableConnectors() > 0
       return (
         !reservationExists && !userReservationExists && notConnectorZero && freeConnectorsAvailable
@@ -1206,7 +1200,6 @@ export class ChargingStation extends EventEmitter {
     const stationConfiguration = this.getConfigurationFromFile()
     if (
       stationConfiguration?.stationInfo?.templateHash === stationTemplate?.templateHash &&
-      // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
       (stationConfiguration?.connectorsStatus != null || stationConfiguration?.evsesStatus != null)
     ) {
       checkConfiguration(stationConfiguration, this.logPrefix(), this.configurationFile)