Open SeanLangre opened 1 year ago
Code:
var Filter = require("bad-words"); var badWordFilter = new Filter();
var badwordtest = "мило" var teststring = badWordFilter.clean(badwordtest);
Error: Uncaught TypeError TypeError: Cannot read properties of null (reading '0') at clean (..node_modules\bad-words\lib\badwords.js:58:41)
Need to modify splitRegex prop. By default /\b/ defined as splitter. To support russian language need to set "/\b/gu". But it still not working with a single world, like "Привет"
splitRegex
Code:
var Filter = require("bad-words"); var badWordFilter = new Filter();
var badwordtest = "мило" var teststring = badWordFilter.clean(badwordtest);
Error: Uncaught TypeError TypeError: Cannot read properties of null (reading '0') at clean (..node_modules\bad-words\lib\badwords.js:58:41)