quran-meta
Version:
Library with meta data and functionality related to Holy Quran
19 lines (18 loc) • 587 B
JavaScript
import { findSurahAyahByAyahId } from "./findSurahAyahByAyahId.mjs";
import { getRubAlHizb } from "./getRubAlHizb.mjs";
import { HizbQuarterList } from "./lists/hizbQuarterList.mjs";
export function getRubAlHizbMeta(quarterIndex) {
const res = getRubAlHizb(quarterIndex);
const [firstAyahId, nextJuzAyahId] = [
HizbQuarterList[quarterIndex],
HizbQuarterList[quarterIndex + 1]
];
const lastAyahId = nextJuzAyahId - 1;
return {
firstAyahId,
lastAyahId,
first: findSurahAyahByAyahId(firstAyahId),
last: findSurahAyahByAyahId(lastAyahId),
...res
};
}