Function checkValidSurah

  • Validates if the provided value is a valid Surah number.

    Parameters

    • surah: unknown

      The value to validate, can be a Surah object, number, or unknown type

    Returns asserts surah is Surah

    TypeError When the provided value is not an integer

    RangeError When the provided surah number is outside the valid range (1 to total number of surahs)

    This is a type assertion function that ensures the input is a valid Surah