censorify-thejazz 18.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,8 @@
1
+ # Censorify Module
2
+
3
+ This module removes bad words from text.
4
+
5
+ Functions:
6
+ - censor()
7
+ - addCensoredWord()
8
+ - getCensoredWords()"# censorify" "# censorify"
package/app.js ADDED
File without changes
package/censorify.js ADDED
@@ -0,0 +1,26 @@
1
+ var censoredWords = ["sad", "bad", "mad"];
2
+ var customCensoredWords = [];
3
+
4
+ function censor(inStr) {
5
+ for (idx in censoredWords) {
6
+ inStr = inStr.replace(censoredWords[idx], "****");
7
+ }
8
+
9
+ for (idx in customCensoredWords) {
10
+ inStr = inStr.replace(customCensoredWords[idx], "****");
11
+ }
12
+
13
+ return inStr;
14
+ }
15
+
16
+ function addCensoredWord(word) {
17
+ customCensoredWords.push(word);
18
+ }
19
+
20
+ function getCensoredWords() {
21
+ return censoredWords.concat(customCensoredWords);
22
+ }
23
+
24
+ exports.censor = censor;
25
+ exports.addCensoredWord = addCensoredWord;
26
+ exports.getCensoredWords = getCensoredWords;
package/package.json ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "author": "Brendan Dayley",
3
+ "name": "censorify-thejazz",
4
+ "version": "18.1.2",
5
+ "description": "Censors words out of text",
6
+ "main": "censortext.js",
7
+ "dependencies": {
8
+ "censorify-thejazz": "^18.1.2"
9
+ },
10
+ "engines": {
11
+ "node": "*"
12
+ }
13
+ }