( full: string )
| 98 | * providers that don't return structured name fields (notably GitHub). |
| 99 | */ |
| 100 | export const splitDisplayName = ( |
| 101 | full: string |
| 102 | ): { firstName: string; lastName: string } => { |
| 103 | const trimmed = full.trim(); |
| 104 | |
| 105 | if (trimmed === "") { |
| 106 | return { firstName: "", lastName: "" }; |
| 107 | } |
| 108 | |
| 109 | const parts = trimmed.split(/\s+/); |
| 110 | |
| 111 | if (parts.length === 1) { |
| 112 | return { firstName: parts[0] ?? "", lastName: "" }; |
| 113 | } |
| 114 | |
| 115 | return { |
| 116 | firstName: parts[0] ?? "", |
| 117 | lastName: parts.slice(1).join(" "), |
| 118 | }; |
| 119 | }; |
| 120 | |
| 121 | const OAUTH_FETCH_TIMEOUT_MS = 10_000; |
| 122 |
no outgoing calls
no test coverage detected