<commit_before>import _ from 'lodash';
import React from 'react';
import {Route} from 'react-router';
import DevIndex from './DevIndex.jsx';
import BodyContent from './BodyContent.jsx';
import paths from '../libs/paths';
import config from 'config';

export default (
  <Route>
    {__DEV__ && <Route path="antwar_devindex" component={DevIndex} />}
    {_.map(config.paths, function(v, k) {
      const pathRoutes = paths.getSectionPages(k).map(_.property('url')).map((url) =>
        <Route component={BodyContent} path={url} />
      );

      // possible root path needs to be after other paths. else it can match too early
      if(k === '/') {
        return pathRoutes;
      }

      return pathRoutes.concat([
        <Route component={BodyContent} path={k} />
      ]);
    })}
    {config.paths['/'] && <Route component={BodyContent} path="/" />}
  </Route>
);<commit_msg>Routes - Tidy up<commit_after>import _ from 'lodash';
import React from 'react';
import {Route} from 'react-router';
import DevIndex from './DevIndex.jsx';
import BodyContent from './BodyContent.jsx';
import paths from '../libs/paths';
import config from 'config';

export default (
  <Route>
    {__DEV__ && <Route path="antwar_devindex" component={DevIndex} />}
    {_.map(config.paths, function(v, k) {
      const pathRoutes = paths.getSectionPages(k).map(({url}) =>
        <Route component={BodyContent} path={url} />
      );

      // possible root path needs to be after other paths. else it can match too early
      if(k === '/') {
        return pathRoutes;
      }

      return pathRoutes.concat([
        <Route component={BodyContent} path={k} />
      ]);
    })}
    {config.paths['/'] && <Route component={BodyContent} path="/" />}
  </Route>
);
{'fraction_non_alphanumeric': 0.16666666666666666, 'fraction_numerical': 0.0, 'mean_word_length': 3.1496437054631827, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2809515', 'n_tokens_mistral': 538, 'n_tokens_neox': 528, 'n_words': 144}