()
| 301 | // so re-entry throws instead. |
| 302 | let IN_TRUSTED_TYPES_POLICY = 0; |
| 303 | const _assertNotInTrustedTypesPolicy = function (): void { |
| 304 | if (IN_TRUSTED_TYPES_POLICY > 0) { |
| 305 | throw typeErrorCreate( |
| 306 | 'A configured TRUSTED_TYPES_POLICY callback (createHTML or ' + |
| 307 | 'createScriptURL) must not call DOMPurify.sanitize, as that causes ' + |
| 308 | 'infinite recursion. Do not pass a policy whose callbacks wrap ' + |
| 309 | 'DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted ' + |
| 310 | 'Types" section of the README.' |
| 311 | ); |
| 312 | } |
| 313 | }; |
| 314 | |
| 315 | const _createTrustedHTML = function (html: string): string { |
| 316 | _assertNotInTrustedTypesPolicy(); |
no outgoing calls
no test coverage detected