-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
16c356f
commit 6edfc8b
Showing
20 changed files
with
34,149 additions
and
67,881 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
"use strict"; | ||
const abbreviations = { | ||
'Gen': 'Genesis', | ||
'Ex': 'Exodus', | ||
'Lev': 'Leviticus', | ||
'Num': 'Numbers', | ||
'Deu': 'Deuteronomy', | ||
'Jos': 'Joshua', | ||
'Jdg': 'Judges', | ||
'Rut': 'Ruth', | ||
'1Sa': '1 Samuel', | ||
'2Sa': '2 Samuel', | ||
'1Ki': '1 Kings', | ||
'2Ki': '2 Kings', | ||
'1Ch': '1 Chronicles', | ||
'2Ch': '2 Chronicles', | ||
'Ezr': 'Ezra', | ||
'Neh': 'Nehemiah', | ||
'Est': 'Esther', | ||
'Job': 'Job', | ||
'Psa': 'Psalms', | ||
'Pro': 'Proverbs', | ||
'Ecc': 'Ecclesiastes', | ||
'Sng': 'Song of Solomon', | ||
'Isa': 'Isaiah', | ||
'Jer': 'Jeremiah', | ||
'Lam': 'Lamentations', | ||
'Eze': 'Ezekiel', | ||
'Dan': 'Daniel', | ||
'Hos': 'Hosea', | ||
'Joe': 'Joel', | ||
'Amo': 'Amos', | ||
'Oba': 'Obadiah', | ||
'Jnh': 'Jonah', | ||
'Mic': 'Micah', | ||
'Nah': 'Nahum', | ||
'Hab': 'Habakkuk', | ||
'Zeph': 'Zephaniah', | ||
'Hag': 'Haggai', | ||
'Zech': 'Zechariah', | ||
'Mal': 'Malachi', | ||
'Matt': 'Matthew', | ||
'Mark': 'Mark', | ||
'Luk': 'Luke', | ||
'Jhn': 'John', | ||
'Act': 'Acts', | ||
'Rom': 'Romans', | ||
'1Co': '1 Corinthians', | ||
'2Co': '2 Corinthians', | ||
'Gal': 'Galatians', | ||
'Eph': 'Ephesians', | ||
'Phil': 'Philippians', | ||
'Col': 'Colossians', | ||
'1Th': '1 Thessalonians', | ||
'2Th': '2 Thessalonians', | ||
'1Ti': '1 Timothy', | ||
'2Ti': '2 Timothy', | ||
'Tit': 'Titus', | ||
'Phm': 'Philemon', | ||
'Heb': 'Hebrews', | ||
'Jam': 'James', | ||
'1Pe': '1 Peter', | ||
'2Pe': '2 Peter', | ||
'1Jn': '1 John', | ||
'2Jn': '2 John', | ||
'3Jn': '3 John', | ||
'Jude': 'Jude', | ||
'Rev': 'Revelation' | ||
}; | ||
module.exports = abbreviations; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
"use strict"; | ||
const bibleData = require('../data/bible.json'); | ||
/** | ||
* Checks if the provided book name is a valid entry in the bibleData. | ||
* | ||
* @param {string} bookName - The name of the book to check. | ||
* @return {boolean} Indicates whether the book name is valid. | ||
*/ | ||
function isValidBook(bookName) { | ||
return bibleData.hasOwnProperty(bookName); | ||
} | ||
/** | ||
* Checks if the given chapter number is valid for the specified book. | ||
* | ||
* @param {string} bookName - The name of the book. | ||
* @param {number} chapterNumber - The number of the chapter. | ||
* @return {boolean} Returns true if the chapter number is valid, false otherwise. | ||
*/ | ||
function isValidChapter(bookName, chapterNumber) { | ||
if (!isValidBook(bookName)) { | ||
return false; | ||
} | ||
const book = bibleData[bookName]; | ||
return book.hasOwnProperty(chapterNumber); | ||
} | ||
/** | ||
* Checks if the given verse number is valid for the specified book and chapter. | ||
* | ||
* @param {string} bookName - The name of the book. | ||
* @param {number} chapterNumber - The number of the chapter. | ||
* @param {number} verseNumber - The number of the verse. | ||
* @return {boolean} Returns true if the verse number is valid, false otherwise. | ||
*/ | ||
function isValidVerse(bookName, chapterNumber, verseNumber) { | ||
if (!isValidChapter(bookName, chapterNumber)) { | ||
return false; | ||
} | ||
const chapter = bibleData[bookName][chapterNumber]; | ||
return verseNumber >= 1 && verseNumber <= chapter.length; | ||
} | ||
module.exports = { | ||
isValidBook, | ||
isValidChapter, | ||
isValidVerse, | ||
}; |
Oops, something went wrong.