ArbitraryoneOfWeightedoneOfWeighted CallableoneOfWeighted<T>(...arbitraries: [...T[]]): Dependent<ReturnType<[...T][number][1][value]>[value]>It generates an integer between 0 and the number of arbitraries passed in, and then generates a weighted value from the corresponding arbitrary. Examplerandom(oneOf([2, object({foo: string()})], [1, object({bar: string()})]))// => {foo: "bar"}random(oneOf([2, object({foo: string()})], [1, object({bar: string()})]))// => {foo: "bar"}random(oneOf([2, object({foo: string()})], [1, object({bar: string()})]))// => {bar: "foo"}Type parametersT: readonly [number, Arbitrary<unknown>][]Parametersrest...arbitraries: [...T[]]The arbitraries to select one of.Returns Dependent<ReturnType<[...T][number][1][value]>[value]>An arbitrary that is randomly chosen from the weighted list.
It generates an integer between 0 and the number of arbitraries passed in, and then generates a weighted value from the corresponding arbitrary.
Example