@metreeca/blue - v0.9.1
    Preparing search index...

    Function cardinality

    • Creates a value range factory with custom cardinality constraints.

      Returns a factory function that creates ranges with the specified minimum and maximum counts.

      Type Parameters

      • L extends number | undefined

        The minimum count constraint type

      • U extends number | undefined = undefined

        The maximum count constraint type

      Parameters

      • lower: L

        Minimum number of values in the linked set

      • Optionalupper: U

        Maximum number of values in the linked set

      Returns <S extends ValueShape | Union<{ readonly [variant: string]: ValueShape }>>(
          shape: Lazy<S>,
      ) => Range<S["model"], L, U>

      A factory function that creates ranges with the specified cardinality

      const twoToFive = cardinality(2, 5);
      const tags = property(twoToFive(string()));