Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@wpe-tkpd/xss

Package Overview
Dependencies
Maintainers
5
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wpe-tkpd/xss - npm Package Compare versions

Comparing version 3.0.1 to 3.1.0

dist/sanitizeMongo.d.ts

11

dist/sanitizeHtml/sanitizeHtmlBrowser.js

@@ -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

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