codexparser 0.3.0 → 0.3.1
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/CHANGELOG.md +11 -0
- package/RELEASE_NOTES_v0.3.0.md +32 -0
- package/package.json +1 -1
- package/src/core/ReferenceParser.js +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project are documented here. For full details, see the Release Notes in README and the GitHub Releases page.
|
|
4
4
|
|
|
5
|
+
## 0.3.0 — 2026-01-10
|
|
6
|
+
|
|
7
|
+
- Added `convertVersion(targetVersion)` method on passage objects for versification conversion.
|
|
8
|
+
- Accepts version string: `"eng"`, `"lxx"`, `"mt"`, or `"bhs"` (alias for MT).
|
|
9
|
+
- Automatically converts chapter/verse references between versifications when versification data exists.
|
|
10
|
+
- Returns same reference with updated version metadata if no versification exists.
|
|
11
|
+
- Tested with Psalms, Zechariah, and NT passages.
|
|
12
|
+
- Published to npm as `codexparser@0.3.0`.
|
|
13
|
+
|
|
14
|
+
See the release: https://github.com/jeremyam/CodexParser/releases/tag/v0.3.0
|
|
15
|
+
|
|
5
16
|
## 0.2.0 — 2026-01-10
|
|
6
17
|
|
|
7
18
|
- Refactored internal architecture into clear folders:
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# CodexParser 0.3.0
|
|
2
|
+
|
|
3
|
+
Added `convertVersion(targetVersion)` method on passage objects for versification conversion.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **New Method**: `passage.convertVersion(targetVersion)` accepts version string (`"eng"`, `"lxx"`, `"mt"`, or `"bhs"`).
|
|
8
|
+
- **Smart Conversion**: Automatically converts chapter/verse references between versifications when versification data exists (e.g., Psalms, Zechariah).
|
|
9
|
+
- **Fallback Behavior**: Returns same reference with updated version metadata if no versification exists (e.g., NT passages).
|
|
10
|
+
- **Tested**: Verified with Psalms, Zechariah, and NT passages.
|
|
11
|
+
|
|
12
|
+
## Usage Example
|
|
13
|
+
|
|
14
|
+
```javascript
|
|
15
|
+
const CodexParser = require("codexparser")
|
|
16
|
+
const parser = new CodexParser()
|
|
17
|
+
|
|
18
|
+
// Convert English reference to LXX
|
|
19
|
+
const [p] = parser.parse("Psalm 4:5").getPassages()
|
|
20
|
+
console.log(p.scripture.hash) // "Ps.4.5"
|
|
21
|
+
|
|
22
|
+
const lxx = p.convertVersion("lxx")
|
|
23
|
+
console.log(lxx.scripture.hash) // "Ps.4.6"
|
|
24
|
+
|
|
25
|
+
// No versification (NT) - returns same reference
|
|
26
|
+
const [j] = parser.parse("John 3:16").getPassages()
|
|
27
|
+
const jLxx = j.convertVersion("lxx")
|
|
28
|
+
console.log(jLxx.scripture.hash) // "John.3.16" (same)
|
|
29
|
+
console.log(jLxx.version.abbreviation) // "lxx" (version updated)
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
See full CHANGELOG: https://github.com/jeremyam/CodexParser/blob/main/CHANGELOG.md
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codexparser",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
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": {
|
|
@@ -346,8 +346,8 @@ class ReferenceParser {
|
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
348
|
|
|
349
|
-
// Handle chapter-only references
|
|
350
|
-
if (!part.includes(":") && !part.includes("-") && !singleChapterBook) {
|
|
349
|
+
// Handle chapter-only references (only when no chapter has been established yet)
|
|
350
|
+
if (!part.includes(":") && !part.includes("-") && !singleChapterBook && !passage.chapter) {
|
|
351
351
|
this.#parseChapterOnly(passage, part)
|
|
352
352
|
} else if (part.includes(":")) {
|
|
353
353
|
this.#parseChapterVerse(passage, part, isFirstPart)
|