codexparser 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/CodexParser.js +2 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codexparser",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "This is a Javascript Bible parser and text scanner. It will search through texts and collate all scripture references into an array and parse them into objects, and it will parse passages into objects by book, chapter, verse, and testament. ",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
package/src/CodexParser.js
CHANGED
|
@@ -165,7 +165,7 @@ class CodexParser {
|
|
|
165
165
|
}
|
|
166
166
|
|
|
167
167
|
// Trim any period from the end of the reference
|
|
168
|
-
chapterVerse = chapterVerse.trim().replace(/[
|
|
168
|
+
chapterVerse = chapterVerse.trim().replace(/[^a-zA-Z0-9]+$/, "")
|
|
169
169
|
|
|
170
170
|
// Replace any periods within the reference with colons for easier parsing
|
|
171
171
|
const formattedReference = chapterVerse.replace(/\./g, ":")
|
|
@@ -236,13 +236,9 @@ class CodexParser {
|
|
|
236
236
|
parsedPassage.verses = this.chapterVerses[book][startChapter].slice(
|
|
237
237
|
this.chapterVerses[book][startChapter].indexOf(Number(startVerse))
|
|
238
238
|
)
|
|
239
|
-
} else {
|
|
240
|
-
parsedPassage.verses.push(startVerse.trim())
|
|
241
239
|
}
|
|
242
240
|
|
|
243
241
|
// Handle same-chapter ranges (e.g., "27:27-29") and multi-chapter ranges (e.g., "Ex 2:1-3:4")
|
|
244
|
-
//TODO: Need to check for a multi chapter verse range and if fill out the verses before the verse of
|
|
245
|
-
// The second chapter.
|
|
246
242
|
if (end.includes(separator)) {
|
|
247
243
|
let [endChapter, endVerse] = end.split(separator)
|
|
248
244
|
if (Number(endChapter) !== Number(startChapter)) {
|
|
@@ -275,6 +271,7 @@ class CodexParser {
|
|
|
275
271
|
verses: this.chapterVerses[book][end],
|
|
276
272
|
}
|
|
277
273
|
} else {
|
|
274
|
+
//
|
|
278
275
|
parsedPassage.verses.push(`${startVerse}-${end}`)
|
|
279
276
|
}
|
|
280
277
|
} else {
|