Formatting
This commit is contained in:
@@ -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})
|
||||
areWords = (words: string[]): { [key: string]: boolean } =>
|
||||
words.reduce(
|
||||
(acc, word) => {
|
||||
acc[word] = this.isWord(word);
|
||||
return acc;
|
||||
},
|
||||
{} as { [key: string]: boolean },
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user