Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Twig.renderWithLayout = function(path, options, fn) {
const layoutPath = options.settings.views + '/' + options.layout + '.' + options.settings['view engine'];
function layoutRendered(error, layout) {
function bodyRendered(error, body) {
layout = layout.replace('', body);
return fn(null, layout);
}
return Twig.__express(path, options, bodyRendered);
}
return Twig.__express(layoutPath, options, layoutRendered);
};
function layoutRendered(error, layout) {
function bodyRendered(body) {
layout = layout.replace('', body);
return fn(null, layout);
}
return Twig.__express(path, options, bodyRendered);
}
return Twig.__express(layoutPath, options, layoutRendered);
Twig.renderWithLayout = (path, options, fn) => {
const layoutPath = `${options.settings.views}/${options.layout}.${options.settings['view engine']}`;
function layoutRendered(error, layout) {
function bodyRendered(body) {
layout = layout.replace('', body);
return fn(null, layout);
}
return Twig.__express(path, options, bodyRendered);
}
return Twig.__express(layoutPath, options, layoutRendered);
};
function layoutRendered(error, layout) {
function bodyRendered(error, body) {
layout = layout.replace('', body);
return fn(null, layout);
}
return Twig.__express(path, options, bodyRendered);
}
return Twig.__express(layoutPath, options, layoutRendered);