(entity: any)
| 195 | } |
| 196 | |
| 197 | function resolveEntityUsername(entity: any): string | undefined { |
| 198 | if (!entity) return undefined; |
| 199 | if (typeof entity.username === "string" && entity.username.trim()) { |
| 200 | return entity.username.trim(); |
| 201 | } |
| 202 | if (Array.isArray(entity.usernames) && entity.usernames.length > 0) { |
| 203 | const username = entity.usernames.find( |
| 204 | (item: any) => item?.active |
| 205 | )?.username; |
| 206 | if (typeof username === "string" && username.trim()) { |
| 207 | return username.trim(); |
| 208 | } |
| 209 | } |
| 210 | return undefined; |
| 211 | } |
| 212 | |
| 213 | function cleanEntityId(value: any): string | undefined { |
| 214 | if (value === undefined || value === null) return undefined; |
no outgoing calls
no test coverage detected