<commit_before>(function(document) {
  'use strict';

  console.info("Firing the Trumpoon");

  const walker = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT, null, false);
  const drumfMatcher = /(Donald )?((J\.|John) )?Trump/g;
  const ALT_NAMES = [
    "<NAME>",
    "<NAME>",
    "Apricot Pol Pot",
    "Orange Julius",
    "<NAME>",
    "The Yamchurian Candidate"
  ];

  while (walker.nextNode()) {
    walker.currentNode.nodeValue = walker.currentNode.nodeValue
        .replace(drumfMatcher, ()=>{
          return ALT_NAMES[Math.floor(Math.random() * ALT_NAMES.length)];
        });
  }
})(document);<commit_msg>More concise<commit_after>(function(document) {
  'use strict';

  console.info("Firing the Trumpoon");

  const walker = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT, null, false);
  const drumfMatcher = /(Donald )?((J\.|John) )?Trump/g;
  const ALT_NAMES = [
    "<NAME>",
    "Pumpkin Pinochet",
    "Apricot Pol Pot",
    "Orange Julius",
    "<NAME>",
    "The Yamchurian Candidate"
  ];

  while (walker.nextNode()) {
    walker.currentNode.nodeValue = walker.currentNode.nodeValue
        .replace(drumfMatcher, ()=> ALT_NAMES[Math.floor(Math.random() * ALT_NAMES.length)]);
  }
})(document);
{'fraction_non_alphanumeric': 0.16693290734824281, 'fraction_numerical': 0.0, 'mean_word_length': 3.76425855513308, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 10, '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': '6362082', 'n_tokens_mistral': 451, 'n_tokens_neox': 430, 'n_words': 78}