codexparser 0.0.51 → 0.0.53

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.51",
3
+ "version": "0.0.53",
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": {
@@ -100,6 +100,7 @@ class CodexParser {
100
100
  let next = results[j + 1]
101
101
  while (next && next.type === "integer" && next.end.c === result.start.c) {
102
102
  passage.verses.push(next.start.v)
103
+ if (next.end.v !== next.start.v) passage.verses.push(next.end.v)
103
104
  passage.subType = next.type
104
105
  j++
105
106
  next = results[j + 1]
@@ -126,9 +127,7 @@ class CodexParser {
126
127
  return this
127
128
  }
128
129
  chapterify(chapter) {
129
- if (chapter.type === "range") {
130
- return `${chapter.start.c} - ${chapter.end}`
131
- }
130
+ return chapter.start.c
132
131
  }
133
132
 
134
133
  versify(passage) {
@@ -4,7 +4,7 @@ const util = require("util")
4
4
  const dump = (item) => {
5
5
  console.log(util.inspect(item, { depth: null, colors: true }))
6
6
  }
7
- const string = "Psalm 109-110"
7
+ const string = "Joel 4:13 Mark 4:29 Revelation 14:15,18,19"
8
8
  const parser = new BibleParser()
9
9
  const result = parser.parse(string)
10
10
  dump(result.getPassages())