Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function parseTemplate(code) {
const obj = compiler.nativeCompiler(code);
return {
import: obj.importCode,
render: `const ${constants.TEMPLATE_RENDER} = ${obj.renderCode}`
};
}
function parseTemplate(code) {
var obj = compiler.nativeCompiler(code);
return {
import: obj.importCode,
render: ("const " + (constants.TEMPLATE_RENDER) + " = " + (obj.renderCode))
};
}
function parseTemplate(template) {
if (!template) {
return defaultTemplate;
}
const { content, lang } = template;
const trimmedContent = content.replace(/\/\/\n/g, '');
const transpiledContent = transpileTemplateContent(trimmedContent, lang);
if (transpiledContent) {
const obj = compiler.nativeCompiler(transpiledContent);
return {
import: obj.importCode,
render: `const ${constants.TEMPLATE_RENDER} = ${obj.renderCode}`,
};
}
}