( id: ElementId<TLabel>, )
| 8 | * @returns The label and uuid. |
| 9 | */ |
| 10 | export function parseElementId<TLabel extends string = string>( |
| 11 | id: ElementId<TLabel>, |
| 12 | ): [label: TLabel, uuid: string] { |
| 13 | const parts = id.split(":", 2); |
| 14 | if (parts.length !== 2) { |
| 15 | throw new Error(`Invalid element id: ${id}`); |
| 16 | } |
| 17 | return parts as [TLabel, string]; |
| 18 | } |
| 19 | |
| 20 | /** |
| 21 | * Get the label from an element id. |
no outgoing calls
no test coverage detected