diff --git a/README.md b/README.md index b94231f..4f39220 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,24 @@ - Easy - Typescript 4.9.5 -### Scripts +### Functions -#### `todo` +## `hasBannedWords(text: string): boolean` +checks if a word or a long text contains banned words. +```ts +hasBannedWords("Badword"); +// Output: true +hasBannedWords("Hello world!"); +// Output: false + +``` +## `redactBannedWords(text: string, censor: string = "******"): string` +```ts +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! + +```