codexparser 0.0.71 → 0.0.73

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.0.71",
3
+ "version": "0.0.73",
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": {
@@ -91,6 +91,10 @@ class CodexParser {
91
91
  this.scan(reference)
92
92
  for (let i = 0; i < this.found.length; i++) {
93
93
  const result = this.found[i]
94
+ if (!result.entities[0].valid.valid || result.entities[0].valid.messages.end_chapter_not_exist) {
95
+ continue
96
+ }
97
+
94
98
  if (result.type === "range" && result.start.b !== result.end.b) {
95
99
  console.log("=================")
96
100
  const newPassageFound = result.end.b + " " + result.end.c + ":" + result.end.v
@@ -116,9 +120,11 @@ class CodexParser {
116
120
  next.start.b === result.end.b &&
117
121
  next.end.c === result.start.c
118
122
  ) {
119
- passage.verses.push(next.start.v)
120
- if (next.end.v !== next.start.v) passage.verses.push(next.end.v)
121
- passage.subType = next.type
123
+ if (next.start.v > result.start.v) {
124
+ passage.verses.push(next.start.v)
125
+ if (next.end.v !== next.start.v) passage.verses.push(next.end.v)
126
+ passage.subType = next.type
127
+ }
122
128
  i++
123
129
  next = this.found[i + 1]
124
130
  }
@@ -11,5 +11,5 @@ parser.options({
11
11
  invalid_sequence_strategy: "include",
12
12
  single_chapter_1_strategy: "verse",
13
13
  })
14
- const result = parser.parse("Gen 13:14-16 Clement of Letter to the Romanse, Letter to the Corinthians [51; 77; 111] 10:4-5; Jubilees [14; 43; 46; 118; 175; 179] 13:19-20; Genesis Apocryphon 21:8-10, 13 // Gen 13:15 Gal 3:16; Pseudo-Philo 8:3 Allusions - Jub 19:21-22; QapGn 21:8-10 // Gen 13:15 - Ac 7:5")
14
+ const result = parser.parse("Gen 15:13 - Ph Her 266; QuGen 3:10; Ps-Ph 9:3")
15
15
  dump(result.getPassages())