MCPcopy Create free account
hub / github.com/boringstack-xyz/boringstack / formatActor

Function formatActor

apps/ui/src/features/accounts/AuditLog.utils.ts:8–24  ·  view source on GitHub ↗
(entry: IAuditLogEntry, fallback: string)

Source from the content-addressed store, hash-verified

6 * actions where the audit row has no user.
7 */
8export 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`).

Callers 2

AuditLogRowFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected