<commit_before>import { FromToValueCriterion } from "./from-to-value-criterion";

export function createFromToValueCriterion<T extends number | string>(
    values: [T | undefined, T | undefined],
    inclusive: boolean | [boolean] | [boolean, boolean] = true
): FromToValueCriterion {
    if (typeof inclusive === "boolean") {
        inclusive = [inclusive, inclusive];
    } else if (inclusive.length === 1) {
        inclusive = [inclusive[0], true];
    }

    const criterion: FromToValueCriterion = { op: "from-to" };

    if (values[0] !== void 0) {
        criterion.from = {
            op: inclusive[0] ? ">=" : ">",
            value: values[0],
        };
    }

    if (values[1] !== void 0) {
        criterion.to = {
            op: inclusive[1] ? "<=" : "<",
            value: values[1],
        };<commit_msg>health(criteria): #51 remove unused arg type for create from-to<commit_after>import { FromToValueCriterion } from "./from-to-value-criterion";

export function createFromToValueCriterion<T extends number | string>(
    values: [T | undefined, T | undefined],
    inclusive: boolean | [boolean, boolean] = true
): FromToValueCriterion {
    if (typeof inclusive === "boolean") {
        inclusive = [inclusive, inclusive];
    }

    const criterion: FromToValueCriterion = { op: "from-to" };

    if (values[0] !== void 0) {
        criterion.from = {
            op: inclusive[0] ? ">=" : ">",
            value: values[0],
        };
    }

    if (values[1] !== void 0) {
        criterion.to = {
            op: inclusive[1] ? "<=" : "<",
            value: values[1],
        };
{'fraction_non_alphanumeric': 0.159528243327126, 'fraction_numerical': 0.012414649286157667, 'mean_word_length': 2.429787234042553, 'pattern_counts': {'":': 0, '<': 9, '<?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': '4556638', 'n_tokens_mistral': 494, 'n_tokens_neox': 484, 'n_words': 118}