Skip to content

Commit 3e2a3ed

Browse files
committed
prettier formatting the document
1 parent 65e2d5d commit 3e2a3ed

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/anagram-service.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
const fs = require('fs');
2-
1+
const fs = require("fs");
32
/**
4-
* Looks up anagrams of a given word based on the
3+
* Looks up anagrams of a given word based on the
54
* word dictionary provided in the constructor.
65
*/
76
class AnagramService {
8-
97
/**
108
* Creates an AnagramService instance
119
* @param {string} dictionaryFilePath Path to the dictionary file
@@ -26,7 +24,7 @@ class AnagramService {
2624
return reject(err);
2725
}
2826

29-
const lines = data.toString().split('\n');
27+
const lines = data.toString().split("\n");
3028

3129
lines.forEach((line) => {
3230
this.wordsMap.set(line.toLowerCase(), [line]);
@@ -38,12 +36,12 @@ class AnagramService {
3836

3937
/**
4038
* Returns all anagrams for the given term
41-
* @param {string} term The term to find anagrams for
39+
* @param {string} term The term to find anagrams for
4240
* @returns A string[] of anagram matches
4341
*/
4442
async getAnagrams(term) {
4543
if (!this.wordsMap || this.wordsMap.size === 0) {
46-
throw Error('Error: Dictionary not initialized');
44+
throw Error("Error: Dictionary not initialized");
4745
}
4846

4947
// TODO: The anagram lookup 🤦‍♂️

0 commit comments

Comments
 (0)