<commit_before>'use strict';

// Load modules
const glob = require('glob');
const path = require('path');

// Declare internals
const internals = {};

internals.load = (options, callback) => {

  options = options || {};
  options.extension = options.extension || '.js';
  var modules = {};

  var files = glob.sync('*' + options.extension, { cwd: options.path || __dirname });
  for (let i in files) {
    if (files[i] != path.basename(__filename)) {
      let key = path.basename(files[i], options.extension);
      key = key.charAt(0).toUpperCase() + key.slice(1);

      modules[key] = require((options.path || __dirname) + '/' + files[i]);
    }
  }

  return callback(null, modules);
};

exports.expose = (options, name, plugin, next) => {
  internals.load(options, (err, handlers) => {
    if (err) {
      throw err;
    }

    plugin.expose(name, handlers);
    next();
  });
};<commit_msg>Internals should not be a const<commit_after>'use strict';

// Load modules
const glob = require('glob');
const path = require('path');

// Declare internals
var internals = {};

internals.load = (options, callback) => {

  options = options || {};
  options.extension = options.extension || '.js';
  var modules = {};

  var files = glob.sync('*' + options.extension, { cwd: options.path || __dirname });
  for (let i in files) {
    if (files[i] != path.basename(__filename)) {
      let key = path.basename(files[i], options.extension);
      key = key.charAt(0).toUpperCase() + key.slice(1);

      modules[key] = require((options.path || __dirname) + '/' + files[i]);
    }
  }

  return callback(null, modules);
};

exports.expose = (options, name, plugin, next) => {
  internals.load(options, (err, handlers) => {
    if (err) {
      throw err;
    }

    plugin.expose(name, handlers);
    next();
  });
};
{'fraction_non_alphanumeric': 0.18412348401323042, 'fraction_numerical': 0.002205071664829107, 'mean_word_length': 3.300947867298578, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '447479', 'n_tokens_mistral': 599, 'n_tokens_neox': 584, 'n_words': 141}