UNPKG

quran-meta

Version:

Library with meta data and functionality related to Holy Quran

21 lines (18 loc) 898 B
const require_validation = require('./validation.cjs'); const require_findAyahIdBySurah = require('./findAyahIdBySurah.cjs'); const require_findRubAlHizbByAyahId = require('./findRubAlHizbByAyahId.cjs'); //#region src/findRubAlHizb.ts /** * Finds the Juz (part) and Rub-ul-Hizb/Maqra (quarter section) 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. * @returns An object containing the Juz (part) number, Hizb (section) number, and the index of the Hizb that the given Ayah belongs to. */ function findRubAlHizb(surah, ayah = 1) { require_validation.checkValidSurah(surah); const ayahId = require_findAyahIdBySurah.findAyahIdBySurah(surah, ayah); return require_findRubAlHizbByAyahId.findRubAlHizbByAyahId(ayahId); } //#endregion exports.findRubAlHizb = findRubAlHizb;