Function findRangeAroundAyah

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

    Parameters

    • surah: number

      The surah number (1-114)

    • ayah: number

      The ayah number within the surah, or the absolute ayah ID if ayahMode is true

    • mode:
          | "all"
          | "page"
          | "juz"
          | "surah"
          | "ayah"

      The range mode: "juz", "surah", "ayah", "page", or "all"

    • ayahMode: boolean = false

      If true, treats the ayah parameter as an absolute ayah ID

    Returns SurahAyah

    A tuple containing the start and end ayah IDs of the range