Apply Copilot's suggestions II

Signed-off-by: yubiuser <github@yubiuser.dev>
This commit is contained in:
yubiuser
2026-07-08 11:16:06 +02:00
parent 70efb5f327
commit 406e7f0992
3 changed files with 8 additions and 4 deletions
+1 -1
View File
@@ -130,7 +130,7 @@ function parseLines(outputElement, text) {
return closingTags;
}
if (ansiMappings[match] === true) {
if (Object.hasOwn(ansiMappings, match)) {
// Opening span
spanCount++;
return `<span class="${ansiMappings[match]}">`;
+2 -2
View File
@@ -121,7 +121,7 @@ function findMasterInterface({ iface, masterInterfaces, interfacesData }) {
}
const masterName = masterObj.name;
if (masterInterfaces[masterName] === true) {
if (Array.isArray(masterInterfaces[masterName])) {
masterInterfaces[masterName].push(iface.name);
} else {
masterInterfaces[masterName] = [iface.name];
@@ -485,7 +485,7 @@ function sortInterfaces(interfaces, masterInterfaces) {
// Add slave interfaces next to master interfaces
for (const master of interfaceList) {
if (masterInterfaces[master] === true) {
if (Array.isArray(masterInterfaces[master])) {
for (const slave of masterInterfaces[master]) {
ifaces.splice(ifaces.indexOf(slave), 1);
interfaceList.splice(interfaceList.indexOf(master) + 1, 0, slave);
+5 -1
View File
@@ -510,8 +510,12 @@ function parseFilters() {
}
function filterOn(param, dict) {
if (!Object.hasOwn(dict, param)) {
return false;
}
const typ = typeof dict[param];
return dict[param] && (typ === "number" || (typ === "string" && dict[param].length > 0));
return typ === "number" || (typ === "string" && dict[param].length > 0);
}
function getAPIURL(queryFilters) {