Skip to content

Commit

Permalink
Refactor variable name for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
rg-wood committed Apr 6, 2024
1 parent 5792883 commit 8bd2870
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ class StandardDie extends Die {

const diceNotation: RegExp = /^(\d*)d(\d+)(\s*(\+|-)\s*(\d+))?$/g

const [, number = '1', dice = '1', , plusMinus = '+', modifier = '0'] =
const [, number = '1', sides = '1', , plusMinus = '+', modifier = '0'] =
diceNotation.exec(notation)!.map(EMPTY_STR_TO_UNDEFINED)

this.number = parseInt(number)
this.sides = parseInt(dice)
this.sides = parseInt(sides)
this.modifier = parseInt(plusMinus + modifier)
}

Expand Down

0 comments on commit 8bd2870

Please sign in to comment.