Use proper Object methods

Signed-off-by: XhmikosR <xhmikosr@gmail.com>
This commit is contained in:
XhmikosR
2025-04-02 18:37:28 +03:00
parent 04760b55c8
commit ba3b76421b
5 changed files with 23 additions and 33 deletions

View File

@@ -28,8 +28,7 @@ $(() => {
function setConfigValues(topic, key, value) {
// If the value is an object, we need to recurse
if (!("description" in value)) {
for (const subkey of Object.keys(value)) {
const subvalue = value[subkey];
for (const [subkey, subvalue] of Object.entries(value)) {
// If the key is empty, we are at the top level
const newKey = key === "" ? subkey : key + "." + subkey;
setConfigValues(topic, newKey, subvalue);