MCPcopy Create free account
hub / github.com/hydro-dev/Hydro / randomPick

Function randomPick

framework/utils/lib/common.ts:195–197  ·  view source on GitHub ↗
(arr: T[])

Source from the content-addressed store, hash-verified

193}
194
195export function randomPick<T>(arr: T[]): T {
196 return arr[Math.floor(Math.random() * arr.length)];
197}
198
199export type StringKeys<O> = {
200 [K in keyof O]: string extends O[K] ? K : never

Callers 1

base.tsFile · 0.90

Calls 1

randomMethod · 0.80

Tested by

no test coverage detected