<commit_before>module.exports = {
    sanitizeQuery: function(query, options) {
        if (options.defaults.take && !query.take) {
            query.take = options.defaults.take;
        }
        if (options.maxTake < query.take) {
            query.take = options.maxTake;
        }

        if (typeof query.reverse === 'string') {
            query.reverse = query.reverse.toLowerCase() === 'true';
        }

        if (typeof options.defaults.reverse === 'undefined') {
            query.reverse = options.defaults.reverse;
        }

        return query;
    }
};<commit_msg>Fixed sanitizeQuery method<commit_after>module.exports = {
    sanitizeQuery: function(query, options) {
        if (options.defaults.take && !query.take) {
            query.take = options.defaults.take;
        }
        if (options.maxTake < query.take) {
            query.take = options.maxTake;
        }

        if (typeof query.reverse === 'string') {
            query.reverse = query.reverse.toLowerCase() === 'true';
        }

        if (typeof query.reverse === 'undefined') {
            query.reverse = options.defaults.reverse;
        }

        return query;
    }
};
{'fraction_non_alphanumeric': 0.13395904436860068, 'fraction_numerical': 0.0, 'mean_word_length': 1.9034653465346534, 'pattern_counts': {'":': 0, '<': 5, '<?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': '307922', 'n_tokens_mistral': 323, 'n_tokens_neox': 322, 'n_words': 60}