quran-meta
Version:
Library with meta data and functionality related to Holy Quran
10 lines (9 loc) • 343 B
JavaScript
import { HizbQuarterList } from "./lists/hizbQuarterList.mjs";
import { binarySearch } from "./utils.mjs";
import { checkValidAyahId } from "./validation.mjs";
export function findRubAlHizbByAyahId(ayahId) {
checkValidAyahId(ayahId);
const jj = binarySearch(HizbQuarterList, ayahId);
const page = jj < 0 ? -jj - 2 : jj;
return page;
}