Skip to content

Commit 0831e82

Browse files
authored
Improve VerseRef.internalValid() (#10)
1 parent 18e6d85 commit 0831e82

3 files changed

Lines changed: 22 additions & 4 deletions

File tree

.vscode/settings.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,16 @@
1212
"url": "http://json.schemastore.org/tsconfig"
1313
}
1414
],
15-
"cSpell.words": ["deutero", "otnt", "parseable"]
15+
"cSpell.words": [
16+
"bbbccc",
17+
"bbbcccvvv",
18+
"bbbcccvvvs",
19+
"codecov",
20+
"deutero",
21+
"libpalaso",
22+
"otnt",
23+
"parseable",
24+
"sillsdev",
25+
"vref"
26+
]
1627
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ v1 is a minimal partial port in TypeScript that supports use on the frontend whi
1515

1616
## Features
1717

18-
- {class} Canon - Canon information. Also, contains static information on complete list of books.
18+
- {object} Canon - Canon information. Also, contains static information on complete list of books.
1919
- {class} VerseRef - Stores a reference to a specific verse in Scripture.
2020
- Represents a single reference, e.g. `'GEN 2:3'`.
2121
- Represents a reference range, e.g. `'LUK 3:4-5'`.

src/verse-ref.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,19 @@ export class VerseRef {
140140
return { success: true, vNum };
141141
}
142142

143+
/** Not yet implemented. */
143144
firstChapter?: number;
145+
/** Not yet implemented. */
144146
lastChapter?: number;
147+
/** Not yet implemented. */
145148
lastVerse?: number;
149+
/** Not yet implemented. */
146150
hasSegmentsDefined?: boolean;
151+
/** Not yet implemented. */
147152
text?: string;
153+
/** Not yet implemented. */
148154
BBBCCCVVVS?: string;
155+
/** Not yet implemented. */
149156
longHashCode?: number;
150157
/** The versification of the reference. */
151158
versification?: ScrVers;
@@ -577,13 +584,13 @@ export class VerseRef {
577584
return ValidStatusType.OutOfRange;
578585
}
579586

580-
// TODO: Finish the rest of the port required to uncomment the section below.
581587
// If non-biblical book, any chapter/verse is valid
582-
/*
583588
if (!Canon.isCanonical(this._bookNum)) {
584589
return ValidStatusType.Valid;
585590
}
586591

592+
// TODO: Finish the rest of the port required to uncomment the section below.
593+
/*
587594
if (this._bookNum > this._versification.getLastBook() || this._chapterNum <= 0 ||
588595
this._chapterNum > this._versification.getLastChapter(this._bookNum) || this.verseNum < 0 ||
589596
this.verseNum > this._versification.getLastVerse(this._bookNum, this._chapterNum)

0 commit comments

Comments
 (0)