squibler. - Hi folks. I'm looking to validate a...
Hi folks. I'm looking to validate that a user input is
not in
a blacklist - like for example swear words. Enum does this for allowed strings, but I'm struggling to find something that will work for disallowed strings.
I have tried a regex - but my datasource has over 2000 disallowed words and regex would be too slow.
Basically I'm looking for something like:
Solution:Jump to solution
Using this now:
```ts
import { blacklist } from '~/blacklist';
export const notBlacklisted = (input: string): boolean => {...
2 Replies