[CodeFactor] Apply fixes to commit 476597e

This commit is contained in:
codefactor-io 2023-11-11 19:32:54 +00:00
parent 476597e792
commit 498a5c2e3c
No known key found for this signature in database
GPG key ID: B66B2D63282C190F

View file

@ -116,7 +116,7 @@ export function processModemConfig(data) {
// For now its a hardcoded structure until we found a better way
console.log(data);
// chatGPT function for iterating through all items and asserting them to a function
// chatGPT function for iterating through all items and asserting them to a function
for (const category in data) {
if (data.hasOwnProperty(category)) {
for (const setting in data[category]) {
@ -124,8 +124,7 @@ export function processModemConfig(data) {
// Create a variable name combining the category and setting name
const variableName = setting;
// Assign the value to the variable
if(variableName == "mycall"){
if (variableName == "mycall") {
let mycall = data[category][setting];
if (mycall.includes("-")) {
const splittedCallsign = mycall.split("-");
@ -135,22 +134,16 @@ export function processModemConfig(data) {
settings.mycall = mycall; // Use the original mycall if no SSID is present
settings.myssid = 0; // Default SSID if not provided
}
} else {
settings[variableName] = data[category][setting];
}
console.log(variableName + ': ' + settings[variableName]);
console.log(variableName + ": " + settings[variableName]);
}
}
}
}
}
/*
/*
// STATION SETTINGS
// Extract the callsign and SSID
if (data.STATION.mycall.includes("-")) {