<commit_before>'use strict';

const path = require('path');
// const Promisie = require('promisie');
// const fs = Promisie.promisifyAll(require('fs-extra'));
// const Errorie = require('errorie');

module.exports = function(periodic) {
  let appenvironment = periodic.settings.application.environment;
  let defaultConfig = require(path.join(__dirname, '../config/settings.js')).development;
  let config = require(path.join(__dirname, '../../../content/config/extensions/periodicjs.ext.reactadmin/settings.js'));
  let extensionConfig = Object.assign({}, defaultConfig, { adminPath: 'r-admin', }, config[appenvironment]);
    // console.log({ extensionConfig });
  let reactadminConfig = {
    settings: extensionConfig,
    manifest_prefix: `${(extensionConfig.adminPath === '')
      ? ''
      : (extensionConfig.adminPath && extensionConfig.adminPath.charAt(0) === '/')
        ? extensionConfig.adminPath
        : '/' + extensionConfig.adminPath}`,
  };

  periodic.app.controller.extension.reactadmin = Object.assign({}, periodic.app.controller.extension.reactadmin, reactadminConfig);

    // periodic.app.controller.extension.reactadmin.settings.getDBConnection = mongooseLogger.getDBConnection;
    // periodic.app.locals.reactadmin_util = require('../lib/log_tables')(periodic);
  periodic.app.locals.theme_name = periodic.settings.theme;
  periodic.app.locals.adminPath = extensionConfig.adminPath;
  periodic.app.locals.extension = Object.assign({}, periodic.app.locals.extension, {
    reactadmin: reactadminConfig,
  });

  return periodic;
};<commit_msg>adding correct prefixes<commit_after>'use strict';

const path = require('path');
// const Promisie = require('promisie');
// const fs = Promisie.promisifyAll(require('fs-extra'));
// const Errorie = require('errorie');

module.exports = function(periodic) {
  let appenvironment = periodic.settings.application.environment;
  let defaultConfig = require(path.join(__dirname, '../config/settings.js')).development;
  let config = require(path.join(__dirname, '../../../content/config/extensions/periodicjs.ext.reactadmin/settings.js'));
  let extensionConfig = Object.assign({}, defaultConfig, { adminPath: 'r-admin', }, config[appenvironment]);
    // console.log({ extensionConfig });
  let route_prefix = `${(extensionConfig.adminPath === '')
    ? '/'
    : (extensionConfig.adminPath && extensionConfig.adminPath.charAt(0) === '/')
      ? extensionConfig.adminPath
      : '/' + extensionConfig.adminPath}`;
  let admin_prefix = route_prefix.substr(1);
  let manifest_prefix = (admin_prefix.length>0) ? `/${admin_prefix}/` : '/'
  let reactadminConfig = {
    settings: extensionConfig,
    route_prefix,
    admin_prefix,
    manifest_prefix,
  };
  // console.log({
  //   route_prefix,
  //   admin_prefix,
  //   manifest_prefix,
  // });

  periodic.app.controller.extension.reactadmin = Object.assign({}, periodic.app.controller.extension.reactadmin, reactadminConfig);

    // periodic.app.controller.extension.reactadmin.settings.getDBConnection = mongooseLogger.getDBConnection;
    // periodic.app.locals.reactadmin_util = require('../lib/log_tables')(periodic);
  periodic.app.locals.theme_name = periodic.settings.theme;
  periodic.app.locals.adminPath = extensionConfig.adminPath;
  periodic.app.locals.extension = Object.assign({}, periodic.app.locals.extension, {
    reactadmin: reactadminConfig,
  });

  return periodic;
};
{'fraction_non_alphanumeric': 0.15764843521497515, 'fraction_numerical': 0.00116993272886809, 'mean_word_length': 4.4372019077901435, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '4466811', 'n_tokens_mistral': 987, 'n_tokens_neox': 982, 'n_words': 147}