Function validateUintRange

Validates if a given value falls within a specified range. This function checks if the value is a positive integer and within the specified range. If the value or the range values are not positive integers, an error is thrown. If the maximum value is smaller than the minimum value, an error is thrown. If the value is smaller than the minimum value, an error is thrown. If the value is larger than the maximum value, an error is thrown.

  • Throws an error if the value or the range values are not positive integers, if the maximum value is smaller than the minimum value, if the value is smaller than the minimum value, or if the value is larger than the maximum value.
  • Parameters

    • value: number

      The value to be validated.

    • Optionalmin: number = 0

      The minimum value of the range.

    • Optionalmax: number = MAX_UINT

      The maximum value of the range.

    Returns boolean

    • Returns true if the value is within the specified range.