isomorphic-dompurify 1.12.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -39,23 +39,18 @@ Please note that DOMPurify library [doesn't follow Semantic Versioning](https://
39
39
 
40
40
  ## Usage
41
41
 
42
- 1. Import the library:
43
-
42
+ Import:
44
43
  ```javascript
45
- // Import a necessary function in the ES6 way (recommended):
46
- import { sanitize, isSupported } from "isomorphic-dompurify";
47
-
48
- // or the entire module:
49
- import DOMPurify from 'isomorphic-dompurify';
50
-
51
- // or as a CommonJS module:
52
- const DOMPurify = require('isomorphic-dompurify');
44
+ import { sanitize } from "isomorphic-dompurify";
53
45
  ```
54
46
 
55
- 2. Sanitize a string:
56
-
47
+ Sanitize:
48
+ ```javascript
49
+ const clean = sanitize(dirtyString);
50
+ ```
51
+ or with [config](https://github.com/cure53/DOMPurify/blob/main/README.md):
57
52
  ```javascript
58
- const clean = DOMPurify.sanitize(dirty);
53
+ const clean = sanitize(dirtyString, { USE_PROFILES: { html: true } });
59
54
  ```
60
55
 
61
56
  ## Known Issues
package/browser.js CHANGED
@@ -1,2 +1 @@
1
- 'use client';
2
1
  module.exports = window.DOMPurify || (window.DOMPurify = require('dompurify').default || require('dompurify'));
package/index.js CHANGED
@@ -1 +1 @@
1
- function e(e){return e&&e.default||e}module.exports=global.DOMPurify=global.DOMPurify||("undefined"==typeof process?e(require("dompurify")):function(){const r=e(require("dompurify")),{JSDOM:u}=e(require("jsdom")),{window:o}=new u("<!DOCTYPE html>");return r(o)}());
1
+ function e(e){return e&&e.default||e}module.exports=global.DOMPurify=global.DOMPurify||("undefined"!=typeof window?e(require("dompurify")):function(){const r=e(require("dompurify")),{JSDOM:u}=e(require("jsdom")),{window:o}=new u("<!DOCTYPE html>");return r(o)}());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isomorphic-dompurify",
3
- "version": "1.12.0",
3
+ "version": "2.0.0",
4
4
  "description": "Makes it possible to use DOMPurify on server and client in the same way.",
5
5
  "keywords": [
6
6
  "security",
@@ -37,7 +37,7 @@
37
37
  },
38
38
  "devDependencies": {
39
39
  "jest": "^29.7.0",
40
- "terser": "^5.20.0"
40
+ "terser": "^5.26.0"
41
41
  },
42
42
  "engines": {
43
43
  "node": ">=18"