codexparser 0.1.24 → 0.1.25

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codexparser",
3
- "version": "0.1.24",
3
+ "version": "0.1.25",
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": {
@@ -232,6 +232,7 @@ class CodexParser {
232
232
 
233
233
  this.passages = this.found.map((passage) => {
234
234
  const book = this.bookify(passage.book)
235
+ const testament = this.bible.old.find((bible) => bible === book) ? "old" : "new"
235
236
  // Initialize the parsed passage object
236
237
  const parsedPassage = {
237
238
  original: passage.book + " " + passage.reference,
@@ -239,9 +240,9 @@ class CodexParser {
239
240
  chapter: null,
240
241
  verses: [], // Verse stored as an array
241
242
  type: null, // Set type based on reference
242
- testament: this.bible.old.find((bible) => bible === book) ? "old" : "new",
243
+ testament: testament,
243
244
  index: passage.index,
244
- version: this._handleVersion(passage.version),
245
+ version: this._handleVersion(passage.version, testament),
245
246
  }
246
247
 
247
248
  // Split reference by commas to handle multiple ranges or verses (e.g., "Ge 27:27-29,39-41")
@@ -668,11 +669,11 @@ class CodexParser {
668
669
  }
669
670
  return true
670
671
  }
671
- _handleVersion(version) {
672
+ _handleVersion(version, testament) {
672
673
  if (!version) {
673
674
  return null
674
675
  }
675
- if (version.toLowerCase() === "lxx") {
676
+ if (version.toLowerCase() === "lxx" && testament.toLowerCase() === "old") {
676
677
  return {
677
678
  name: "Septuagint",
678
679
  value: "LXX",
@@ -680,7 +681,7 @@ class CodexParser {
680
681
  }
681
682
  }
682
683
 
683
- if (version.toLowerCase() === "mt") {
684
+ if (version.toLowerCase() === "mt" && testament.toLowerCase() === "old") {
684
685
  return {
685
686
  name: "Masoretic Text",
686
687
  value: "MT",