Remove whitespace characters in banned words detection

This commit is contained in:
Madeline
2022-10-25 11:20:01 +11:00
parent f3a5fa07f7
commit 252bc880e8
+2
View File
@@ -1,5 +1,6 @@
import fs from "fs/promises";
import path from "path";
import { InvisibleCharacters } from "./InvisibleCharacters";
var words: string[];
@@ -20,6 +21,7 @@ export const BannedWords = {
get: () => words,
find: (val: string) => {
InvisibleCharacters.forEach(x => val = val.replaceAll(x, ""));
return words.some((x) => val.indexOf(x) != -1);
},
};