Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
The-Best-Codes committed Dec 12, 2024
1 parent dc509a7 commit a961e86
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"homepage": "https://github.com/The-Best-Codes/best-bible#readme",
"devDependencies": {
"@types/bun": "^1.1.14",
"@types/node": "^22.10.1",
"@types/node": "^22.10.2",
"bun-types": "^1.1.38",
"typescript": "^5.7.2"
}
Expand Down
30 changes: 15 additions & 15 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export function getVerse(
/**
* @deprecated Use of `cleanVerse` will be removed in a future version. Verses are now always cleaned by default.
*/
cleanVerse: boolean = true
cleanVerse: boolean = true,
) {
if (!isValidVerse(bookName, chapterNumber, verseNumber)) {
throw new Error("Invalid verse reference");
Expand Down Expand Up @@ -113,7 +113,7 @@ export function getChapter(
/**
* @deprecated Use of `cleanVerse` will be removed in a future version. Verses are now always cleaned by default.
*/
cleanVerse: boolean = true
cleanVerse: boolean = true,
) {
if (!isValidChapter(bookName, chapterNumber)) {
throw new Error("Invalid chapter reference");
Expand All @@ -133,7 +133,7 @@ export function getChapter(
(content: string, index: number) =>
`${bookName} ${chapterNumber}:${index + 1} - ${
cleanVerse ? parseVerse(content, "string") : content
}`
}`,
)
.join("\n");
} else {
Expand All @@ -155,7 +155,7 @@ export function getBook(
/**
* @deprecated Use of `cleanVerse` will be removed in a future version. Verses are now always cleaned by default.
*/
cleanVerse: boolean = true
cleanVerse: boolean = true,
) {
if (!isValidBook(bookName)) {
throw new Error("Invalid book name");
Expand All @@ -169,7 +169,7 @@ export function getBook(
chapter: chapterNumber,
verse: (index + 1).toString(),
content: cleanVerse ? parseVerse(content, "string") : content,
}))
})),
);
} else if (outputType === "string") {
return Object.entries(chapters)
Expand All @@ -179,9 +179,9 @@ export function getBook(
(content: string, index: number) =>
`${bookName} ${chapterNumber}:${index + 1} - ${
cleanVerse ? parseVerse(content, "string") : content
}`
}`,
)
.join("\n")
.join("\n"),
)
.join("\n\n");
} else {
Expand Down Expand Up @@ -252,7 +252,7 @@ export function getRange(
/**
* @deprecated Use of `cleanVerse` will be removed in a future version. Verses are now always cleaned by default.
*/
cleanVerse: boolean = true
cleanVerse: boolean = true,
) {
if (
!isValidVerse(startBookName, startChapterNumber, startVerseNumber) ||
Expand Down Expand Up @@ -310,7 +310,7 @@ export function getRange(
});
} else if (outputType === "string") {
verses.push(
`${bookName} ${chapterNumber}:${verseNumber} - ${content}`
`${bookName} ${chapterNumber}:${verseNumber} - ${content}`,
);
} else {
verses.push(content);
Expand Down Expand Up @@ -339,7 +339,7 @@ export function searchVerse(
query: string,
caseSensitive: boolean = false,
exactMatch: boolean = false,
outputType: string = "indexed"
outputType: string = "indexed",
) {
let searchResults = [];

Expand All @@ -359,7 +359,7 @@ export function searchVerse(
if (exactMatch) {
const regex = new RegExp(
`\\b${normalizedQuery}\\b`,
caseSensitive ? "" : "i"
caseSensitive ? "" : "i",
);
matchCondition = regex.test(normalizedContent);
} else {
Expand All @@ -383,7 +383,7 @@ export function searchVerse(
return searchResults
.map(
(result) =>
`${result.book} ${result.chapter}:${result.verse} - ${result.content}`
`${result.book} ${result.chapter}:${result.verse} - ${result.content}`,
)
.join("\n");
} else if (outputType === "indexed") {
Expand Down Expand Up @@ -411,16 +411,16 @@ export function bibleStats() {
books: Object.keys(bibleData).length,
chapters: Object.values(bibleData).reduce(
(sum: number, book: any) => sum + Object.keys(book).length,
0
0,
),
verses: Object.values(bibleData).reduce(
(sum: number, book: any) =>
sum +
Object.values(book).reduce(
(sum: number, chapter: any) => sum + chapter.length,
0
0,
),
0
0,
),
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/utils/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function isValidChapter(bookName: string, chapterNumber: number) {
function isValidVerse(
bookName: string,
chapterNumber: number,
verseNumber: number
verseNumber: number,
) {
if (!isValidChapter(bookName, chapterNumber)) {
return false;
Expand Down

0 comments on commit a961e86

Please sign in to comment.