( elementId: string | undefined | null )
| 379 | } |
| 380 | |
| 381 | export function isValidElementId( |
| 382 | elementId: string | undefined | null |
| 383 | ): boolean { |
| 384 | if (!elementId) { |
| 385 | return false |
| 386 | } |
| 387 | return ( |
| 388 | elementId.startsWith(GENERATED_ELEMENT_ID_PREFIX) && |
| 389 | // There must be at least 3 parts: $$ID-<hash>-<userKey> |
| 390 | elementId.split("-").length >= 3 |
| 391 | ) |
| 392 | } |
| 393 | |
| 394 | /** |
| 395 | * If the element has a valid ID, returns it. Otherwise, returns undefined. |
no outgoing calls
no test coverage detected
searching dependent graphs…