<commit_before>/*global define*/
define([
    './defaultValue',
    './defined',
    './DeveloperError',
    './isArray'
    ], function(
        defaultValue,
        defined,
        DeveloperError,
        isArray) {
    'use strict';

    /**
     * Contains functions for checking that supplied arguments are of a specified type
     * or meet specified conditions
     * @private
     */
    var Check = {};

    /**
     * Contains type checking functions, all using the typeof operator
     */
    Check.typeOf = {};

    /**
     * Contains functions for checking numeric conditions such as minimum and maximum values
     */
    Check.numeric = {};

    function getUndefinedErrorMessage(name) {
        return defaultValue(name, 'A value') + ' was required but undefined.';
    }

    function getFailedTypeErrorMessage(actual, expected) {
        return 'Expected ' + expected + ', got ' + actual;
    }

    /**
     * Throws if test is not defined
     *
     * @param {*} test The value that is to be checked
     * @param {String} name The name of the variable being tested
     * @exception {DeveloperError} test must be defined
     */
    Check.defined = function (test, name) {
        if (!defined(test)) {
            throw new DeveloperError(getUndefinedErrorMessage(name));
        }
    };

    /**
     * Throws if test is not with range [minimum, maximum]
     *
     * @param {*} test The value to test
     * @param {Number} minimum The minimum allowed value
     * @param {Number} maximum The maximum allowed value
     * @exception {DeveloperError} test must be a number in the range [minimum, maximum]
     */
    Check.numeric.withinRange = function (test, minimum, maximum) {
        Check.typeOf.number(test);
        Check.typeOf.number(maximum);
        Check.typeOf.number(minimum);
        if (minimum > maximum) {
            throw new DeveloperError('Invalid condition: minimum (' + minimum + ') must be less than maximum (' + maximum + ')');
        }
        if (test > maximum || test < minimum) {
            throw new DeveloperError('Invalid argument: expected ' + test + ' to be in range [' + minimum + ', ' + maximum + ']');
        }
    };

    /**
     * Throws if test is greater than maximum
     *
     * @param {Number} test The value to test
     * @param {Number} maximum The maximum allowed value
     * @exception {DeveloperError} test must not be greater than maximum
     */
    Check.numeric.maximum = function (test, maximum) {<commit_msg>Remove currently unused withinRange function<commit_after>/*global define*/
define([
    './defaultValue',
    './defined',
    './DeveloperError',
    './isArray'
    ], function(
        defaultValue,
        defined,
        DeveloperError,
        isArray) {
    'use strict';

    /**
     * Contains functions for checking that supplied arguments are of a specified type
     * or meet specified conditions
     * @private
     */
    var Check = {};

    /**
     * Contains type checking functions, all using the typeof operator
     */
    Check.typeOf = {};

    /**
     * Contains functions for checking numeric conditions such as minimum and maximum values
     */
    Check.numeric = {};

    function getUndefinedErrorMessage(name) {
        return defaultValue(name, 'A value') + ' was required but undefined.';
    }

    function getFailedTypeErrorMessage(actual, expected) {
        return 'Expected ' + expected + ', got ' + actual;
    }

    /**
     * Throws if test is not defined
     *
     * @param {*} test The value that is to be checked
     * @param {String} name The name of the variable being tested
     * @exception {DeveloperError} test must be defined
     */
    Check.defined = function (test, name) {
        if (!defined(test)) {
            throw new DeveloperError(getUndefinedErrorMessage(name));
        }
    };

    /**
     * Throws if test is greater than maximum
     *
     * @param {Number} test The value to test
     * @param {Number} maximum The maximum allowed value
     * @exception {DeveloperError} test must not be greater than maximum
     */
    Check.numeric.maximum = function (test, maximum) {
{'fraction_non_alphanumeric': 0.10697115384615384, 'fraction_numerical': 0.0, 'mean_word_length': 2.3288, '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': 13, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4185255', 'n_tokens_mistral': 1107, 'n_tokens_neox': 1071, 'n_words': 381}