quran-meta
    Preparing search index...

    Function findRangeAroundAyah

    • Finds the range of ayahs surrounding a given ayah based on specified mode

      Parameters

      • ayahId: number

        The unique identifier of the ayah

      • mode: RangeMode

        The scope for finding the range:

        • "juz": Returns range of ayahs in the same juz
        • "surah": Returns range of ayahs in the same surah
        • "ayah": Returns the single ayah as both start and end of range
        • "page": Returns range of ayahs on the same page
        • "ruku": Returns range of ayahs on the same ruku
        • "all": Returns range covering all ayahs (1 to total number of ayahs)

      Returns AyahRange

      An array of two numbers representing the start and end ayah IDs of the range [startAyahId, endAyahId]