UNPKG

quran-meta

Version:

Library with meta data and functionality related to Holy Quran

19 lines (17 loc) 585 B
import { checkValidAyahId } from "./validation.js"; import { JuzList } from "./lists/juzList.js"; import { binarySearch } from "./utils.js"; //#region src/isAyahJuzFirst.ts /** * Returns the Juz (part) number that the given Ayah (verse) belongs to. * * * @param ayahId - The Ayah Id (verse) number. * @returns The Juz (part) number that the given Ayah belongs to. Returns Positive number if ayah is first ayah of juz, number is juz number */ function isAyahJuzFirst(ayahId) { checkValidAyahId(ayahId); return binarySearch(JuzList, ayahId); } //#endregion export { isAyahJuzFirst };