platform-bible-utils
    Preparing search index...

    Function offsetBook

    • Adjusts the book of a Scripture reference by a specified offset.

      Parameters

      • scrRef: SerializedVerseRef

        The Scripture reference whose book is to be adjusted.

      • offset: number

        The number of books to offset the current book by. Positive values move forward, negative values move backward.

      Returns SerializedVerseRef

      A new Scripture reference with the adjusted book. The chapter and verse numbers are reset to 1. If the resulting book number exceeds the bounds of available books, it is clamped to the nearest valid book.