Function
entityPath
(id: string, type: EntityType)
Source from the content-addressed store, hash-verified
| 41 | * {@link isEntityType} first. |
| 42 | */ |
| 43 | export function entityPath(id: string, type: EntityType): EntityPath { |
| 44 | switch (type) { |
| 45 | case "campus": |
| 46 | return `/campus/${id}`; |
| 47 | case "site": |
| 48 | case "area": |
| 49 | return `/site/${id}`; |
| 50 | case "building": |
| 51 | case "joined_building": |
| 52 | return `/building/${id}`; |
| 53 | case "room": |
| 54 | case "virtual_room": |
| 55 | return `/room/${id}`; |
| 56 | case "poi": |
| 57 | return `/poi/${id}`; |
| 58 | default: |
| 59 | return type satisfies never; |
| 60 | } |
| 61 | } |
Tested by
no test coverage detected