File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
packages/svelte/src/internal/client/dom Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change 1
1
/** @import { TrustedTypePolicy } from 'trusted-types' */
2
2
3
- /** @type {Pick<TrustedTypePolicy, 'createHTML'> | undefined } */
4
- let policy ;
5
-
6
- if ( globalThis ?. window ?. trustedTypes ) {
7
- policy = globalThis . window . trustedTypes . createPolicy ( 'svelte-trusted-html' , {
3
+ const policy = /* @__PURE__ */ globalThis ?. window ?. trustedTypes ?. createPolicy (
4
+ 'svelte-trusted-html' ,
5
+ {
8
6
/** @param {string } html */
9
7
createHTML : ( html ) => {
10
8
return html ;
11
9
}
12
- } ) ;
13
- }
10
+ }
11
+ ) ;
14
12
15
13
/** @param {string } html */
16
14
function create_trusted_html ( html ) {
17
- return /** @type {string } */ ( policy ?. createHTML ( html ) ?? html ) ;
15
+ return /** @type {string } */ ( policy ?. createHTML ( html ) ?? html ) ;
18
16
}
19
17
20
18
/** @param {string } html */
You can’t perform that action at this time.
0 commit comments