File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ export function condense(wordList: string[]): RegExp {
88}
99
1010export 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}
Original file line number Diff line number Diff 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 ) ;
You can’t perform that action at this time.
0 commit comments