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