<commit_before><commit_msg>initial JS lib commit<commit_after>(function () {
    "use strict";

    function validateInput(w, r) {
        w = Number(w);
        r = Number(r);

        return (w > 0 && r > 0 && r <= 10);
    }

    function calculate(w, r, f) {
        if (validateInput(w, r)) {
            return f(w, r).toFixed(2);
        }

        return -1;
    }

    function brzycki(w, r) {
        return (w * 36) / (37 - r);
    }

    function epley(w, r) {
        return w * (1 + (r / 30));
    }

    function lander(w, r) {
        return (100 * w) / (101.3 - (2.67123 * r));
    }

    function lombardi(w, r) {
        return w * Math.pow(r, 0.10);
    }

    function mayhew(w, r) {
        return (100 * w) / (52.2 + (41.9 * Math.pow(Math.E, (-0.055 * r))));
    }

    function oconner(w, r) {
        return w * (1 + (0.025 * r));
    }

    function wathen(w, r) {
        return (100 * w) / (48.8 + (53.8 * Math.pow(Math.E, (-0.075 * r))));
    }

    function average(w, r) {
        return (brzycki(w, r) + epley(w, r) + lander(w, r) + lombardi(w, r) + mayhew(w, r) + oconner(w, r) + wathen(w, r)) / 7;
    }

    function all(w, r) {
        var allOneRepMaxes = {};

        if (validateInput(w, r)) {
            all.average = calculate(w, r, average);
            all.brzycki = calculate(w, r, brzycki);
            all.epley = calculate(w, r, epley);
            all.lander = calculate(w, r, lander);
            all.lombardi = calculate(w, r, lombardi);
            all.mayhew = calculate(w, r, mayhew);
            all.oconner = calculate(w, r, oconner);
            all.wathen = calculate(w, r, wathen);
        }

        return allOneRepMaxes;
    }

    window.OneRepMax = {
        all: function (weight, reps) {
            return all(weight, reps);
        },
        average: function (weight, reps) {
            return calculate(weight, reps, average);
        },
        brzycki: function (weight, reps) {
            return calculate(weight, reps, brzycki);
        },
        epley: function (weight, reps) {
            return calculate(weight, reps, epley);
        },
        lander: function (weight, reps) {
            return calculate(weight, reps, lander);
        },
        lombardi: function (weight, reps) {
            return calculate(weight, reps, lombardi);
        },
        mayhew: function (weight, reps) {
            return calculate(weight, reps, mayhew);
        },
        oconner: function (weight, reps) {
            return calculate(weight, reps, oconner);
        },
        wathen: function (weight, reps) {
            return calculate(weight, reps, wathen);
        }
    };
}());
{'fraction_non_alphanumeric': 0.15401953418482345, 'fraction_numerical': 0.02291510142749812, 'mean_word_length': 1.7145769622833844, 'pattern_counts': {'":': 0, '<': 4, '<?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': '3699850', 'n_tokens_mistral': 968, 'n_tokens_neox': 888, 'n_words': 227}