Skip to content

Commit

Permalink
explain 'i'
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxIsJoe committed May 3, 2024
1 parent c02040d commit a6c8bbf
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,7 @@ export async function BlockBlueVerified(user: BlueBlockerUser, config: Config) {
const disallowedWordsWithoutEmptyStrings = config.disallowedWords.filter(word => word !== '');
if (disallowedWordsWithoutEmptyStrings.length > 0){
// this makes extra sure that emojis are always detected, regardless if they are attached to a word or another string of emojis.
// the 'i' makes the test case insensitive, which helps users not have to worry about typing the same word multiple times with different variations.
const disallowedWordsAndEmojis = new RegExp(config.disallowedWords.join('|'), 'i');
const wordsInUserName = user.legacy.name.toLocaleLowerCase().split(/\s+/);
for (const word of wordsInUserName) {
Expand Down

0 comments on commit a6c8bbf

Please sign in to comment.