Skip to content

Commit e5bf0d4

Browse files
Reformat with Prettier
Apply new style from Prettier v2.
1 parent ffa2080 commit e5bf0d4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export function condense(wordList: string[]): RegExp {
88
}
99

1010
export function condenseIgnoreCase(wordList: string[]): RegExp {
11-
const wordListLowercase = wordList.map(word => word.toLowerCase());
11+
const wordListLowercase = wordList.map((word) => word.toLowerCase());
1212
const caseSensitiveRegex = condense(wordListLowercase);
1313
return new RegExp(caseSensitiveRegex, 'i');
1414
}

src/utils/trie.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function groupWordsByHeadChar(
99
const matched: string[] = [];
1010
const missed: string[] = [];
1111

12-
words.forEach(word => {
12+
words.forEach((word) => {
1313
if (word[0] === firstChar) {
1414
matched.push(word);
1515
} else {
@@ -62,15 +62,15 @@ function buildUnique(words: string[]): CharTrie {
6262
if (wordToMatch === '') {
6363
// End of the target word reached. Include an empty string to signify that
6464
// a word ends at this spot, and group any remaining words in the trie.
65-
const nonEmptyWords = words.filter(word => word !== '');
65+
const nonEmptyWords = words.filter((word) => word !== '');
6666
return new Map([['', leafNode], ...build(nonEmptyWords)]) as CharTrie;
6767
}
6868

6969
// Begin a new trie containing all words starting with the same letter as wordToMatch
7070
const charToMatch = wordToMatch[0];
7171
const [wordsMatched, wordsMissed] = groupWordsByHeadChar(words, charToMatch);
7272

73-
const tailsMatched = wordsMatched.map(word => word.substring(1));
73+
const tailsMatched = wordsMatched.map((word) => word.substring(1));
7474
const tailsMatchedGrouped = build(tailsMatched);
7575

7676
const groupWithChildren = mergeGroups(charToMatch, tailsMatchedGrouped);

0 commit comments

Comments
 (0)