censor-sensor
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -154,2 +154,4 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
_isProfane(word, dict) { | ||
if (this.blackList[word]) | ||
return false; | ||
const wordTier = dict[word]; | ||
@@ -171,2 +173,4 @@ if (!wordTier) | ||
return; | ||
if (this.blackList[dictWord]) | ||
return; | ||
const tier = dict[dictWord]; | ||
@@ -185,2 +189,4 @@ if (phrase.indexOf(dictWord) !== -1 && this.enabledTiers[tier]) | ||
Object.keys(dict).forEach(dictWord => { | ||
if (this.blackList[dictWord]) | ||
return; | ||
const tier = dict[dictWord]; | ||
@@ -187,0 +193,0 @@ if (phrase.indexOf(dictWord) !== -1 && this.enabledTiers[tier]) |
@@ -0,0 +0,0 @@ declare module "*.json" { |
@@ -0,0 +0,0 @@ { |
@@ -0,0 +0,0 @@ |
{ | ||
"name": "censor-sensor", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "a better profanity filter", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
@@ -73,2 +73,7 @@ # Censor Sensor | ||
censor.isProfane('uwotm8') // false | ||
// remove an existing word from an existing tier | ||
censor.isProfane('hell') // true | ||
censor.removeWord('hell') | ||
censor.isProfane('hell') // false | ||
``` | ||
@@ -75,0 +80,0 @@ |
@@ -76,2 +76,4 @@ import { AllLocales } from '../locales'; | ||
private _isProfane(word: string, dict: { [word: string]: CensorTier }): boolean { | ||
if(this.blackList[word]) return false; | ||
const wordTier = dict[word]; | ||
@@ -96,2 +98,3 @@ | ||
if(isAnyMatch) return; | ||
if(this.blackList[dictWord]) return; | ||
@@ -116,2 +119,4 @@ const tier = dict[dictWord]; | ||
Object.keys(dict).forEach(dictWord => { | ||
if(this.blackList[dictWord]) return; | ||
const tier = dict[dictWord]; | ||
@@ -118,0 +123,0 @@ |
export * from './CensorSensor'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
39874
606
93