Skip to content

Commit

Permalink
Improve VerseRef.internalValid() (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
irahopkinson authored Oct 8, 2023
1 parent 18e6d85 commit 0831e82
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
13 changes: 12 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,16 @@
"url": "http://json.schemastore.org/tsconfig"
}
],
"cSpell.words": ["deutero", "otnt", "parseable"]
"cSpell.words": [
"bbbccc",
"bbbcccvvv",
"bbbcccvvvs",
"codecov",
"deutero",
"libpalaso",
"otnt",
"parseable",
"sillsdev",
"vref"
]
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ v1 is a minimal partial port in TypeScript that supports use on the frontend whi

## Features

- {class} Canon - Canon information. Also, contains static information on complete list of books.
- {object} Canon - Canon information. Also, contains static information on complete list of books.
- {class} VerseRef - Stores a reference to a specific verse in Scripture.
- Represents a single reference, e.g. `'GEN 2:3'`.
- Represents a reference range, e.g. `'LUK 3:4-5'`.
Expand Down
11 changes: 9 additions & 2 deletions src/verse-ref.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,19 @@ export class VerseRef {
return { success: true, vNum };
}

/** Not yet implemented. */
firstChapter?: number;
/** Not yet implemented. */
lastChapter?: number;
/** Not yet implemented. */
lastVerse?: number;
/** Not yet implemented. */
hasSegmentsDefined?: boolean;
/** Not yet implemented. */
text?: string;
/** Not yet implemented. */
BBBCCCVVVS?: string;
/** Not yet implemented. */
longHashCode?: number;
/** The versification of the reference. */
versification?: ScrVers;
Expand Down Expand Up @@ -577,13 +584,13 @@ export class VerseRef {
return ValidStatusType.OutOfRange;
}

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

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

0 comments on commit 0831e82

Please sign in to comment.