no-profanity
Advanced tools
Comparing version 1.1.4 to 1.1.5
@@ -1,5 +0,11 @@ | ||
import { ProfanityEngine } from "@coffeeandfun/google-profanity-words"; | ||
let profanity = new ProfanityEngine(); | ||
const baseList = profanity.all(); | ||
import { readFileSync } from "fs"; | ||
import { fileURLToPath } from "url"; | ||
import path from "path"; | ||
const currentFilePath = fileURLToPath(import.meta.url); | ||
const dataPath = path.join(path.dirname(currentFilePath), "en.txt"); | ||
const data = readFileSync(dataPath, "utf8"); | ||
const baseList = data.split("\n"); | ||
/** | ||
@@ -6,0 +12,0 @@ * Checks if the given test string contains any profanities based on the provided arguments. |
{ | ||
"name": "no-profanity", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"description": "A JavaScript package to detect and filter profanity", | ||
@@ -37,6 +37,3 @@ "main": "./lib/no-profanity.js", | ||
"node": ">=14.0.0" | ||
}, | ||
"dependencies": { | ||
"@coffeeandfun/google-profanity-words": "^1.0.4" | ||
} | ||
} |
@@ -11,2 +11,4 @@ # no-profanity | ||
Thanks to [google-profanity-words](https://github.com/coffee-and-fun/google-profanity-words) for providing the list of profanities. | ||
## Usage | ||
@@ -13,0 +15,0 @@ Using the no-profanity package is very simple. You can use it to detect profanity, or to filter profanity from a string. There are some basic options as well, such as overriding the placeholder character, or adding/removing words from the filterlist. |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
23963
0
7
140
138
1
- Removed@coffeeandfun/google-profanity-words@1.0.4(transitive)