<commit_before>'use strict';
module.exports = function (str, opts) {
	if (typeof str !== 'string') {
		throw new TypeError('Expected a string');
	}

	opts = opts || {};

	return str + ' & ' + (opts.postfix || 'rainbows');
};<commit_msg>Functional milestone. Export webpack config<commit_after>var debug = require('./lib/debug.js')('index');

var devConfig = require('./lib/config.dev.js');
var prodConfig = require('./lib/config.prod.js');
var removeKeys = require('./lib/removeKeys.js');

// Custom arguments that should be removed from the final config we export to
// webpack
var customArgs = [
  'in',
  'out',
  'cleanOnBuild',
  'isDev',
];

function validateConfig(config) {
  if (!config || typeof config !== 'object') {
    debug('Non-object was passed as config');
    throw new TypeError('Expected a configuration object');
  }

  debug('Validating required config params');
  ['in', 'out'].forEach(function(opt) {
    if (!config[opt]) {
      debug('`' + opt + '` was not defined on configuration object');
      throw new Error('Configuration object must have `in` and `out` properties.');
    }
  });
}

module.exports = function(config) {
  debug('Validating user defined config:', config);
  validateConfig(config);
  debug('Config valid. Exporting based on NODE_EN: ' + process.env.NODE_ENV);

  var finalConfig = removeKeys(
    config.isDev === false ? prodConfig(config) : devConfig(config),
    customArgs
  );

  debug('Exporting final config:', finalConfig);
  return finalConfig;
};
{'fraction_non_alphanumeric': 0.16058394160583941, 'fraction_numerical': 0.0, 'mean_word_length': 4.164383561643835, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1382997', 'n_tokens_mistral': 455, 'n_tokens_neox': 444, 'n_words': 130}