1.2.3 • Published 2 years ago

banned-words-spotter v1.2.3

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

🧰 Simple banned-words-detector 1.2.3

GITHUB REPOSITORY

Features

  • 70+ dirty words! List based on encycloDB's dirty words
  • Easy to use
  • Typescript 4.9.5
  • Detects variants (example: "baaaaadword", "badwoooooooord")

Functions

hasBannedWords(text: string): boolean

checks if a word or a long text contains banned words.

hasBannedWords("Badword");
// Output: true

hasBannedWords("Baaaaadword");
// Output: true

hasBannedWords("This is a badword!");
// Output: true

hasBannedWords("Hello world!");
// Output: false

redactBannedWords(text: string, censor: string = "******"): string

console.log(redactBannedWords("Leave this badword outta my badwording face!"));
// Output: Leave this ***** outta my ***** face!

console.log(redactBannedWords("Leave this badword outta my badwording face!", "[REDACTED]"));
// Output: Leave this [REDACTED] outta my [REDACTED] face!
1.2.3

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago