(xs: T[])
| 1 | import type { MathJsonExpression, MathJsonSymbol } from '../../math-json.js'; |
| 2 | |
| 3 | /** A source of uniform numbers in `[0, 1)`: the `entropy` handler of the |
| 4 | * host capability registry, supplied by the `RandomExpression` operator. */ |
| 5 | type Draw = () => number; |
| 6 | |
| 7 | function oneOf<T = MathJsonExpression>(draw: Draw, xs: T[]): T { |
| 8 | return xs[Math.floor(draw() * xs.length)]; |
no test coverage detected