Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function compileRoutes(state) {
const stateNavigator = createStateNavigator();
const encodedState = (state && encode(JSON.stringify(state)));
const compile = route => {
const path = (process.env.URL_BASENAME || '') + route.filePath;
const title = `${route.title} | ${TITLE_SUFFIX}`;
stateNavigator.navigateLink(route.link, 'none');
const renderStart = Date.now();
const bodyContent = renderToString(route.component({ stateNavigator, title }, route.props));
const renderMs = Date.now() - renderStart;
const ejsStart = Date.now();
const body = layoutTemplate({
title,
tracking,
bodyContent,