Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

no-swears

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

no-swears - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

18

index.js

@@ -20,6 +20,3 @@ /**

var finalString = words
fs.readFile(path.join(__dirname,'swearwords.txt'), 'utf8', (err, data) => {
if (err) throw err
// Trim down file input to remove weird encoding/returns
var lines = data.replace(new RegExp('\r','g'),'').split('\n')
swearList(lines => {
for (var i = 0; i < lines.length; i++) {

@@ -36,7 +33,4 @@ var bw = new RegExp(lines[i], 'gi')

hasSwears: (words, callback) => {
fs.readFile(path.join(__dirname,'swearwords.txt'), 'utf8', (err, data) => {
if (err) throw err
swearList(lines =>{
var b = false
// Trim down file input to remove weird encoding/returns
var lines = data.replace(new RegExp('\r','g'),'').split('\n')
for (var i = 0; i < lines.length; i++) {

@@ -50,2 +44,10 @@ if(words.indexOf(lines[i]) > -1) {

}
}
var swearList = callback => {
fs.readFile(path.join(__dirname,'swearwords.txt'), 'utf8', (err, data) => {
if (err) throw err
data = data.replace(new RegExp('\r','g'),'').split('\n')
callback(data)
});
}
{
"name": "no-swears",
"version": "1.1.0",
"version": "1.1.1",
"description": "Filter swearwords out of your strings automagically",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc