Skip to content

Commit b3ba3c7

Browse files
authored
fix treeshaking
1 parent 5673d60 commit b3ba3c7

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

packages/svelte/src/internal/client/dom/reconciler.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
/** @import { TrustedTypePolicy } from 'trusted-types' */
22

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+
{
86
/** @param {string} html */
97
createHTML: (html) => {
108
return html;
119
}
12-
});
13-
}
10+
}
11+
);
1412

1513
/** @param {string} html */
1614
function create_trusted_html(html) {
17-
return /** @type {string} */(policy?.createHTML(html) ?? html);
15+
return /** @type {string} */ (policy?.createHTML(html) ?? html);
1816
}
1917

2018
/** @param {string} html */

0 commit comments

Comments
 (0)