Skip to content

Commit

Permalink
update option
Browse files Browse the repository at this point in the history
  • Loading branch information
jkRaccoon committed Jan 20, 2017
1 parent 29015c0 commit 6aedae2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/badwords.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var Filter = (function() {
this.list = options.emptyList && [] || Array.prototype.concat.apply(require('./lang.json').words, [require('badwords-list').array, options.list || []]);
this.placeHolder = options.placeHolder || '*';
this.regex = options.regex || /[^a-zA-z0-9|\$|\@]|\^/g;
this.replaceregex = options.replaceregex || /\w/g;
this.replaceRegex = options.replaceRegex || /\w/g;
}

Filter.prototype.isProfane = function isProfane(string) {
Expand All @@ -19,7 +19,7 @@ var Filter = (function() {
};

Filter.prototype.replaceWord = function replaceWord(string) {
return string.replace(this.regex, '').replace(this.replaceregex, this.placeHolder);
return string.replace(this.regex, '').replace(this.replaceRegex, this.placeHolder);
};

Filter.prototype.clean = function clean(string) {
Expand Down

0 comments on commit 6aedae2

Please sign in to comment.