We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 051f97d commit 13c57d3Copy full SHA for 13c57d3
src/configuration/apiCommunicationUtils.ts
@@ -32,9 +32,20 @@ function normalizeTopic(
32
}
33
34
if (Array.isArray(topic)) {
35
- const normalized = topic.map((t): Topic => ({ value: t._ ?? t.value ?? t.type ?? '' }));
+ 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
+
42
return normalized.length > 0 ? [normalized[0]] : [{ value: '' }];
43
44
- 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
+ }];
51
0 commit comments