Skip to content

Commit 9fa71df

Browse files
committed
chore: some cleanup and optimization
1 parent 3245ff1 commit 9fa71df

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

src/findAyahIdBySurah.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getSurahMeta } from "./getSurahMeta"
1+
import { SurahList } from "./lists/surahList"
22
import { AyahId, AyahNo, Surah } from "./types"
33
import { checkValidSurahAyah } from "./validation"
44

@@ -10,6 +10,6 @@ import { checkValidSurahAyah } from "./validation"
1010
*/
1111
export function findAyahIdBySurah(surah: Surah, ayah: AyahNo): AyahId {
1212
checkValidSurahAyah(surah, ayah)
13-
const [startAyahId] = getSurahMeta(surah)
13+
const [startAyahId] = SurahList[surah]
1414
return startAyahId + ayah - 1
1515
}

src/findJuzAndShift.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ export function findJuzAndShift(
2424
leftAyahId: AyahId
2525
ayahsBetweenJuzSurah: AyahCountBetweenJuzSurah
2626
} {
27-
checkValidSurah(surah)
2827
const ayahId: AyahId = findAyahIdBySurah(surah, ayah)
2928

3029
const juz = findJuzByAyahId(ayahId)

tests/getAyahMeta.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getAyahMeta, meta, RukuList } from "../src"
1+
import { getAyahMeta, meta } from "../src"
22

33
describe("ayahMeta", () => {
44
it("should return correct metadata for the first ayah", () => {

0 commit comments

Comments
 (0)