isomorphic-dompurify 3.0.0-rc.2 → 3.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 +4 -0
- package/dist/index.d.mts +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.js +5 -1
- package/dist/index.mjs +5 -1
- package/package.json +6 -1
package/README.md
CHANGED
|
@@ -82,6 +82,10 @@ clearWindow();
|
|
|
82
82
|
The `isomorphic-dompurify` library is [compatible with Web Workers](https://github.com/kkomelin/isomorphic-dompurify/pull/242),
|
|
83
83
|
however, `dompurify`, which it depends upon, [is not, at least not yet](https://github.com/cure53/DOMPurify/issues/577).
|
|
84
84
|
|
|
85
|
+
## Playgrounds
|
|
86
|
+
|
|
87
|
+
Want to try `isomorphic-dompurify` with your favorite framework? Check out [isomorphic-dompurify-playgrounds](https://github.com/kkomelin/isomorphic-dompurify-playgrounds) — minimal setups for popular frameworks including Astro, Next.js, Nuxt, React and Svelte.
|
|
88
|
+
|
|
85
89
|
## License
|
|
86
90
|
|
|
87
91
|
DOMPurify -
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as dompurify from 'dompurify';
|
|
2
1
|
import { DOMPurify as DOMPurify$1 } from 'dompurify';
|
|
3
2
|
|
|
4
3
|
declare const DOMPurify: DOMPurify$1;
|
|
@@ -13,7 +12,7 @@ declare const setConfig: DOMPurify$1["setConfig"];
|
|
|
13
12
|
declare const clearConfig: DOMPurify$1["clearConfig"];
|
|
14
13
|
declare const isValidAttribute: DOMPurify$1["isValidAttribute"];
|
|
15
14
|
declare const version: string;
|
|
16
|
-
declare const removed:
|
|
15
|
+
declare const removed: DOMPurify$1['removed'];
|
|
17
16
|
declare function clearWindow(): void;
|
|
18
17
|
|
|
19
18
|
export { addHook, clearConfig, clearWindow, DOMPurify as default, isSupported, isValidAttribute, removeAllHooks, removeHook, removeHooks, removed, sanitize, setConfig, version };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as dompurify from 'dompurify';
|
|
2
1
|
import { DOMPurify as DOMPurify$1 } from 'dompurify';
|
|
3
2
|
|
|
4
3
|
declare const DOMPurify: DOMPurify$1;
|
|
@@ -13,7 +12,7 @@ declare const setConfig: DOMPurify$1["setConfig"];
|
|
|
13
12
|
declare const clearConfig: DOMPurify$1["clearConfig"];
|
|
14
13
|
declare const isValidAttribute: DOMPurify$1["isValidAttribute"];
|
|
15
14
|
declare const version: string;
|
|
16
|
-
declare const removed:
|
|
15
|
+
declare const removed: DOMPurify$1['removed'];
|
|
17
16
|
declare function clearWindow(): void;
|
|
18
17
|
|
|
19
18
|
export { addHook, clearConfig, clearWindow, DOMPurify as default, isSupported, isValidAttribute, removeAllHooks, removeHook, removeHooks, removed, sanitize, setConfig, version };
|
package/dist/index.js
CHANGED
|
@@ -66,7 +66,11 @@ var setConfig = ((config) => purify.setConfig(config));
|
|
|
66
66
|
var clearConfig = (() => purify.clearConfig());
|
|
67
67
|
var isValidAttribute = ((tag, attr, value) => purify.isValidAttribute(tag, attr, value));
|
|
68
68
|
var version = DOMPurify.version;
|
|
69
|
-
var removed =
|
|
69
|
+
var removed = new Proxy([], {
|
|
70
|
+
get(_, prop) {
|
|
71
|
+
return Reflect.get(purify.removed, prop);
|
|
72
|
+
}
|
|
73
|
+
});
|
|
70
74
|
function clearWindow() {
|
|
71
75
|
window.close();
|
|
72
76
|
window = new import_jsdom.JSDOM("<!DOCTYPE html>").window;
|
package/dist/index.mjs
CHANGED
|
@@ -20,7 +20,11 @@ var setConfig = ((config) => purify.setConfig(config));
|
|
|
20
20
|
var clearConfig = (() => purify.clearConfig());
|
|
21
21
|
var isValidAttribute = ((tag, attr, value) => purify.isValidAttribute(tag, attr, value));
|
|
22
22
|
var version = DOMPurify.version;
|
|
23
|
-
var removed =
|
|
23
|
+
var removed = new Proxy([], {
|
|
24
|
+
get(_, prop) {
|
|
25
|
+
return Reflect.get(purify.removed, prop);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
24
28
|
function clearWindow() {
|
|
25
29
|
window.close();
|
|
26
30
|
window = new JSDOM("<!DOCTYPE html>").window;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isomorphic-dompurify",
|
|
3
|
-
"version": "3.0.0
|
|
3
|
+
"version": "3.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",
|
|
@@ -60,8 +60,10 @@
|
|
|
60
60
|
"jsdom": "^28.0.0"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
+
"@biomejs/biome": "^2.4.2",
|
|
63
64
|
"@types/jsdom": "^27.0.0",
|
|
64
65
|
"@types/trusted-types": "^2.0.7",
|
|
66
|
+
"lefthook": "^2.1.1",
|
|
65
67
|
"tsup": "^8.5.1",
|
|
66
68
|
"typescript": "^5.9.3",
|
|
67
69
|
"vitest": "^4.0.16"
|
|
@@ -71,6 +73,9 @@
|
|
|
71
73
|
},
|
|
72
74
|
"scripts": {
|
|
73
75
|
"build": "tsup",
|
|
76
|
+
"lint": "biome check",
|
|
77
|
+
"lint:fix": "biome check --fix",
|
|
78
|
+
"typecheck": "tsc --noEmit",
|
|
74
79
|
"test": "NODE_OPTIONS='--expose-gc' vitest run"
|
|
75
80
|
}
|
|
76
81
|
}
|