express-xss-sanitizer
Advanced tools
Comparing version 1.1.4 to 1.1.5
@@ -5,6 +5,13 @@ "use strict"; | ||
function hasOwn(object, key) { | ||
const keys = Reflect.ownKeys(object).filter( | ||
(item) => typeof item !== "symbol" | ||
); | ||
return keys.includes(key); | ||
} | ||
const initializeOptions = (options) => { | ||
const sanitizerOptions = {}; | ||
if ( | ||
Object.hasOwn(options, "allowedTags") && | ||
hasOwn(options, "allowedTags") && | ||
Array.isArray(options.allowedTags) && | ||
@@ -17,3 +24,3 @@ options.allowedTags.length > 0 | ||
allowedKeys: | ||
(Object.hasOwn(options, "allowedKeys") && | ||
(hasOwn(options, "allowedKeys") && | ||
Array.isArray(options.allowedKeys) && | ||
@@ -20,0 +27,0 @@ options.allowedKeys) || |
{ | ||
"name": "express-xss-sanitizer", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"description": "Express 4.x middleware which sanitizes user input data (in req.body, req.query, req.headers and req.params) to prevent Cross Site Scripting (XSS) attack.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -9,4 +9,2 @@ # Express XSS Sanitizer | ||
``` | ||
## Version Compatibility | ||
* Express XSS Sanitizer v1.1.3 or above need node v16.9.0 or above | ||
## Usage | ||
@@ -13,0 +11,0 @@ Add as a piece of express middleware, before defining your routes. |
39300
1304
76