Version 1

This commit is contained in:
George Powell
2025-12-16 10:23:24 -05:00
commit 530291d271
30 changed files with 1662 additions and 0 deletions

23
src/lib/server/bible.ts Normal file
View File

@@ -0,0 +1,23 @@
import type { BibleBook, Testament, BibleSection } from '$lib/types/bible';
import { bibleBooks } from '$lib/types/bible';
export function getBookById(id: string): BibleBook | undefined {
return bibleBooks.find((book) => book.id === id);
}
export function getBooksByTestament(testament: Testament): BibleBook[] {
return bibleBooks.filter((book) => book.testament === testament);
}
export function getBooksBySection(section: BibleSection): BibleBook[] {
return bibleBooks.filter((book) => book.section === section);
}
export function isAdjacent(bookId1: string, bookId2: string): boolean {
const book1 = getBookById(bookId1);
const book2 = getBookById(bookId2);
if (!book1 || !book2) return false;
return Math.abs(book1.order - book2.order) === 1;
}
export { bibleBooks };