Skip to content

Commit

Permalink
Merge pull request #10 from BibleBytes/breakdown
Browse files Browse the repository at this point in the history
Adds Breakdown + Is Followed By Verse
  • Loading branch information
SellersEvan authored Nov 1, 2024
2 parents 03403ce + 6eeebe0 commit 43ccaae
Show file tree
Hide file tree
Showing 7 changed files with 1,286 additions and 490 deletions.
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
41 changes: 14 additions & 27 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,47 +6,28 @@ on:

jobs:


unit-test:
strategy:
matrix:
node-version: [20.x, 22.x]

name: Unit Tests (NodeJS ${{ matrix.node-version }})
runs-on: ubuntu-latest
name: Unit Tests
runs-on: "ubuntu-latest"

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Node.js ${{ matrix.node-version }}
- name: Install Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
node-version: 22

- name: Install dependencies
run: npm install

- name: Run Unit Tests
run: npm run test


formating:
name: Formating
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Biome
uses: biomejs/setup-biome@v2
with:
version: latest
- name: Run Biome
run: biome ci .


linting:
name: Linting
name: Linting & Formatting
runs-on: ubuntu-latest

steps:
Expand All @@ -55,12 +36,18 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22

- name: Install dependencies
run: npm install

- name: Run linting
run: npm run lint
- name: Setup Biome
uses: biomejs/setup-biome@v2
with:
version: latest

- name: Biome Linting
run: biome ci .

- name: TypeScript Linting
run: tsc --noEmit
54 changes: 53 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Reference ID strings can use a mix of delimiter between sections
and `EXO-2:5-10` are all treated the same.

```typescript
import { Reference, Language } from 'bible-reference-index';
import { Reference, Language } from '@biblebytes/bible-reference';

// Creating a new reference
const ref1 = new Reference(Language.English);
Expand Down Expand Up @@ -188,6 +188,58 @@ ref.Set("REV:21:3-4");
```


<br/>

#### IsFollowedBy
Checks if the current verse is followed by the specified verse (nextVerse),
within the same chapter. <i>Note: does not utilize chapter end or verse end;
thus `GEN 1:1-5` is followed by `GEN 1:2`.</i>

```typescript
public IsFollowedBy(nextVerse: Reference): boolean
```

- **reference**: The verse to check if it comes after the current verse.
- **Returns**: Returns `true` if the current verse is followed by `nextVerse`;
otherwise, it returns `false`.

```ts
const ref1 = new Reference(Language.English, "GEN 1:1");
const ref2 = new Reference(Language.English, "GEN 1:2");
ref1.IsFollowedBy(ref2); // returns true

const ref3 = new Reference(Language.English, "MAT 5:3");
const ref4 = new Reference(Language.English, "MAT 5:4");
const ref5 = new Reference(Language.English, "MAT 5:5");
ref3.IsFollowedBy(ref4); // returns true
ref3.IsFollowedBy(ref5); // returns false
```


<br/>


#### Unpack
Unpacks a verse range into it's individual verses, returning a list of verses.
For example `GEN:1:1-3` can be unpacked into `GEN:1:1`, `GEN:1:2`, and `GEN:1:3`.
References can range over both chapters and verses.

```typescript
public Unpack(): Reference[]
```

- **Returns**: a list of reference verses

**Examples**:
```typescript
const ref1 = new Reference(Language.English, `GEN:1:1-3`);
ref1.Unpack(); // ["GEN:1:1", "GEN:1:2", "GEN:1:3"]

const ref2 = new Reference(Language.English, `GEN:1:31-2:1`);
ref2.Unpack(); // ["GEN:1:31", "GEN:2:1"]
```


<br/>


Expand Down
Loading

0 comments on commit 43ccaae

Please sign in to comment.