<commit_before>'use strict';

/**
 * The controller that exposes the mountebank configuration for the running process
 * @module
 */

/**
 * Creates the config controller
 * @param {string} version - The version of the currently running process
 * @param {Object} options - The command line options used to start mb
 * @returns {Object}
 */
function create (version, options) {
    const helpers = require('../util/helpers'),
        publicOptions = helpers.clone(options);

    delete publicOptions.heroku;
    delete publicOptions.version;

    /**
     * The method that responds to GET /config
     * @memberOf module:controllers/configController#
     * @param {Object} request - The HTTP request
     * @param {Object} response - The HTTP response
     */
    function get (request, response) {
        const config = {
            version,
            options: publicOptions,
            process: {
                nodeVersion: process.version,
                architecture: process.arch,
                platform: process.platform,
                rss: process.memoryUsage().rss,
                heapTotal: process.memoryUsage().heapTotal,
                heapUsed: process.memoryUsage().heapUsed,
                uptime: process.uptime(),
                cwd: process.cwd()
            }
        };

        response.format({
            json: () => response.send(config),
            html: () => response.render('config', config)
        });
    }

    return { get };
}

module.exports = { create };
<commit_msg>Fixing broken build on some runs due to yargs change<commit_after>'use strict';

/**
 * The controller that exposes the mountebank configuration for the running process
 * @module
 */

/**
 * Creates the config controller
 * @param {string} version - The version of the currently running process
 * @param {Object} options - The command line options used to start mb
 * @returns {Object}
 */
function create (version, options) {
    const helpers = require('../util/helpers'),
        publicOptions = helpers.clone(options);

    delete publicOptions.heroku;
    delete publicOptions.version;

    // On some OS's, it duplicates camelCase as hypen-case (e.g. noParse and no-parse)
    // I assume this was a change in yargs at some point
    for (var prop in publicOptions) {
        if (prop.indexOf('-') > 0) {
            delete publicOptions[prop];
        }
    }

    /**
     * The method that responds to GET /config
     * @memberOf module:controllers/configController#
     * @param {Object} request - The HTTP request
     * @param {Object} response - The HTTP response
     */
    function get (request, response) {
        const config = {
            version,
            options: publicOptions,
            process: {
                nodeVersion: process.version,
                architecture: process.arch,
                platform: process.platform,
                rss: process.memoryUsage().rss,
                heapTotal: process.memoryUsage().heapTotal,
                heapUsed: process.memoryUsage().heapUsed,
                uptime: process.uptime(),
                cwd: process.cwd()
            }
        };

        response.format({
            json: () => response.send(config),
            html: () => response.render('config', config)
        });
    }

    return { get };
}

module.exports = { create };

{'fraction_non_alphanumeric': 0.10711097887533472, 'fraction_numerical': 0.0002975304968759298, 'mean_word_length': 2.0759377859103387, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '2214521', 'n_tokens_mistral': 875, 'n_tokens_neox': 840, 'n_words': 264}