<commit_before>/**
 * @desc Simple preprocessor file to run JSX over our source
 * and test files using react-tools when they're required
 */
var ReactPreprocessor = function(args, config, logger) {
    var log = logger.create('preprocessor.react');
    var transformPath = args.transformPath || config.transformPath || function(filepath) {
        return filepath.replace(/\.jsx$/, '.js');
    };

    return function(content, file, done) {
        log.debug('Processing "%s".', file.originalPath);
        file.path = transformPath(file.originalPath);

        done(require('react-tools').transform(content));
    };
};

ReactPreprocessor.$inject = ['args', 'config.reactPreprocessor', 'logger'];

module.exports = {
    'preprocessor:react': ['factory', ReactPreprocessor]
};<commit_msg>fix(preprocessor): Do not crash preprocessor when config is undefined<commit_after>/**
 * @desc Simple preprocessor file to run JSX over our source
 * and test files using react-tools when they're required
 */
var ReactPreprocessor = function(args, config, logger) {
    var log = logger.create('preprocessor.react');
    config = config || {};

    var transformPath = args.transformPath || config.transformPath || function(filepath) {
        return filepath.replace(/\.jsx$/, '.js');
    };

    return function(content, file, done) {
        log.debug('Processing "%s".', file.originalPath);
        file.path = transformPath(file.originalPath);

        done(require('react-tools').transform(content));
    };
};

ReactPreprocessor.$inject = ['args', 'config.reactPreprocessor', 'logger'];

module.exports = {
    'preprocessor:react': ['factory', ReactPreprocessor]
};
{'fraction_non_alphanumeric': 0.1484375, 'fraction_numerical': 0.0, 'mean_word_length': 4.0, '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': '3237216', 'n_tokens_mistral': 460, 'n_tokens_neox': 454, 'n_words': 116}