File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -51,13 +51,14 @@ export default class Sqids {
51
51
// 2. no words less than 3 chars
52
52
// 3. if some words contain chars that are not in the alphabet, remove those
53
53
const filteredBlocklist = new Set < string > ( ) ;
54
- const alphabetChars = alphabet . split ( '' ) ;
54
+ const alphabetChars = alphabet . toLowerCase ( ) . split ( '' ) ;
55
55
for ( const word of blocklist ) {
56
56
if ( word . length >= 3 ) {
57
- const wordChars = word . split ( '' ) ;
57
+ const wordLowercased = word . toLowerCase ( ) ;
58
+ const wordChars = wordLowercased . split ( '' ) ;
58
59
const intersection = wordChars . filter ( ( c ) => alphabetChars . includes ( c ) ) ;
59
60
if ( intersection . length == wordChars . length ) {
60
- filteredBlocklist . add ( word . toLowerCase ( ) ) ;
61
+ filteredBlocklist . add ( wordLowercased ) ;
61
62
}
62
63
}
63
64
}
You can’t perform that action at this time.
0 commit comments