Download node_modules/bad-words/test/options.js from Thrisha04/Chat: direct link, hf CLI and curl.
- Browser
- Download file 697 Bytes
-
https://huggingface.co/Thrisha04/Chat/resolve/main/node_modules/bad-words/test/options.js
- Command line
-
hf download hf://Thrisha04/Chat/node_modules/bad-words/test/options.js
-
curl -L -o options.js https://huggingface.co/Thrisha04/Chat/resolve/main/node_modules/bad-words/test/options.js
697 Bytes
| require('assert'); | |
| var Filter = require('../lib/badwords.js'), | |
| assert = require('better-assert'); | |
| describe('options', function() { | |
| describe('split regex', function() { | |
| it('default value', function() { | |
| filter = new Filter(); | |
| filter.addWords('français'); | |
| assert(filter.clean('fucking asshole') == '******* *******'); | |
| assert(filter.clean('mot en français') == 'mot en français'); | |
| }); | |
| it('override value', function() { | |
| filter = new Filter({splitRegex: / /}); | |
| filter.addWords('français'); | |
| assert(filter.clean('fucking asshole') == '******* *******'); | |
| assert(filter.clean('mot en français') == 'mot en *******'); | |
| }); | |
| }); | |
| }); | |