MCPcopy Create free account
hub / github.com/TanStack/ai / createRuntimeId

Function createRuntimeId

packages/ai-devtools/src/store/hook-registry.ts:531–543  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

529}
530
531function 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
545function upsertHook(state: HookRegistryState, event: HookUpsertEvent): void {
546 const existing = state.hooks[event.hookId]

Callers 1

Calls 1

toStringMethod · 0.80

Tested by

no test coverage detected