quran-meta
Version:
Library with meta data and functionality related to Holy Quran
26 lines (24 loc) • 1.16 kB
JavaScript
const require_findSurahAyahByAyahId = require('./findSurahAyahByAyahId.cjs');
const require_hizbQuarterList = require('./lists/hizbQuarterList.cjs');
const require_getRubAlHizb = require('./getRubAlHizb.cjs');
//#region src/getRubAlHizbMeta.ts
/**
* Retrieves the metadata for a specific quarter (rub' al-hizb) of the Quran.
*
* @param quarterIndex - The index of the quarter (rub' al-hizb) to retrieve metadata for, where 1 is the first quarter.
* @returns An object containing the metadata for the specified quarter, including the juz' (part), hizb (section), and the quarter (rub' al-hizb) index.
*/
function getRubAlHizbMeta(quarterIndex) {
const res = require_getRubAlHizb.getRubAlHizb(quarterIndex);
const [firstAyahId, nextJuzAyahId] = [require_hizbQuarterList.HizbQuarterList[quarterIndex], require_hizbQuarterList.HizbQuarterList[quarterIndex + 1]];
const lastAyahId = nextJuzAyahId - 1;
return {
firstAyahId,
lastAyahId,
first: require_findSurahAyahByAyahId.findSurahAyahByAyahId(firstAyahId),
last: require_findSurahAyahByAyahId.findSurahAyahByAyahId(lastAyahId),
...res
};
}
//#endregion
exports.getRubAlHizbMeta = getRubAlHizbMeta;