diff options
Diffstat (limited to 'src/modules/word')
| -rw-r--r-- | src/modules/word/filter-word-list-by-length.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/modules/word/filter-word-list-by-length.ts b/src/modules/word/filter-word-list-by-length.ts index 106e9858..60c6fae9 100644 --- a/src/modules/word/filter-word-list-by-length.ts +++ b/src/modules/word/filter-word-list-by-length.ts @@ -13,12 +13,12 @@ const STRATEGIES = { wordList: ReadonlyArray<string>, length: { min: number; max: number } ): string[] => { - const wordsByLength = wordList.reduce( + const wordsByLength = wordList.reduce<Record<number, string[]>>( (data, word) => { (data[word.length] = data[word.length] ?? []).push(word); return data; }, - {} as Record<number, string[]> + {} ); const lengths = Object.keys(wordsByLength).map(Number); |
