Skip to main content

subsuper

Callable


  • It generates a pair of sets, and returns the first set, the union of the two sets, and the difference between the union and the first set

    Example

    random(subsuper(integer({ min: 0, max: 100 })))
    // => [[1, 2], [1, 2, 4, 5], [4, 5]]

    Type parameters

    • T

    Parameters

    • arbitrary: Arbitrary<T>

      The arbitrary to generate a set of.

    • constraints: MaybePartial<SubsuperGenerator<T>> = {}

      The constraints to generate the set with.

    Returns Dependent<[subset: T[], superset: T[], complement: T[]]>

    An arbitrary that is randomly chosen from the weighted list.