quran-meta
Version:
Library with meta data and functionality related to Holy Quran
18 lines (16 loc) • 543 B
JavaScript
import { SurahList } from "./lists/surahList.js";
import { checkValidSurahAyah } from "./validation.js";
//#region src/findAyahIdBySurah.ts
/**
* Get the ayah ID for the given surah and ayah number.
* @param surah - The surah number.
* @param ayah - The ayah number within the surah.
* @returns The ayah ID for the given surah and ayah number.
*/
function findAyahIdBySurah(surah, ayah) {
checkValidSurahAyah(surah, ayah);
const [startAyahId] = SurahList[surah];
return startAyahId + ayah - 1;
}
//#endregion
export { findAyahIdBySurah };