isomorphic-dompurify 2.0.0 → 2.1.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.
Files changed (2) hide show
  1. package/README.md +7 -5
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -41,22 +41,24 @@ Please note that DOMPurify library [doesn't follow Semantic Versioning](https://
41
41
 
42
42
  Import:
43
43
  ```javascript
44
- import { sanitize } from "isomorphic-dompurify";
44
+ import DOMPurify from "isomorphic-dompurify";
45
45
  ```
46
+ _Importing the entire module for the client/browser version is recommended._
46
47
 
47
48
  Sanitize:
48
49
  ```javascript
49
- const clean = sanitize(dirtyString);
50
+ const clean = DOMPurify.sanitize(dirtyString);
50
51
  ```
51
52
  or with [config](https://github.com/cure53/DOMPurify/blob/main/README.md):
52
53
  ```javascript
53
- const clean = sanitize(dirtyString, { USE_PROFILES: { html: true } });
54
+ const clean = DOMPurify.sanitize(dirtyString, { USE_PROFILES: { html: true } });
54
55
  ```
55
56
 
56
57
  ## Known Issues
57
58
 
58
- 1. [Can't resolve 'canvas' on Next.js serverless app](https://github.com/kkomelin/isomorphic-dompurify/issues/54)
59
- 2. [Starting from 0.16.0, there is a dependency conflict which causes `ReferenceError: TextEncoder is not defined`](https://github.com/kkomelin/isomorphic-dompurify/issues/91)
59
+ 1. Next.js and Remix are mistakenly trying to use the `browser` entry point on server, which causes the `Window is not defined` issue. [#228](https://github.com/kkomelin/isomorphic-dompurify/issues/228) [#214](https://github.com/kkomelin/isomorphic-dompurify/issues/214) https://github.com/vercel/next.js/discussions/58142
60
+ 2. [Can't resolve 'canvas' on Next.js serverless app](https://github.com/kkomelin/isomorphic-dompurify/issues/54)
61
+ 3. [Starting from 0.16.0, there is a dependency conflict which causes `ReferenceError: TextEncoder is not defined`](https://github.com/kkomelin/isomorphic-dompurify/issues/91)
60
62
 
61
63
  ## License
62
64
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isomorphic-dompurify",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "Makes it possible to use DOMPurify on server and client in the same way.",
5
5
  "keywords": [
6
6
  "security",
@@ -32,7 +32,7 @@
32
32
  "types": "index.d.ts",
33
33
  "dependencies": {
34
34
  "@types/dompurify": "^3.0.3",
35
- "dompurify": "^3.0.6",
35
+ "dompurify": "^3.0.7",
36
36
  "jsdom": "^23.0.0"
37
37
  },
38
38
  "devDependencies": {