quran-meta
    Preparing search index...

    Function isValidSurahAyah

    • Type guard function that checks if a tuple of two numbers represents a valid Surah and Ayah combination.

      Parameters

      • x: [unknown, unknown]

        A tuple containing [surahNumber, ayahNumber]

      • data: RiwayaData

      Returns x is SurahAyah

      True if the tuple represents a valid Surah-Ayah combination, false otherwise

      isValidSurahAyah([1, 7], HafsLists) // true - Al-Fatiha has 7 ayahs
      isValidSurahAyah([1, 8], HafsLists) // false - Al-Fatiha only has 7 ayahs
      isValidSurahAyah([115, 1], HafsLists) // false - there are only 114 surahs