UNPKG

quran-meta

Version:

Library with meta data and functionality related to Holy Quran

19 lines (17 loc) 612 B
const require_validation = require('./validation.cjs'); const require_utils = require('./utils.cjs'); //#region src/isAyahPageFirst.ts /** * Determines if the given ayah is the first ayah of a juz. * * @param ayahId - The ayah id . * @param data - The Lists object for the riwaya. * @returns The page number if the ayah is the first ayah of the page, otherwise -1. */ function isAyahPageFirst(ayahId, data) { require_validation.checkValidAyahId(ayahId, data.meta); const PageList = data.PageList; return require_utils.binarySearch(PageList, ayahId); } //#endregion exports.isAyahPageFirst = isAyahPageFirst;