Socket
Socket
Sign inDemoInstall

sanitized

Package Overview
Dependencies
107
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.9 to 1.2.0

14

index.js

@@ -6,3 +6,5 @@ let dompurify = require("dompurify");

const jsdom = require("jsdom");
const jsdomWindow = new jsdom.JSDOM("").window;
dompurify = dompurify(jsdomWindow);

@@ -14,10 +16,12 @@ }

if (typeof clone === "string") {
clone = he.decode(dompurify.sanitize(dirty, dompurifyOption));
} else if (clone instanceof Array) {
for (let i = 0; i < clone.length; i++)
if (clone instanceof Array) {
for (let i = 0; i < clone.length; i++) {
clone[i] = sanitized(clone[i], dompurifyOption);
}
} else if (clone instanceof Object) {
for (let key of Object.keys(clone))
for (let key of Object.keys(clone)) {
clone[key] = sanitized(clone[key], dompurifyOption);
}
} else if (typeof clone === "string") {
clone = he.decode(dompurify.sanitize(dirty, dompurifyOption));
}

@@ -24,0 +28,0 @@

{
"name": "sanitized",
"version": "1.1.9",
"version": "1.2.0",
"description": "Recursive function that'll sanitize a string or ALL strings in a json input.",

@@ -25,6 +25,6 @@ "main": "index.js",

"dependencies": {
"dompurify": "^3.0.3",
"dompurify": "^3.0.6",
"he": "^1.2.0",
"jsdom": "^22.0.0"
"jsdom": "^23.0.1"
}
}
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