mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-29 11:42:17 +00:00
8 lines
293 B
TypeScript
8 lines
293 B
TypeScript
// Lazy: workerd forbids generating random values in global scope, so the id
|
|
// materializes on first call (inside a handler) and stays stable afterwards.
|
|
let generated: string | undefined
|
|
|
|
export function runID(): string {
|
|
generated ??= crypto.randomUUID().slice(0, 8)
|
|
return generated
|
|
}
|