<commit_before>var _ = require('_');

module.exports = {
    hasClass: function(elem, name) {
        return elem.classList.contains(name);
    },

    addClasses: function(elem, names) {
        var len = names.length,
            idx = 0;
        for (; idx < len; idx++) {
            elem.classList.add.call(elem.classList, names[idx]);
        }
    },

    removeClasses: function(elem, names) {
        var len = names.length,
            idx = 0;
        for (; idx < len; idx++) {
            elem.classList.remove.call(elem.classList, names[idx]);
        }
    },

    toggleClasses: function(elem, names) {
        var len = names.length,
            idx = 0;
        for (; idx < len; idx++) {
            elem.classList.toggle.call(elem.classList, names[idx]);
        }
    }
};<commit_msg>Ignore nodes that don't have a classList property in classes-modern.js<commit_after>var _ = require('_');

module.exports = {
    hasClass: function(elem, name) {
        return !!elem.classList && elem.classList.contains(name);
    },

    addClasses: function(elem, names) {
        if (!elem.classList) { return; }

        var len = names.length,
            idx = 0;
        for (; idx < len; idx++) {
            elem.classList.add.call(elem.classList, names[idx]);
        }
    },

    removeClasses: function(elem, names) {
        if (!elem.classList) { return; }

        var len = names.length,
            idx = 0;
        for (; idx < len; idx++) {
            elem.classList.remove.call(elem.classList, names[idx]);
        }
    },

    toggleClasses: function(elem, names) {
        if (!elem.classList) { return; }

        var len = names.length,
            idx = 0;
        for (; idx < len; idx++) {
            elem.classList.toggle.call(elem.classList, names[idx]);
        }
    }
};
{'fraction_non_alphanumeric': 0.14616657473800332, 'fraction_numerical': 0.003309431880860452, 'mean_word_length': 1.870253164556962, 'pattern_counts': {'":': 0, '<': 9, '<?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': '3000385', 'n_tokens_mistral': 552, 'n_tokens_neox': 546, 'n_words': 119}