<commit_before>Backbone.Validation = (function(Backbone, _) {
    var builtinValidators = {
        required: function(value, attr, msg) {
            if (_.isNull(value) || _.isUndefined(value) || (_.isString(value) && value.trim() === '')) {
                return msg || attr + ' is required';
            }
        },
        min: function(value, attr, msg, minValue) {
            if(value < minValue) {
                return msg || attr + ' must be equal to or larger than ' + minValue;
            }
        },
        max: function(value, attr, msg, maxValue) {
            if(value > maxValue) {
                return msg || attr + ' must be equal to or less than ' + maxValue;
            }
        }
    };

    var getValidators = function(view, attr) {
        var validation = view.model.validation[attr];

        if (_.isFunction(validation)) {
            return validation;
        } else {
            var valdations = [];
            for(attr in validation) {
                if(attr !== 'msg' && validation.hasOwnProperty(attr)) {<commit_msg>Replaced trim with jQuery's since IE does not implement it<commit_after>Backbone.Validation = (function(Backbone, _) {
    var builtinValidators = {
        required: function(value, attr, msg) {
            if (_.isNull(value) || _.isUndefined(value) || (_.isString(value) && $.trim(value) === '')) {
                return msg || attr + ' is required';
            }
        },
        min: function(value, attr, msg, minValue) {
            if(value < minValue) {
                return msg || attr + ' must be equal to or larger than ' + minValue;
            }
        },
        max: function(value, attr, msg, maxValue) {
            if(value > maxValue) {
                return msg || attr + ' must be equal to or less than ' + maxValue;
            }
        }
    };

    var getValidators = function(view, attr) {
        var validation = view.model.validation[attr];

        if (_.isFunction(validation)) {
            return validation;
        } else {
            var valdations = [];
            for(attr in validation) {
                if(attr !== 'msg' && validation.hasOwnProperty(attr)) {
{'fraction_non_alphanumeric': 0.12775735294117646, 'fraction_numerical': 0.0, 'mean_word_length': 1.7556962025316456, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3587490', 'n_tokens_mistral': 599, 'n_tokens_neox': 586, 'n_words': 157}