@blockchaincommons/dcbor-pattern - v1.0.0-beta.2
    Preparing search index...

    Class Interval

    An inclusive interval with a minimum and an optional maximum; without a maximum it is unbounded above.

    Interval.exactly(3);   // {3}
    Interval.from(1, 5); // {1,5}
    Interval.atLeast(2); // {2,}
    Index
    • Parameters

      • min: number

        The minimum (inclusive), a non-negative integer

      • Optionalmax: number

        The maximum (inclusive), a non-negative integer not below min, or undefined for unbounded

      Returns Interval

      for a bound that is not a non-negative integer, or a maximum below the minimum

    • get min(): number

      The minimum.

      Returns number

    • get max(): number | undefined

      The maximum, or undefined when unbounded.

      Returns number | undefined

    • get isSingle(): boolean

      Whether the minimum equals the maximum.

      Returns boolean

    • get isUnbounded(): boolean

      Whether there is no maximum.

      Returns boolean

    • {start,end}, or {start,} without end.

      Parameters

      • start: number
      • Optionalend: number

      Returns Interval

    • Whether count lies in the interval.

      Parameters

      • count: number

      Returns boolean

    • {n}, {n,m} or {n,}.

      Returns string

    • ?, *, + where one applies, else the range notation.

      Returns string

    • The range notation.

      Returns string