From 9b8c4520644ac2664232f2bbd9b8f9ce16d1286c Mon Sep 17 00:00:00 2001 From: Miodec Date: Wed, 8 Nov 2023 14:37:48 +0000 Subject: [PATCH] impr: remove words which might trigger false positives for profanity --- backend/src/constants/profanities.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/src/constants/profanities.ts b/backend/src/constants/profanities.ts index 9971dafbb..aeeaa8a2a 100644 --- a/backend/src/constants/profanities.ts +++ b/backend/src/constants/profanities.ts @@ -171,7 +171,6 @@ export const profanities = [ "sadist", "scank", "schlong", - "screwing", "semen", "sex", "sexy", @@ -378,7 +377,6 @@ export const profanities = [ "scheiss", "schlampe", "schmuck", - "screw", "sh!t", "sharmuta", "sharmute", @@ -406,3 +404,7 @@ export const regexProfanities = profanities.map((profanity) => { const normalizedProfanity = _.escapeRegExp(profanity.toLowerCase()); return `${normalizedProfanity}.*`; }); + +export function findProfanities(string: string): string[] { + return profanities.filter((profanity) => string.includes(profanity)) || []; +}