Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Object.keys(bootstrap.setup_data).forEach((sd) => {
let val = bootstrap.setup_data[sd];
if (val) {
if (Array.isArray(val)) {
val = JSON.stringify(val);
} else {
val = val.toString();
}
setupData += ` data-${sd.replace(/\_/g, "-")}="${encode(val)}"`;
}
});
buffer.push(``);
function preloaded(buffer, bootstrap) {
buffer.push(
`<div data-preloaded="${encode(
JSON.stringify(bootstrap.preloaded)
)}" id="data-preloaded" class="hidden"></div>`
);
}