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 1.0.0 to 1.0.1

3

dist/sanitizeHtml/sanitizeHtmlBrowser.d.ts

@@ -9,2 +9,5 @@ import DOMPurify from 'dompurify';

declare function sanitizeHtmlBrowser(dirtyHtml: string, options: DOMPurify.Config & {
RETURN_TRUSTED_TYPE: true;
}, domPurifyInstance?: DOMPurify.DOMPurifyI): Window['TrustedHTML'];
declare function sanitizeHtmlBrowser(dirtyHtml: string, options: DOMPurify.Config & {
RETURN_DOM_FRAGMENT?: false;

@@ -11,0 +14,0 @@ RETURN_DOM?: false;

import DOMPurify from 'dompurify';
function sanitizeHtmlBrowser(dirtyHtml, options = {}, domPurifyInstance = DOMPurify) {
const { RETURN_TRUSTED_TYPE } = options;
if (RETURN_TRUSTED_TYPE) {
const sanitizedHtml = domPurifyInstance.sanitize(dirtyHtml, Object.assign(Object.assign({}, options), { RETURN_TRUSTED_TYPE: true }));
return sanitizedHtml;
}
const sanitizedHtml = domPurifyInstance.sanitize(dirtyHtml, options);

@@ -4,0 +9,0 @@ return sanitizedHtml;

15

package.json
{
"name": "@wpe-tkpd/xss",
"version": "1.0.0",
"version": "1.0.1",
"description": "Various sanitizer, escaper, encoder, and utilities to prevent XSS",
"sideEffects": false,
"files": [
"dist",
"!__tests__"
],
"scripts": {
"test": "jest",
"tc": "tsc --noEmit",
"lint:only": "lint-staged -c lint-staged.config.js",
"lint": "pnpm run lint:only && pnpm run tc",
"babel:build": "babel src -d dist --extensions '.js,.jsx,.ts,.tsx' --ignore '**/*.(test).(j|t)sx?' --verbose --source-maps",
"lint:staged": "lint-staged -c lint-staged.config.js",
"lint": "pnpm run lint:staged && pnpm run tc",
"babel:build": "babel src -d dist --extensions '.js,.jsx,.ts,.tsx' --ignore '**/__tests__/**' --verbose --source-maps",
"dev": "babel -w src -d dist --extensions '.js,.jsx,.ts,.tsx' --ignore '**/*.(test).(j|t)sx?' --verbose --source-maps",
"build-package": "pnpm run babel:build && tsc --build",
"build": "rm -rf dist && pnpm run build-package"
"build": "rm -rf dist && pnpm run build-package",
"prepare": "pnpm run tc && pnpm run test && pnpm run build"
},

@@ -16,0 +21,0 @@ "repository": {

Sorry, the diff of this file is not supported yet

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