codexparser 0.1.19 → 0.1.21
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 +2 -2
- package/src/CodexParser.js +15 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codexparser",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.21",
|
|
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": {
|
|
@@ -30,4 +30,4 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"unidecode": "^1.1.0"
|
|
32
32
|
}
|
|
33
|
-
}
|
|
33
|
+
}
|
package/src/CodexParser.js
CHANGED
|
@@ -338,7 +338,18 @@ class CodexParser {
|
|
|
338
338
|
parsedPassage.verses.push(versePart) // Add single verse to array
|
|
339
339
|
} else {
|
|
340
340
|
parsedPassage.chapter = Number(versePart)
|
|
341
|
-
|
|
341
|
+
if (!this.chapterVerses[book][parsedPassage.chapter]) {
|
|
342
|
+
parsedPassage.valid = this._isValid(parsedPassage, passage.reference)
|
|
343
|
+
} else {
|
|
344
|
+
parsedPassage.verses = [
|
|
345
|
+
this.chapterVerses[book][parsedPassage.chapter][0] +
|
|
346
|
+
"-" +
|
|
347
|
+
this.chapterVerses[book][parsedPassage.chapter][
|
|
348
|
+
this.chapterVerses[book][parsedPassage.chapter].length - 1
|
|
349
|
+
],
|
|
350
|
+
]
|
|
351
|
+
parsedPassage.type = "single_chapter"
|
|
352
|
+
}
|
|
342
353
|
}
|
|
343
354
|
}
|
|
344
355
|
}
|
|
@@ -346,7 +357,9 @@ class CodexParser {
|
|
|
346
357
|
parsedPassage.scripture = this.scripturize(parsedPassage)
|
|
347
358
|
})
|
|
348
359
|
|
|
349
|
-
|
|
360
|
+
if (parsedPassage.valid) {
|
|
361
|
+
parsedPassage.valid = this._isValid(parsedPassage, passage.reference)
|
|
362
|
+
}
|
|
350
363
|
|
|
351
364
|
return parsedPassage
|
|
352
365
|
})
|