diff --git a/src/artigen/mathTokenizer.ts b/src/artigen/mathTokenizer.ts index b494b31..cb38c55 100644 --- a/src/artigen/mathTokenizer.ts +++ b/src/artigen/mathTokenizer.ts @@ -19,7 +19,7 @@ export const tokenizeMath = (cmd: string, modifiers: RollModifiers): [ReturnData loggingEnabled && log(LT.LOG, `Parsing roll ${cmd}`); // Remove all spaces from the operation config and split it by any operator (keeping the operator in mathConf for fullSolver to do math on) - const mathConf: MathConf[] = cmd + const mathConf: MathConf[] = cmd .replace(cmdSplitRegex, '') .replace(internalWrapRegex, '') .replace(/ /g, '') diff --git a/src/artigen/parser.ts b/src/artigen/parser.ts index 29ebdb1..1fe1d62 100644 --- a/src/artigen/parser.ts +++ b/src/artigen/parser.ts @@ -14,7 +14,7 @@ import { assertPrePostBalance } from 'src/artigen/utils/parenBalance.ts'; // parseRoll(fullCmd, modifiers) // parseRoll handles converting fullCmd into a computer readable format for processing, and finally executes the solving export const parseRoll = (fullCmd: string, modifiers: RollModifiers): SolvedRoll => { - const returnMsg = { + const returnMsg: SolvedRoll = { error: false, errorCode: '', errorMsg: '', diff --git a/src/artigen/roller.ts b/src/artigen/roller.ts index 2716dc2..51433a5 100644 --- a/src/artigen/roller.ts +++ b/src/artigen/roller.ts @@ -69,22 +69,22 @@ export const roll = (rollStr: string, modifiers: RollModifiers): RollSet[] => { reroll: { on: false, once: false, - nums: [], + nums: [], }, critScore: { on: false, - range: [], + range: [], }, critFail: { on: false, - range: [], + range: [], }, exploding: { on: false, once: false, compounding: false, penetrating: false, - nums: [], + nums: [], }, }; diff --git a/src/artigen/solver.ts b/src/artigen/solver.ts index be44043..1e70af4 100644 --- a/src/artigen/solver.ts +++ b/src/artigen/solver.ts @@ -16,7 +16,7 @@ import { getMatchingParenIdx } from 'artigen/utils/parenBalance.ts'; export const fullSolver = (conf: MathConf[], wrapDetails = false): SolvedStep => { // Initialize PEMDAS const signs = ['^', '*', '/', '%', '+', '-']; - const stepSolve = { + const stepSolve: SolvedStep = { total: 0, details: '', containsCrit: false, @@ -166,10 +166,11 @@ export const fullSolver = (conf: MathConf[], wrapDetails = false): SolvedStep => stepSolve.details = conf[0].toString(); } else { // Else fully populate the stepSolve with what was computed - stepSolve.total = ( conf[0]).total; - stepSolve.details = ( conf[0]).details; - stepSolve.containsCrit = ( conf[0]).containsCrit; - stepSolve.containsFail = ( conf[0]).containsFail; + const tempConf = conf[0]; + stepSolve.total = tempConf.total; + stepSolve.details = tempConf.details; + stepSolve.containsCrit = tempConf.containsCrit; + stepSolve.containsFail = tempConf.containsFail; } // If this was a nested call, add on parens around the details to show what math we've done diff --git a/src/mod.d.ts b/src/mod.d.ts index 2de5c31..9dd04bf 100644 --- a/src/mod.d.ts +++ b/src/mod.d.ts @@ -1,7 +1,7 @@ // EmojiConf is used as a structure for the emojis stored in config.ts export type EmojiConf = { name: string; - aliases: Array; + aliases: string[]; id: string; animated: boolean; deleteSender: boolean;