MCPcopy Create free account
hub / github.com/RtlZeroMemory/Rezi / pick

Function pick

packages/testkit/src/fuzz.ts:101–106  ·  view source on GitHub ↗
(rng: Rng, values: readonly T[])

Source from the content-addressed store, hash-verified

99}
100
101export function pick<T>(rng: Rng, values: readonly T[]): T {
102 if (values.length === 0) throw new Error("pick: values must not be empty");
103 const value = values[rng.u32() % values.length];
104 if (value === undefined) throw new Error("pick: selected value is unexpectedly undefined");
105 return value;
106}
107
108export function randomAsciiString(
109 rng: Rng,

Callers 15

randomTextFunction · 0.90
buildKeyPartFunction · 0.90
randomInvalidTokenFunction · 0.90
buildDocFunction · 0.90
buildStructuredDocFunction · 0.90
chooseCurrentValueFunction · 0.90
randomNonRoutingEventFunction · 0.90
randomKeyRoutingEventFunction · 0.90
randomMouseRoutingEventFunction · 0.90

Calls

no outgoing calls

Tested by 15

randomTextFunction · 0.72
buildKeyPartFunction · 0.72
randomInvalidTokenFunction · 0.72
buildDocFunction · 0.72
buildStructuredDocFunction · 0.72
chooseCurrentValueFunction · 0.72
randomNonRoutingEventFunction · 0.72
randomKeyRoutingEventFunction · 0.72
randomMouseRoutingEventFunction · 0.72
randomHitTreeFunction · 0.72
randomSpacingFunction · 0.72
addLayoutPropsFunction · 0.72