( endpoint: string | number | GraphNode | undefined, )
| 50 | |
| 51 | /** Extract string ID from a link endpoint (handles both string and object forms). */ |
| 52 | export function endpointId( |
| 53 | endpoint: string | number | GraphNode | undefined, |
| 54 | ): string { |
| 55 | if (typeof endpoint === 'string') return endpoint; |
| 56 | if (typeof endpoint === 'object' && endpoint !== null) |
| 57 | return (endpoint as GraphNode).id; |
| 58 | return String(endpoint); |
| 59 | } |
| 60 | |
| 61 | // ─── Community Spacing ─────────────────────────────────────────────────── |
| 62 | // Pushes community clusters apart to prevent overlap. Runs synchronously |
no outgoing calls
no test coverage detected