-
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
2aa2262
commit 9bb8955
Showing
19 changed files
with
33,929 additions
and
35,486 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,35 @@ | ||
const bibleData = require(`./data/bible.json`); | ||
const abbreviations = require(`./utils/abbreviations`); | ||
const { isValidBook, isValidChapter, isValidVerse } = require(`./utils/validation`); | ||
|
||
function getVerse(bookName, chapterNumber, verseNumber) { | ||
if (!isValidVerse(bookName, chapterNumber, verseNumber)) { | ||
throw new Error('Invalid verse reference'); | ||
} | ||
return bibleData[bookName][chapterNumber][verseNumber - 1]; | ||
} | ||
|
||
function getChapter(bookName, chapterNumber) { | ||
if (!isValidChapter(bookName, chapterNumber)) { | ||
throw new Error('Invalid chapter reference'); | ||
} | ||
return bibleData[bookName][chapterNumber]; | ||
} | ||
|
||
function getBook(bookName) { | ||
if (!isValidBook(bookName)) { | ||
throw new Error('Invalid book name'); | ||
} | ||
return bibleData[bookName]; | ||
} | ||
|
||
function resolveAbbreviation(abbreviation) { | ||
return abbreviations[abbreviation] || abbreviation; | ||
} | ||
|
||
module.exports = { | ||
getVerse, | ||
getChapter, | ||
getBook, | ||
resolveAbbreviation, | ||
}; |
This file was deleted.
Oops, something went wrong.
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,35 @@ | ||
"use strict"; | ||
|
||
var bibleData = require("./data/bible.json"); | ||
var abbreviations = require("./utils/abbreviations"); | ||
var _require = require("./utils/validation"), | ||
isValidBook = _require.isValidBook, | ||
isValidChapter = _require.isValidChapter, | ||
isValidVerse = _require.isValidVerse; | ||
function getVerse(bookName, chapterNumber, verseNumber) { | ||
if (!isValidVerse(bookName, chapterNumber, verseNumber)) { | ||
throw new Error('Invalid verse reference'); | ||
} | ||
return bibleData[bookName][chapterNumber][verseNumber - 1]; | ||
} | ||
function getChapter(bookName, chapterNumber) { | ||
if (!isValidChapter(bookName, chapterNumber)) { | ||
throw new Error('Invalid chapter reference'); | ||
} | ||
return bibleData[bookName][chapterNumber]; | ||
} | ||
function getBook(bookName) { | ||
if (!isValidBook(bookName)) { | ||
throw new Error('Invalid book name'); | ||
} | ||
return bibleData[bookName]; | ||
} | ||
function resolveAbbreviation(abbreviation) { | ||
return abbreviations[abbreviation] || abbreviation; | ||
} | ||
module.exports = { | ||
getVerse: getVerse, | ||
getChapter: getChapter, | ||
getBook: getBook, | ||
resolveAbbreviation: resolveAbbreviation | ||
}; |
Oops, something went wrong.