()
| 529 | } |
| 530 | |
| 531 | function createRuntimeId(): string { |
| 532 | const cryptoLike = ( |
| 533 | globalThis as { |
| 534 | crypto?: { |
| 535 | randomUUID?: () => string |
| 536 | } |
| 537 | } |
| 538 | ).crypto |
| 539 | if (cryptoLike?.randomUUID) { |
| 540 | return cryptoLike.randomUUID() |
| 541 | } |
| 542 | return Math.random().toString(36).slice(2) |
| 543 | } |
| 544 | |
| 545 | function upsertHook(state: HookRegistryState, event: HookUpsertEvent): void { |
| 546 | const existing = state.hooks[event.hookId] |
no test coverage detected