quran-meta
Version:
Library with meta data and functionality related to Holy Quran
18 lines (16 loc) • 628 B
JavaScript
import { findAyahIdBySurah } from "./findAyahIdBySurah.mjs";
import { findJuzByAyahId } from "./findJuzByAyahId.mjs";
//#region src/findJuz.ts
/**
* Finds the Juz (part) of the Quran that the given Ayah (verse) belongs to.
*
* @param surah - The Surah (chapter) number.
* @param ayah - The Ayah (verse) number. Defaults to 1 if not provided.
* @param lists - The Lists object containing JuzList and SurahList.
* @returns The Juz (part) number that the given Ayah belongs to.
*/
function findJuz(surah, ayah = 1, lists) {
return findJuzByAyahId(findAyahIdBySurah(surah, ayah, lists), lists);
}
//#endregion
export { findJuz };