optional
Callable
Type parameters
- T
- O = typeof Nothing
Parameters
arbitrary: Arbitrary<T>
The arbitrary to make optional.
constraints: MaybePartial<OptionalGenerator<O>> = {}
The constraints used to generate arbitrary values.
Returns Nothing extends O ? Dependent<Maybe<T>> : Dependent<O | T>
An optional version of the given arbitrary.
optional
takes an arbitrary and returns an arbitrary that is either the original arbitrary or the optional symbolExample