(id: string)
| 10 | * @returns The id object. |
| 11 | */ |
| 12 | export function parsePMCId(id: string): [any, string | undefined] { |
| 13 | let componentId, propName; |
| 14 | const index = id.lastIndexOf('}'); |
| 15 | if (index + 2 < id.length) { |
| 16 | propName = id.substring(index + 2); |
| 17 | componentId = JSON.parse(id.substring(0, index + 1)); |
| 18 | } else { |
| 19 | componentId = JSON.parse(id); |
| 20 | } |
| 21 | return [componentId, propName]; |
| 22 | } |
| 23 | |
| 24 | /** |
| 25 | * Get all the associated ids for an id. |
no test coverage detected
searching dependent graphs…