<commit_before>'use strict';

const _ = require('lodash');

const optionKeys = ['files', 'defaults', 'disable', 'env', 'argv',
    'customWorkflow', 'required', 'overrides', 'defer',
    'parse', 'transform', 'normalize', 'separator', 'async', 'shortstop'];

module.exports = function extendWithFluentBuilder(Configue) {

    Configue._options = {};
    optionKeys.forEach((option) => {
        Configue[option] = (opt) => {
            Configue._options[option] = opt;
            return Configue;
        };
    });
    ['first', 'overrides', 'argv', 'env', 'files', 'defaults'].forEach((hook) => {
        Configue[hook + 'Hook'] = (opt) => {
            _.set(Configue._options, `postHooks.${hook}`, opt);
            return Configue;
        };
    });
    Configue.get = () => {
        const options = Configue._options;
        Configue._options = {};
        return new Configue(options);
    };
    Configue.resolve = () => {
        Configue._options.async = true;
        const configue = Configue.get();
        return configue.resolve();
    };
    return Configue;
};
<commit_msg>feature: introduce a withOptions method on fluentBuilder<commit_after>'use strict';

const _ = require('lodash');

const optionKeys = ['files', 'defaults', 'disable', 'env', 'argv',
    'customWorkflow', 'required', 'overrides', 'defer',
    'parse', 'transform', 'normalize', 'separator', 'async', 'shortstop'];

module.exports = function extendWithFluentBuilder(Configue) {

    Configue._options = {};
    optionKeys.forEach((option) => {
        Configue[option] = (opt) => {
            Configue._options[option] = opt;
            return Configue;
        };
    });
    ['first', 'overrides', 'argv', 'env', 'files', 'defaults'].forEach((hook) => {
        Configue[hook + 'Hook'] = (opt) => {
            _.set(Configue._options, `postHooks.${hook}`, opt);
            return Configue;
        };
    });
    Configue.withOptions = (options) => {
        _.assign(Configue._options, options);
        return Configue;
    };
    Configue.get = () => {
        const options = Configue._options;
        Configue._options = {};
        return new Configue(options);
    };
    Configue.resolve = () => {
        Configue._options.async = true;
        const configue = Configue.get();
        return configue.resolve();
    };
    return Configue;
};

{'fraction_non_alphanumeric': 0.17467063323416915, 'fraction_numerical': 0.0, 'mean_word_length': 2.6666666666666665, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 16, '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': '2451086', 'n_tokens_mistral': 695, 'n_tokens_neox': 692, 'n_words': 140}