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

Function randomSelectMultiple

packages/core/src/tests/utils.ts:224–226  ·  view source on GitHub ↗
(list: T, max = 6)

Source from the content-addressed store, hash-verified

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;
226}
227
228export function multipleOf<T>(producer: () => T, max = 6, min = 1): T[] {
229 return Array(randomNumber(min, max)).fill(null).map(producer);

Callers 3

dispatchRandomValuesFunction · 0.90
utils.tsFile · 0.85
randomValuesFunction · 0.85

Calls 2

randomNumberFunction · 0.85
sliceMethod · 0.80

Tested by 1

dispatchRandomValuesFunction · 0.72