update filter to be more readable based on #27355

Signed-off-by: Stephen Glass <stephen@stephen.glass>
This commit is contained in:
Stephen Glass
2024-11-21 17:32:03 -05:00
parent f18c67db38
commit 86a3a32a65
+1 -7
View File
@@ -94,13 +94,7 @@ export class EntityTextFilter implements EntityFilter {
const partialMatch = this.toUpperArray([
entity.metadata.name,
entity.metadata.title,
...(typeof entity.spec?.profile === 'object' &&
entity.spec?.profile !== null &&
!Array.isArray(entity.spec.profile) &&
'displayName' in entity.spec.profile &&
typeof entity.spec.profile.displayName === 'string'
? [entity.spec.profile.displayName]
: []),
(entity.spec?.profile as { displayName?: string })?.displayName,
]);
for (const word of words) {