Function: option()
option<
T,TNil>(arb,constraints?):Arbitrary<T|TNil>
Defined in: packages/fast-check/src/arbitrary/option.ts:60
For either nil or a value coming from arb with custom frequency
Type Parameters
| Type Parameter | Default type |
|---|---|
T | - |
TNil | null |
Parameters
| Parameter | Type | Description |
|---|---|---|
arb | Arbitrary<T> | Arbitrary that will be called to generate a non nil value |
constraints | OptionConstraints<TNil> | Constraints on the option(since 1.17.0) |
Returns
Arbitrary<T | TNil>
Remarks
Since 0.0.6