文件名称:SpeakNoEvil:根据短语黑名单检查字符串的 npm 包
文件大小:12KB
文件格式:ZIP
更新时间:2024-07-07 01:37:51
JavaScript
方法: 在字符串中搜索黑名单中每个单词/短语的子字符串匹配 用法: # create a filter with the default list Filter = new SpeakNoEvil () # create a filter with a custom list Filter = new SpeakNoEvil ([ " a " , " b " , " c " ]) # check a string for profanity result = Filter . check ( " a possibly profane string " ) if result console . log " string was profane " 运行测试 npm install -g grunt mocha npm test
【文件预览】:
SpeakNoEvil-master
----gruntfile.coffee(1KB)
----speak-no-evil.sublime-project(70B)
----src()
--------SpeakNoEvil.coffee(6KB)
----lib()
--------SpeakNoEvil.js(6KB)
----test()
--------test.coffee(5KB)
----README.md(624B)
----speak-no-evil.sublime-workspace(14KB)
----.gitignore(535B)
----package.json(866B)