<commit_before>module.exports = function(tagName, attributes = {}, children = []) {
  var element = document.createElement(tagName);
  if (attributes instanceof Array || typeof attributes == "string") {
    children = attributes;
    attributes = {};
  }
  for (var attr in attributes) {
    var value = attributes[attr];
    element.setAttribute(attr, value);
  }
  if (typeof children == "string") {
    element.innerHTML = children;
  } else {
    children.forEach(c => element.appendChild(c));
  }
  return element;
};<commit_msg>DOM can automatically add classes now<commit_after>module.exports = function(tagName, attributes = {}, children = []) {
  var parser = /^([^.]+)(\.[\.\w-]+)?/gi;
  var [_, tag, classes] = parser.exec(tagName);
  var element = document.createElement(tag);
  if (attributes instanceof Array || typeof attributes == "string") {
    children = attributes;
    attributes = {};
  }
  if (classes) {
    attributes["class"] = classes.split(".").join(" ").trim();
  }
  for (var attr in attributes) {
    var value = attributes[attr];
    element.setAttribute(attr, value);
  }
  if (typeof children == "string") {
    element.innerHTML = children;
  } else {
    children.forEach(c => element.appendChild(c));
  }
  return element;
};
{'fraction_non_alphanumeric': 0.16402535657686212, 'fraction_numerical': 0.0, 'mean_word_length': 3.6777777777777776, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1422442', 'n_tokens_mistral': 366, 'n_tokens_neox': 364, 'n_words': 93}