UNPKG

quran-meta

Version:

Library with meta data and functionality related to Holy Quran

19 lines (18 loc) 713 B
//#region src/getRubAlHizb.ts /** * Retrieves the basic 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. * @param riwaya - The riwaya. Defaults to "Hafs" if not provided. * @returns An object containing the metadata for the specified quarter, including the juz' (part), hizb (section), and the quarter (rub' al-hizb) index. */ function getRubAlHizb(quarterIndex) { return { juz: Math.floor((quarterIndex - 1) / 8) + 1, hizbId: Math.floor((quarterIndex - 1) / 4) + 1, juzPart: quarterIndex % 8 || 8, rubAlHizbId: quarterIndex }; } //#endregion export { getRubAlHizb };