<commit_before>'use strict';

const {
    OP_PREFIX,
    FN_DELIM,
    ARG_DELIM
} = require('./constants');

const { flag, hasFlag } = require('./flags');

const ConfigStore = require('./store/Config');
const ResultStore = require('./store/Result');
const SettingStore = require('./store/Setting');

const Operation = (targets, operations, operation, compConfig) => {
    const [ name, argString ] = operation.split(FN_DELIM);
    const key = name.replace(OP_PREFIX, '');
    const args = (argString || '').split(ARG_DELIM).filter(v => v != null);
    args.push({ targets, config: ConfigStore, result: ResultStore, setting: SettingStore, compConfig });
    const __fn__ = operations[key] || null;
    if (typeof __fn__ !== 'function') throw new Error(`unknown operation: ${key}`);
    if (hasFlag(__fn__, 'fn')) return __fn__(...args);
    const fn = () => __fn__(...args);
    flag(fn, operations[key].flag || 'op');
    return { name: operation, fn, __fn__, ns: key };
};

module.exports = Operation;<commit_msg>updating deps to bring in config binding fix<commit_after>'use strict';

const {
    OP_PREFIX,
    FN_DELIM,
    ARG_DELIM
} = require('./constants');

const { flag, hasFlag } = require('./flags');

const ConfigStore = require('./store/Config');
const ResultStore = require('./store/Result');
const SettingStore = require('./store/Setting');

const Operation = (targets, operations, operation, compConfig) => {
    const [ name, argString ] = operation.split(FN_DELIM);
    const key = name.replace(OP_PREFIX, '');
    const args = (argString || '').split(ARG_DELIM).filter(v => v != null);
    args.push({ targets, config: ConfigStore, result: ResultStore, setting: SettingStore, compConfig });
    const __fn__ = operations[key] || null;
    if (typeof __fn__ !== 'function') throw new Error(`unknown operation: ${key}`);
    if (hasFlag(__fn__, 'fn')) return __fn__(...args);
    const fn = () => __fn__(...args);
    if (hasFlag(__fn__, 'binding')) flag(fn, 'binding');
    flag(fn, 'op');
    return { name: operation, fn, __fn__, ns: key };
};

module.exports = Operation;
{'fraction_non_alphanumeric': 0.17765042979942694, 'fraction_numerical': 0.0, 'mean_word_length': 4.1600985221674875, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '5583798', 'n_tokens_mistral': 643, 'n_tokens_neox': 631, 'n_words': 172}