nullable
nullable<
T
>(a
,constraints
):Dependent
<T
|null
>
It takes an arbitrary and returns a new arbitrary that can generate null values.
Example
random(nullable(integer()))// => null
random(nullable(integer()))// => 1234
random(nullable(integer({symbol: Nothing})))// => Nothing
Type Parameters
• T
Parameters
a
Arbitrary
<T
>
constraints
MaybePartial
<NullableGenerator
> = {}
The constraints used to generate arbitrary values.
Returns
Dependent
<T
| null
>
An nullable version of the given arbitrary.