Skip to content

Commit

Permalink
Merge pull request #11 from Colack/main
Browse files Browse the repository at this point in the history
Add Censoring Script
  • Loading branch information
Colack authored Nov 30, 2024
2 parents 0906e08 + 211a913 commit 4aa2ae7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions util/censored.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const words = require('profane-words');

const censored = (text) => {
let censoredText = text;
words.forEach((word) => {
censoredText = censoredText.replace(word, '****');
});
return censoredText;
}

module.exports = censored;

0 comments on commit 4aa2ae7

Please sign in to comment.