Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filter.addWords() doesn't work with array #152

Open
ihorbychkov opened this issue Jul 26, 2022 · 2 comments
Open

filter.addWords() doesn't work with array #152

ihorbychkov opened this issue Jul 26, 2022 · 2 comments

Comments

@ihorbychkov
Copy link

Hi everyone,
I've tried to add some words to the blacklist. I have an array containing bad words called BAD_WORDS. When I try to add it to the filter
const filter = new Filter(); filter.addWords(BAD_WORDS)
I receive an error
err

The only way to make it works is to map an array and add words one by one

err1

Am I doing something wrong?

@yoonheyjung
Copy link

yoonheyjung commented Jul 28, 2022

BAD_WORDS is not a string type. Try "BAD_WORDS" !
addWords(only String type)

@sbamniya
Copy link

You need to use it like this

const filter = new Filter();
filter.addWords(...BAD_WORDS)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants