Skip to content

Commit

Permalink
refactor(badwords): remove inline require in filter constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
web-mech committed Oct 16, 2017
1 parent 7c8d0e2 commit 310d245
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/badwords.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
var localList = require('./lang.json').words;
var baseList = require('badwords-list').array;
var Filter = (function() {
function Filter(options) {
options = options || {};
this.list = options.emptyList && [] || Array.prototype.concat.apply(require('./lang.json').words, [require('badwords-list').array, options.list || []]);
this.list = options.emptyList && [] || Array.prototype.concat.apply(localList, [baseList, options.list || []]);
this.exclude = options.exclude || [];
this.placeHolder = options.placeHolder || '*';
this.regex = options.regex || /[^a-zA-z0-9|\$|\@]|\^/g;
Expand Down

0 comments on commit 310d245

Please sign in to comment.