<commit_before>JARS.internal('ModuleConfig', function moduleConfigSetup(InternalsManager) {
    'use strict';

    var MIN_TIMEOUT = 0.5,
        STRING_CHECK = 'String',
        OBJECT_CHECK = 'Object',
        BOOLEAN_CHECK = 'Boolean',
        RE_END_SLASH = /\/$/,
        RE_DOT = /\./g,
        SLASH = '/',
        DEFAULT_EXTENSION = 'js',
        getInternal = InternalsManager.get,
        utils = getInternal('utils'),
        hasOwnProp = utils.hasOwnProp,
        objectMerge = utils.objectMerge,
        objectEach = utils.objectEach,
        configTransforms = {},
        Resolver = getInternal('Resolver'),
        System = getInternal('System');

    addConfigTransform('basePath', STRING_CHECK, ensureEndsWithSlash);

    addConfigTransform('cache', BOOLEAN_CHECK, function cacheTransform(cache) {
        return !!cache;
    });

    addConfigTransform('checkCircularDeps', BOOLEAN_CHECK);

    addConfigTransform('config', OBJECT_CHECK, function configTransform(newConfig, module, forBundle) {
        return objectMerge(module[forBundle ? 'bundleConfig' : 'config'].get('config'), newConfig);
    });

    addConfigTransform('dirPath', STRING_CHECK, ensureEndsWithSlash);

    addConfigTransform('extension', STRING_CHECK, function extensionTransform(extension) {
        return '.' + extension;
    });

    addConfigTransform('fileName', STRING_CHECK);

    addConfigTransform('minified', BOOLEAN_CHECK, function minTransform(loadMin) {
        return loadMin ? '.min' : '';
    });

    addConfigTransform('recover', OBJECT_CHECK, function recoverTransform(recoverConfig, module, forBundle) {
        // create a copy of the recover-config
        // because it should update for every module independendly
        var recover = objectMerge({}, recoverConfig);

        recover.restrict = module.getName(forBundle);
        // if no next recover-config is given set it explicitly
        // this is important because the recoverflow is as follows:
        // - if the module has a recover-config, use it to update its config
        // - if it has no recover-config look for it in a higher bundle-config
        // - if such a config is found, update the config for the module
        // - when the module-config is updated, options will always be overwritten but never deleted
        // So if the module has a recover-config that doesn't get replaced
        // it may repeatedly try to recover with this config
        recover.recover || (recover.recover = null);

        return recover;
    });

    addConfigTransform('timeout', 'Number', function timeoutTransform(timeout) {
        return (timeout > MIN_TIMEOUT ? timeout : MIN_TIMEOUT);
    });

    addConfigTransform('versionDir', STRING_CHECK, ensureEndsWithSlash);

    /**
     * @access public
     *
     * @constructor ModuleConfig
     *
     * @memberof JARS
     * @inner
     *
     * @param {JARS~Module} module
     * @param {Boolean} [isBundleConfig = false]
     * @param {JARS~ModuleConfig} [parentConfig]
     */
    function ModuleConfig(module, isBundleConfig, parentConfig) {
        var moduleConfig = this;

        moduleConfig._module = module;
        moduleConfig._isBundleConfig = isBundleConfig;
        moduleConfig._parentConfig = parentConfig;
        moduleConfig._options = parentConfig ? parentConfig.inheritOptions() : new ModuleConfigOptions();
        moduleConfig._defaultOptions = {};

        transformAndUpdateOptions(moduleConfig._defaultOptions, getDefaultOptions(module.name), module, isBundleConfig);
    }

    ModuleConfig.prototype = {
        /**
         * @access public
         *
         * @alias JARS~ModuleConfig
         *
         * @memberof JARS~ModuleConfig#
         */
        constructor: ModuleConfig,
        /**
         * @access public
         *
         * @memberof JARS~ModuleConfig#<commit_msg>Make default options an instance of ModuleConfigOptions<commit_after>JARS.internal('ModuleConfig', function moduleConfigSetup(InternalsManager) {
    'use strict';

    var MIN_TIMEOUT = 0.5,
        STRING_CHECK = 'String',
        OBJECT_CHECK = 'Object',
        BOOLEAN_CHECK = 'Boolean',
        RE_END_SLASH = /\/$/,
        RE_DOT = /\./g,
        SLASH = '/',
        DEFAULT_EXTENSION = 'js',
        getInternal = InternalsManager.get,
        utils = getInternal('utils'),
        hasOwnProp = utils.hasOwnProp,
        objectMerge = utils.objectMerge,
        objectEach = utils.objectEach,
        configTransforms = {},
        Resolver = getInternal('Resolver'),
        System = getInternal('System');

    addConfigTransform('basePath', STRING_CHECK, ensureEndsWithSlash);

    addConfigTransform('cache', BOOLEAN_CHECK, function cacheTransform(cache) {
        return !!cache;
    });

    addConfigTransform('checkCircularDeps', BOOLEAN_CHECK);

    addConfigTransform('config', OBJECT_CHECK, function configTransform(newConfig, module, forBundle) {
        return objectMerge(module[forBundle ? 'bundleConfig' : 'config'].get('config'), newConfig);
    });

    addConfigTransform('dirPath', STRING_CHECK, ensureEndsWithSlash);

    addConfigTransform('extension', STRING_CHECK, function extensionTransform(extension) {
        return '.' + extension;
    });

    addConfigTransform('fileName', STRING_CHECK);

    addConfigTransform('minified', BOOLEAN_CHECK, function minTransform(loadMin) {
        return loadMin ? '.min' : '';
    });

    addConfigTransform('recover', OBJECT_CHECK, function recoverTransform(recoverConfig, module, forBundle) {
        // create a copy of the recover-config
        // because it should update for every module independendly
        var recover = objectMerge({}, recoverConfig);

        recover.restrict = module.getName(forBundle);
        // if no next recover-config is given set it explicitly
        // this is important because the recoverflow is as follows:
        // - if the module has a recover-config, use it to update its config
        // - if it has no recover-config look for it in a higher bundle-config
        // - if such a config is found, update the config for the module
        // - when the module-config is updated, options will always be overwritten but never deleted
        // So if the module has a recover-config that doesn't get replaced
        // it may repeatedly try to recover with this config
        recover.recover || (recover.recover = null);

        return recover;
    });

    addConfigTransform('timeout', 'Number', function timeoutTransform(timeout) {
        return (timeout > MIN_TIMEOUT ? timeout : MIN_TIMEOUT);
    });

    addConfigTransform('versionDir', STRING_CHECK, ensureEndsWithSlash);

    /**
     * @access public
     *
     * @constructor ModuleConfig
     *
     * @memberof JARS
     * @inner
     *
     * @param {JARS~Module} module
     * @param {Boolean} [isBundleConfig = false]
     * @param {JARS~ModuleConfig} [parentConfig]
     */
    function ModuleConfig(module, isBundleConfig, parentConfig) {
        var moduleConfig = this;

        moduleConfig._module = module;
        moduleConfig._isBundleConfig = isBundleConfig;
        moduleConfig._parentConfig = parentConfig;
        moduleConfig._options = parentConfig ? parentConfig.inheritOptions() : new ModuleConfigOptions();
        moduleConfig._defaultOptions = new ModuleConfigOptions();

        transformAndUpdateOptions(moduleConfig._defaultOptions, getDefaultOptions(module.name), module, isBundleConfig);
    }

    ModuleConfig.prototype = {
        /**
         * @access public
         *
         * @alias JARS~ModuleConfig
         *
         * @memberof JARS~ModuleConfig#
         */
        constructor: ModuleConfig,
        /**
         * @access public
         *
         * @memberof JARS~ModuleConfig#
{'fraction_non_alphanumeric': 0.10168618869867421, 'fraction_numerical': 0.0005148667782211353, 'mean_word_length': 2.7976539589442817, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '7531957', 'n_tokens_mistral': 2051, 'n_tokens_neox': 2022, 'n_words': 523}