Skip to content

Commit 13c57d3

Browse files
committed
update
1 parent 051f97d commit 13c57d3

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/configuration/apiCommunicationUtils.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,20 @@ function normalizeTopic(
3232
}
3333

3434
if (Array.isArray(topic)) {
35-
const normalized = topic.map((t): Topic => ({ value: t._ ?? t.value ?? t.type ?? '' }));
35+
const normalized = topic.map((t): Topic => ({
36+
value: typeof t._ === 'string' ? t._ :
37+
typeof t.value === 'string' ? t.value :
38+
typeof t.type === 'string' ? t.type :
39+
''
40+
}));
41+
3642
return normalized.length > 0 ? [normalized[0]] : [{ value: '' }];
3743
}
3844

39-
return [{ value: topic._ ?? topic.value ?? topic.type ?? '' }];
45+
return [{
46+
value: typeof topic._ === 'string' ? topic._ :
47+
typeof topic.value === 'string' ? topic.value :
48+
typeof topic.type === 'string' ? topic.type :
49+
''
50+
}];
4051
}

0 commit comments

Comments
 (0)