Formatting

This commit is contained in:
2023-11-20 17:27:30 -07:00
parent d862ed7539
commit 62336a2034

View File

@@ -6,15 +6,17 @@ export class IswordService {
private readonly dict: string = '/usr/share/dict/words';
private readonly dictContents: string[];
constructor() {
this.dictContents = readFileSync(this.dict).toString().split('\n')
this.dictContents = readFileSync(this.dict).toString().split('\n');
}
isWord = (word: string) =>
this.dictContents.includes(word)
isWord = (word: string) => this.dictContents.includes(word);
areWords = (words: string[]): { [key: string]: boolean } =>
words.reduce((acc, word) => {
acc[word] = this.isWord(word)
return acc
}, {} as {[key: string]: boolean})
words.reduce(
(acc, word) => {
acc[word] = this.isWord(word);
return acc;
},
{} as { [key: string]: boolean },
);
}