<commit_before>/**
 * auto directory loader
 * ex) return user-controller.js as UserController
 */
'use strict';

module.exports = function(dirname) {
  var modules = {};

  require('fs').readdirSync(dirname + '/').forEach(file => {
    if (file.match(/\.js$/) !== null && file !== 'index.js') {
      var name = file
      .replace('.js', '')
      .split('-')
      .map(term => term[0].toUpperCase() + term.slice(1))
      .join('');

      modules[name] = require(dirname + '/' + file);
    }
  });

  return modules;
};
<commit_msg>add uppercase option<commit_after>/**
 * auto directory loader
 * ex) return user-controller.js as UserController
 */
'use strict';

module.exports = function(dirname, uppercase) {
  var modules   = {};
  uppercase = uppercase || true;

  require('fs').readdirSync(dirname + '/').forEach(file => {
    if (file.match(/\.js$/) !== null && file !== 'index.js') {
      var name = file
      .replace('.js', '')
      .split('-')
      .map(term => uppercase ? term[0].toUpperCase() + term.slice(1) : term)
      .join('');

      modules[name] = require(dirname + '/' + file);
    }
  });

  return modules;
};

{'fraction_non_alphanumeric': 0.21029668411867364, 'fraction_numerical': 0.0034904013961605585, 'mean_word_length': 2.7854785478547854, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '6936729', 'n_tokens_mistral': 376, 'n_tokens_neox': 369, 'n_words': 80}