@hegeldev/hegel
    Preparing search index...

    Class Mapped<U, S>

    The result of Generator.map: prints the transformed value as PrettyPrinter.value does.

    Type Parameters

    Hierarchy (View Summary)

    Index

    Methods

    • Only keep values that satisfy the predicate. A draw tries the engine's number of values (3) and rejects the test case if none satisfies it. It prints as this generator does, printing only the accepted value.

      Parameters

      • predicate: (value: U) => boolean

      Returns PrintableGenerator<U>

    • Print each drawn value by calling print with the value and the printer positioned where it goes: the way to give a generator whose values have no useful JavaScript representation (a function, a handle) a printed form, or to print a value differently from how it prints as a value. The generator keeps this one's label and schema.

      Parameters

      Returns PrintableGenerator<U>

      const digits = integers({ minValue: 0, maxValue: 9 }).printWith((d, p) => p.text(`Digit(${d})`));