New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

profanity-util

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

profanity-util - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

32

lib/profanity.js

@@ -79,3 +79,3 @@ /*

var matches = [],
fields = options.fields || null,
fields = options.fields || Object.keys(target),
result;

@@ -88,11 +88,25 @@

} else if (typeof target === 'object') {
util.eachRecursive(target, function (val, key, root) {
if (fields && fields.indexOf(key) === -1) {
return;
}
fields.forEach(function (field) {
if (typeof val === 'string') {
result = purifyString(val, options);
root[key] = result[0];
// TODO: Use better recursive checking, make DRYer
if (typeof target[field] === 'string') {
result = purifyString(target[field], options);
target[field] = result[0];
matches = matches.concat(result[1]);
} else if (typeof target[field] === 'object') {
util.eachRecursive(target[field], function (val, key, root) {
if (fields && fields.indexOf(key) === -1) {
return;
}
if (typeof val === 'string') {
result = purifyString(val, options);
root[key] = result[0];
matches = matches.concat(result[1]);
}
});
}

@@ -108,2 +122,2 @@ });

purify: purify
};
};
{
"name": "profanity-util",
"version": "0.0.2",
"version": "0.0.3",
"description": "Utility for detection, filtering and replacement / obscuration of forbidden words",

@@ -5,0 +5,0 @@ "main": "lib/profanity.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