(entry: IAuditLogEntry, fallback: string)
| 6 | * actions where the audit row has no user. |
| 7 | */ |
| 8 | export function formatActor(entry: IAuditLogEntry, fallback: string): string { |
| 9 | const first = entry.actorFirstName ?? ""; |
| 10 | const last = entry.actorLastName ?? ""; |
| 11 | const fullName = `${first} ${last}`.trim(); |
| 12 | |
| 13 | if (fullName !== "") { |
| 14 | return fullName; |
| 15 | } |
| 16 | |
| 17 | const email = entry.actorEmail ?? ""; |
| 18 | |
| 19 | if (email !== "") { |
| 20 | return email; |
| 21 | } |
| 22 | |
| 23 | return fallback; |
| 24 | } |
| 25 | |
| 26 | /** |
| 27 | * Audit action names are dotted snake-case (`auth.login_success`). |
no outgoing calls
no test coverage detected