We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
null
1 parent 0b02f05 commit 4ff5d3dCopy full SHA for 4ff5d3d
1 file changed
src/index.ts
@@ -13,8 +13,9 @@ interface CSPTrustedTypesPolicy {
13
createHTML: (s: string, response: Response) => CSPTrustedHTMLToStringable
14
}
15
let cspTrustedTypesPolicyPromise: Promise<CSPTrustedTypesPolicy> | null = null
16
-export function setCSPTrustedTypesPolicy(policy: CSPTrustedTypesPolicy | Promise<CSPTrustedTypesPolicy>): void {
17
- cspTrustedTypesPolicyPromise = Promise.resolve(policy)
+// Passing `null` clears the policy.
+export function setCSPTrustedTypesPolicy(policy: CSPTrustedTypesPolicy | Promise<CSPTrustedTypesPolicy> | null): void {
18
+ cspTrustedTypesPolicyPromise = policy === null ? policy : Promise.resolve(policy)
19
20
21
export default class IncludeFragmentElement extends HTMLElement {
0 commit comments