Constraints to be applied on option

Since 2.2.0

interface OptionConstraints<TNil> {
    depthIdentifier?: string | DepthIdentifier;
    depthSize?: DepthSize;
    freq?: number;
    maxDepth?: number;
    nil?: TNil;
}

Type Parameters

  • TNil = null

Properties

depthIdentifier?: string | DepthIdentifier

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.

Since 2.14.0

depthSize?: DepthSize

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

Since 2.14.0

freq?: number

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

5

Since 1.17.0

maxDepth?: number

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

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

Since 2.14.0

nil?: TNil

The nil value

null

Since 1.17.0