• Generate non-contiguous ranges of values by mapping integer values to constant

    Type Parameters

    • T

    Parameters

    • Rest...entries: {
          build: ((idInGroup: number) => T);
          num: number;
      }[]

    Returns Arbitrary<T>

    // generate alphanumeric values (a-z0-9)
    mapToConstant(
    { num: 26, build: v => String.fromCharCode(v + 0x61) },
    { num: 10, build: v => String.fromCharCode(v + 0x30) },
    )

    Since 1.14.0