Function checkValidRuku

  • Type guard that checks if a value is a valid Ruku number.

    Parameters

    • x: unknown

      The value to check

    Returns asserts x is Ruku

    If the value is not an integer number

    If the number is not within valid Ruku range

    checkValidRuku(5); // OK
    checkValidRuku("5"); // Throws TypeError
    checkValidRuku(999); // Throws RangeError