<commit_before>(function(jsGrid, $, undefined) {
    
    var sortStrategies = {
        string: function(str1, str2) {
            return str1.localeCompare(str2);
        },

        number: function(n1, n2) {
            return n1 - n2;
        },

        date: function(dt1, dt2) {
            return dt1 - dt2;
        },
        
        numberAsString: function(n1, n2) {
            return parseFloat(n1) - parseFloat(n2);
        }
    };

    jsGrid.sortStrategies = sortStrategies;
    
}(jsGrid, jQuery));<commit_msg>sort strategy more robust<commit_after>(function (jsGrid, $, undefined) {

	var sortStrategies = {
		string: function (str1, str2) {
			if ((typeof (str1) == 'undefined' || str1 == null) && (typeof (str2) == 'undefined' || str2 == null))
				return 0;

			if (typeof (str1) == 'undefined' || str1 == null)
				return -1;

			if (typeof (str2) == 'undefined' || str2 == null)
				return 1;

			return str1.localeCompare(str2);
		},

		number: function (n1, n2) {
			return n1 - n2;
		},

		date: function (dt1, dt2) {
			return dt1 - dt2;
		},

		numberAsString: function (n1, n2) {
			return parseFloat(n1) - parseFloat(n2);
		}
	};

	jsGrid.sortStrategies = sortStrategies;

}(jsGrid, jQuery));
{'fraction_non_alphanumeric': 0.15020408163265306, 'fraction_numerical': 0.03510204081632653, 'mean_word_length': 2.3774104683195594, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5260819', 'n_tokens_mistral': 471, 'n_tokens_neox': 426, 'n_words': 98}