Skip to main content

Interface: OptionConstraints<TNil>

Defined in: packages/fast-check/src/arbitrary/option.ts:14

Constraints to be applied on option

Remarks

Since 2.2.0

Type Parameters

Type ParameterDefault type
TNilnull

Properties

depthIdentifier?

optional depthIdentifier?: string | DepthIdentifier

Defined in: packages/fast-check/src/arbitrary/option.ts:48

Depth identifier can be used to share the current depth between several instances.

By default, if not specified, each instance of option will have its own depth. In other words: you can have depth=1 in one while you have depth=100 in another one.

Remarks

Since 2.14.0


depthSize?

optional depthSize?: DepthSize

Defined in: packages/fast-check/src/arbitrary/option.ts:33

While going deeper and deeper within a recursive structure (see letrec), this factor will be used to increase the probability to generate nil.

Remarks

Since 2.14.0


freq?

optional freq?: number

Defined in: packages/fast-check/src/arbitrary/option.ts:20

The probability to build a nil value is of 1 / freq.

Default Value

6

Remarks

Since 1.17.0


maxDepth?

optional maxDepth?: number

Defined in: packages/fast-check/src/arbitrary/option.ts:39

Maximal authorized depth. Once this depth has been reached only nil will be used.

Default Value

Number.POSITIVE_INFINITY — defaulting seen as "max non specified" when defaultSizeToMaxWhenMaxSpecified=true

Remarks

Since 2.14.0


nil?

optional nil?: TNil

Defined in: packages/fast-check/src/arbitrary/option.ts:26

The nil value

Default Value

null

Remarks

Since 1.17.0