Skip to content

Improvement in updateProfanityJson function #5

Description

@Yatanvesh

I've been using this library in my project and at every start of the application I add some 50 words to be blacklisted, and I noticed that the library will write to the profanity_words json 50 times, that's a lot of time to wait for 50 promises to be fulfilled, sequentially.

I have a suggestion, instead of writing to profanity_words.json every time there is a change, we should keep the user blacklisted/ whitelisted words in memory, which I see is already happening with profanityJson variable. The reason for this is that the users will anyhow have to make the blacklist/whitelist calls at application startup and writing to profanity_words.json is a redundant and expensive operation.

So, my suggestion is to either remove the updateProfanityJson function calls entirely, or have the option for user to configure this behavior. I'm willing to make the changes as well as test them.

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions