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

Function randomValuePureFn

packages/core/src/tests/utils.ts:140–143  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

138// returns a pure function that returns same random value everytime
139// for a specific number argument `n`
140export function randomValuePureFn(): (n: number) => any {
141 const values = randomValues();
142 return (n: number) => values[n % values.length];
143}
144
145export function randomSortPredicate(): (a: any, b: any) => number {
146 const desc = Faker.random.boolean();

Callers 2

dict-unit.spec.tsFile · 0.90
list-unit.spec.tsFile · 0.90

Calls 1

randomValuesFunction · 0.85

Tested by

no test coverage detected