UNPKG

quran-meta

Version:

Library with meta data and functionality related to Holy Quran

20 lines (18 loc) 990 B
const require_validation = require('./validation.cjs'); const require_findAyahIdBySurah = require('./findAyahIdBySurah.cjs'); const require_findThumunAlHizbByAyahId = require('./findThumunAlHizbByAyahId.cjs'); //#region src/findThumunAlHizb.ts /** * Finds the Juz (part) and thumun-ul-Hizb (Eighth 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. * @param riwaya - The riwaya. Defaults to "Qalun" 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 findThumunAlHizb(surah, ayah = 1, data) { require_validation.checkValidSurah(surah, data.meta); return require_findThumunAlHizbByAyahId.findThumunAlHizbByAyahId(require_findAyahIdBySurah.findAyahIdBySurah(surah, ayah, data), data); } //#endregion exports.findThumunAlHizb = findThumunAlHizb;