MCPcopy Create free account
hub / github.com/activejs/activejs / selectRandom

Function selectRandom

packages/core/src/tests/utils.ts:220–222  ·  view source on GitHub ↗
(list: any[])

Source from the content-addressed store, hash-verified

218}
219
220export function selectRandom(list: any[]) {
221 return list[randomNumber(0, list.length - 1)];
222}
223
224export function randomSelectMultiple<T extends any[]>(list: T, max = 6): T {
225 return Faker.helpers.shuffle(list).slice(Math.min(randomNumber(0, list.length), max)) as T;

Callers 15

units.spec.tsFile · 0.90
dict-unit.spec.tsFile · 0.90
cluster.spec.tsFile · 0.90
list-unit.spec.tsFile · 0.90
makeUnitFunction · 0.90
selection.spec.tsFile · 0.90
num-unit.spec.tsFile · 0.90
utils.tsFile · 0.85

Calls 1

randomNumberFunction · 0.85

Tested by 1

makeUnitFunction · 0.72