MCPcopy Create free account
hub / github.com/codeaashu/claude-code / pick

Function pick

src/buddy/companion.ts:39–41  ·  view source on GitHub ↗
(rng: () => number, arr: readonly T[])

Source from the content-addressed store, hash-verified

37}
38
39function pick<T>(rng: () => number, arr: readonly T[]): T {
40 return arr[Math.floor(rng() * arr.length)]!
41}
42
43function rollRarity(rng: () => number): Rarity {
44 const total = Object.values(RARITY_WEIGHTS).reduce((a, b) => a + b, 0)

Callers 2

rollStatsFunction · 0.85
rollFromFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected