@wpe-tkpd/xss
Advanced tools
Comparing version 3.0.1 to 3.1.0
@@ -10,14 +10,10 @@ "use strict"; | ||
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); | ||
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2")); | ||
var _dompurify = _interopRequireDefault(require("dompurify")); | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } | ||
function sanitizeHtmlBrowser(dirtyHtml) { | ||
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var domPurifyInstance = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _dompurify.default; | ||
var sanitizedHtml = domPurifyInstance.sanitize(dirtyHtml, _objectSpread(_objectSpread({}, options), {}, { | ||
var sanitizedHtml = domPurifyInstance.sanitize(dirtyHtml, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, options), {}, { | ||
RETURN_TRUSTED_TYPE: false, | ||
@@ -31,3 +27,2 @@ RETURN_DOM: false, | ||
var _default = sanitizeHtmlBrowser; | ||
exports.default = _default; | ||
//# sourceMappingURL=sanitizeHtmlBrowser.js.map | ||
exports.default = _default; |
@@ -17,4 +17,3 @@ "use strict"; | ||
var JSDOM = _jsdom.default.JSDOM; | ||
var dom = new JSDOM(); // @ts-ignore: because JSDOM window is not plain JS window | ||
var dom = new JSDOM(); | ||
var domPurifyInstance = (0, _dompurify.default)(dom.window); | ||
@@ -24,3 +23,2 @@ | ||
return (0, _sanitizeHtmlBrowser.default)(dirtyHtml, options, domPurifyInstance); | ||
} | ||
//# sourceMappingURL=sanitizeHtmlServer.js.map | ||
} |
@@ -18,3 +18,2 @@ "use strict"; | ||
return sanitizedUrl; | ||
} | ||
//# sourceMappingURL=sanitizeUrl.js.map | ||
} |
{ | ||
"name": "@wpe-tkpd/xss", | ||
"version": "3.0.1", | ||
"version": "3.1.0", | ||
"description": "Various sanitizer, escaper, encoder, and utilities to prevent XSS", | ||
@@ -15,3 +15,3 @@ "sideEffects": false, | ||
"lint": "pnpm run lint:staged && pnpm run tc", | ||
"babel:build": "babel src -d dist --extensions '.js,.jsx,.ts,.tsx' --ignore '**/__tests__/**' --verbose --source-maps", | ||
"babel:build": "babel src -d dist --extensions '.js,.jsx,.ts,.tsx' --ignore '**/__tests__/**' --verbose", | ||
"dev": "babel -w src -d dist --extensions '.js,.jsx,.ts,.tsx' --ignore '**/*.(test).(j|t)sx?' --verbose --source-maps", | ||
@@ -34,3 +34,4 @@ "build-package": "pnpm run babel:build && tsc --emitDeclarationOnly", | ||
"@wpe-tkpd/jsdom": "^16.5.1", | ||
"dompurify": "^2.2.2" | ||
"dompurify": "^2.2.2", | ||
"mongo-sanitize": "^1.1.0" | ||
}, | ||
@@ -56,2 +57,3 @@ "devDependencies": { | ||
"@types/jsdom": "^16.2.5", | ||
"@types/mongo-sanitize": "^1.0.1", | ||
"@types/node": "^12.0.0", | ||
@@ -58,0 +60,0 @@ "@typescript-eslint/eslint-plugin": "^4.11.1", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
15
61
1
2
6818
5
36
1
80
+ Addedmongo-sanitize@^1.1.0
+ Addedmongo-sanitize@1.1.0(transitive)