MCPcopy Create free account
hub / github.com/Hello-Application-XH/HelloGML / randomChoice

Function randomChoice

src/utils.ts:127–130  ·  view source on GitHub ↗
(arr: T[])

Source from the content-addressed store, hash-verified

125}
126
127export function randomChoice<T>(arr: T[]): T | undefined {
128 if (!arr || arr.length === 0) return undefined;
129 return arr[Math.floor(Math.random() * arr.length)];
130}
131
132export function sleep(ms: number): Promise<void> {
133 return new Promise((resolve) => setTimeout(resolve, ms));

Callers 1

getHeadersFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected