Socket
Socket
Sign inDemoInstall

censor-sensor

Package Overview
Dependencies
0
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.5 to 1.0.6

6

dist/index.js

@@ -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

json.d.ts

@@ -0,0 +0,0 @@ declare module "*.json" {

@@ -0,0 +0,0 @@ {

@@ -0,0 +0,0 @@

2

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc