All files / js trusted-types.policy.js

0% Statements 0/5
0% Branches 0/4
0% Functions 0/3
0% Lines 0/5

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20                                       
// See more here: https://web.dev/trusted-types/#create-a-default-policy
 
/**
 * This global variable is declared by declaring "node_modules/dompurify/dist/purify.min.js"
 * in angular.json `scripts` array.
 */
var DOMPurify;
 
/**
 * Creates a default Trusted Types policy.
 * This file is added to client frontend applications via angular.json `scripts` array.
 */
if (window.trustedTypes && window.trustedTypes.createPolicy) {
  window.trustedTypes.createPolicy('default', {
    createHTML: string => DOMPurify.sanitize(string, { RETURN_TRUSTED_TYPE: true }),
    createScript: string => DOMPurify.sanitize(string, { RETURN_TRUSTED_TYPE: true }),
    createScriptURL: string => DOMPurify.sanitize(string, { RETURN_TRUSTED_TYPE: true }),
  });
}