()
| 15 | /* Read the active tab + selected project from the URL query string so the |
| 16 | * current view survives refreshes and can be bookmarked or shared. */ |
| 17 | function readRoute(): RouteState { |
| 18 | const params = new URLSearchParams(window.location.search); |
| 19 | const rawTab = params.get("tab"); |
| 20 | const tab = TAB_IDS.includes(rawTab as TabId) ? (rawTab as TabId) : "stats"; |
| 21 | const project = params.get("project"); |
| 22 | return { tab, project: project ? project : null }; |
| 23 | } |
| 24 | |
| 25 | /* Build the canonical URL for a route, preserving the path and hash. */ |
| 26 | function routeUrl(tab: TabId, project: string | null): string { |
no outgoing calls
no test coverage detected