From: Jérôme Benoit Date: Wed, 30 Aug 2023 16:03:52 +0000 (+0200) Subject: refactor: silence sonar X-Git-Tag: v1.2.21~43 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=acd36c7a3ea87c48640d5bdb09c28d6ab81c9c3a;p=e-mobility-charging-stations-simulator.git refactor: silence sonar Signed-off-by: Jérôme Benoit --- diff --git a/src/scripts/deleteChargingStations.cjs b/src/scripts/deleteChargingStations.cjs index 445dbacd..0e8333c3 100755 --- a/src/scripts/deleteChargingStations.cjs +++ b/src/scripts/deleteChargingStations.cjs @@ -14,7 +14,7 @@ const { MongoClient } = require('mongodb'); const config = JSON.parse(fs.readFileSync('scriptConfig.json', 'utf8')); // Mongo Connection and Query -if (config && config.mongoConnectionString) { +if (config?.mongoConnectionString) { MongoClient.connect(config.mongoConnectionString, async function (err, client) { const db = client.db(); diff --git a/src/scripts/setCSPublicFlag.cjs b/src/scripts/setCSPublicFlag.cjs index 32b59e4a..1f412d1b 100755 --- a/src/scripts/setCSPublicFlag.cjs +++ b/src/scripts/setCSPublicFlag.cjs @@ -15,7 +15,7 @@ const { MongoClient } = require('mongodb'); const config = JSON.parse(fs.readFileSync('scriptConfig.json', 'utf8')); // Mongo Connection and Query -if (config && config.mongoConnectionString) { +if (config?.mongoConnectionString) { MongoClient.connect(config.mongoConnectionString, async function (err, client) { const db = client.db();