()
| 344 | // so re-entry throws instead. |
| 345 | let IN_TRUSTED_TYPES_POLICY = 0; |
| 346 | const _assertNotInTrustedTypesPolicy = function (): void { |
| 347 | if (IN_TRUSTED_TYPES_POLICY > 0) { |
| 348 | throw typeErrorCreate( |
| 349 | 'A configured TRUSTED_TYPES_POLICY callback (createHTML or ' + |
| 350 | 'createScriptURL) must not call DOMPurify.sanitize, as that causes ' + |
| 351 | 'infinite recursion. Do not pass a policy whose callbacks wrap ' + |
| 352 | 'DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted ' + |
| 353 | 'Types" section of the README.' |
| 354 | ); |
| 355 | } |
| 356 | }; |
| 357 | |
| 358 | const _createTrustedHTML = function (html: string): string { |
| 359 | _assertNotInTrustedTypesPolicy(); |
no outgoing calls
no test coverage detected