UNPKG

quran-meta

Version:

Library with meta data and functionality related to Holy Quran

15 lines (14 loc) 451 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.findJuzByAyahId = findJuzByAyahId; var _juzList = require("./lists/juzList.cjs"); var _utils = require("./utils.cjs"); var _validation = require("./validation.cjs"); function findJuzByAyahId(ayahId) { (0, _validation.checkValidAyahId)(ayahId); const jj = (0, _utils.binarySearch)(_juzList.JuzList, ayahId); const juz = jj < 0 ? -jj - 2 : jj; return juz; }