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(req.zoiaConfig.languages).map(language => {
if (formData[language]) {
let contentCompiled = formData[language].content;
if (formData[language].extras.indexOf('typo') > -1) {
const locale = [];
if (language !== 'en') {
locale.push(language);
}
locale.push('en-US');
contentCompiled = new Typograf({
locale
}).execute(formData[language].content);
}
if (formData[language].extras.indexOf('minify') > -1) {
contentCompiled = minify(contentCompiled, {
caseSensitive: true,
decodeEntities: true,
html5: true,
collapseWhitespace: true,
removeComments: true,
removeRedundantAttributes: true
});
}
pageData.data[language] = {
title: formData[language].title,
content: formData[language].content,