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.3 to 1.0.4

8

package.json
{
"name": "censor-sensor",
"version": "1.0.3",
"version": "1.0.4",
"description": "a better profanity filter",

@@ -35,7 +35,3 @@ "main": "./dist/index.js",

},
"dependencies": {
"lodash.includes": "^4.3.0",
"lodash.merge": "^4.6.1",
"lodash.some": "^4.6.0"
}
"dependencies": {}
}

@@ -0,0 +0,0 @@ # Censor Sensor

@@ -1,8 +0,3 @@

import { AllLocales } from '../locales';
import * as merge from 'lodash.merge';
import * as includes from 'lodash.includes';
import * as some from 'lodash.some';
export type CensorLocale = 'en';

@@ -38,3 +33,3 @@

private get currentDictionary(): { [word: string]: CensorTier } {
return merge({}, AllLocales[this.locale], this.customDictionary);
return Object.assign({}, AllLocales[this.locale], this.customDictionary);
}

@@ -93,3 +88,3 @@

return some(this.prepareForParsing(phrase).split(' '), word => this._isProfane(word, dict));
return this.prepareForParsing(phrase).split(' ').some(word => this._isProfane(word, dict));
}

@@ -105,3 +100,3 @@

if(includes(phrase, dictWord) && this.enabledTiers[tier]) isAnyMatch = true;
if (phrase.indexOf(dictWord) !== -1 && this.enabledTiers[tier]) isAnyMatch = true;
});

@@ -124,3 +119,3 @@

if(includes(phrase, dictWord) && this.enabledTiers[tier]) foundProfanity.push(dictWord);
if(phrase.indexOf(dictWord) !== -1 && this.enabledTiers[tier]) foundProfanity.push(dictWord);
});

@@ -127,0 +122,0 @@

Sorry, the diff of this file is too big to display

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