UNPKG

quran-meta

Version:

Library with meta data and functionality related to Holy Quran

13 lines (12 loc) 445 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.findSurahByAyahId = findSurahByAyahId; var _surahList = require("./lists/surahList.cjs"); var _validation = require("./validation.cjs"); function findSurahByAyahId(ayaId) { (0, _validation.checkValidAyahId)(ayaId); const suraNum = _surahList.SurahList.findIndex(x => x[0] > ayaId) - 1; return [suraNum, ayaId - _surahList.SurahList[suraNum][0] + 1]; }