Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function renderCsp(str, headerName) {
if (pretty) {
str = (headerName ? `${headerName}:\n` : '') + reformatCsp(str);
} else if (headerName) {
str = `${headerName}: ${str}`;
}
return magicPen
.clone()
.code(str, 'csp')
.toString(MagicPen.defaultFormat);
}