Skip to content

Commit ee340f4

Browse files
committed
impr(type): more accurate type on a function parameter
!nuf
1 parent 323185d commit ee340f4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

frontend/src/ts/test/words-generator.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ export async function getNextWord(
693693
wordIndex: number,
694694
wordsBound: number,
695695
previousWord: string,
696-
previousWord2: string
696+
previousWord2: string | undefined
697697
): Promise<GetNextWordReturn> {
698698
console.debug("Getting next word", {
699699
isRepeated: TestState.isRepeated,
@@ -750,7 +750,7 @@ export async function getNextWord(
750750
let randomWord = currentWordset.randomWord(funboxFrequency);
751751
const previousWordRaw = previousWord.replace(/[.?!":\-,]/g, "").toLowerCase();
752752
const previousWord2Raw = previousWord2
753-
.replace(/[.?!":\-,']/g, "")
753+
?.replace(/[.?!":\-,']/g, "")
754754
.toLowerCase();
755755

756756
if (currentSection.length === 0) {

0 commit comments

Comments
 (0)