refactor: return set configuration value in setConfigurationKeyValue()
authorJérôme Benoit <jerome.benoit@sap.com>
Sat, 30 Dec 2023 20:00:26 +0000 (21:00 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Sat, 30 Dec 2023 20:00:26 +0000 (21:00 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ConfigurationKeyUtils.ts

index 72fb88d757ba93565cd6b93574a5914141190a4b..556cf54a57745f8563c9b9373729e79ecd976908 100644 (file)
@@ -75,7 +75,7 @@ export const setConfigurationKeyValue = (
   key: ConfigurationKeyType,
   value: string,
   caseInsensitive = false
-): void => {
+): ConfigurationKey | undefined => {
   const keyFound = getConfigurationKey(chargingStation, key, caseInsensitive)
   if (keyFound != null) {
     // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
@@ -90,6 +90,7 @@ export const setConfigurationKeyValue = (
       { key, value }
     )
   }
+  return keyFound
 }
 
 export const deleteConfigurationKey = (