options are null when not provided

This commit is contained in:
liamcottle
2024-03-27 01:32:08 +13:00
parent 445452d7f5
commit a6958e1451

View File

@ -32,9 +32,9 @@ const options = commandLineArgs([
]);
// get options and fallback to default values
const mqttBrokerUrl = options["mqtt-broker-url"] || "mqtt://mqtt.meshtastic.org";
const mqttUsername = options["mqtt-username"] || "meshdev";
const mqttPassword = options["mqtt-password"] || "large4cats";
const mqttBrokerUrl = options["mqtt-broker-url"] ?? "mqtt://mqtt.meshtastic.org";
const mqttUsername = options["mqtt-username"] ?? "meshdev";
const mqttPassword = options["mqtt-password"] ?? "large4cats";
const collectServiceEnvelopes = options["collect-service-envelopes"] ?? false;
// create mqtt client