quran-meta
    Preparing search index...

    Function convertAyah

    • Converts an ayah reference from one riwaya's numbering to another's.

      Riwayas follow different counting traditions (Kufi, Madani, Makki, Basri), so the same text can be numbered differently: الم is ayah 2:1 in Hafs but part of 2:1 together with Hafs 2:2 in Warsh. The result is the ayah in to that contains the first word of the given ayah. Surah numbers never change between riwayas.

      The basmala of Al-Fatiha, which only some riwayas count as an ayah, maps to the first ayah.

      Parameters

      • surah: Surah

        Surah number

      • ayah: AyahNo

        Ayah number in the from riwaya

      • from: "Bazzi" | "Douri" | "Hafs" | "Qalun" | "Qunbul" | "Shuba" | "Sousi" | "Warsh"

        Riwaya the reference is written in

      • to: "Bazzi" | "Douri" | "Hafs" | "Qalun" | "Qunbul" | "Shuba" | "Sousi" | "Warsh"

        Riwaya to convert to

      Returns SurahAyah

      The [surah, ayah] in the to riwaya

      RangeError If the surah or ayah does not exist in the from riwaya

      convertAyah(2, 2, "Hafs", "Warsh") // [2, 1]
      convertAyah(2, 255, "Hafs", "Warsh") // [2, 253]
      convertAyah(1, 1, "Warsh", "Hafs") // [1, 2]