<commit_before>import {getElementById} from '../common/getElement';
import insertElement from '../common/insertElement';
import insertTextBeforeEnd from '../common/insertTextBeforeEnd';
import {sendEvent} from '../support/fshGa';
import unequipitem from '../app/profile/unequipitem';
import {createButton, createDiv} from '../common/cElement';

var profileCombatSetDiv;

function getNekid() {
  sendEvent('profile', 'nekidBtn');
  var profileBlock = profileCombatSetDiv.nextElementSibling;
  var aLinks = profileBlock.getElementsByTagName('a');
  Array.prototype.forEach.call(aLinks, function(link) {
    var item = /inventory_id=(\d+)/.exec(link.href)[1];
    if (item) {
      unequipitem(item).done(function(json) {
        if (json.s) {link.parentNode.innerHTML = '';}
      });
    }
  });
}

export default function nekidBtn() {
  var profileRightColumn = getElementById('profileRightColumn');
  profileCombatSetDiv = getElementById('profileCombatSetDiv');<commit_msg>reduce block nesting in nekidBtn<commit_after>import {getElementById} from '../common/getElement';
import insertElement from '../common/insertElement';
import insertTextBeforeEnd from '../common/insertTextBeforeEnd';
import {sendEvent} from '../support/fshGa';
import unequipitem from '../app/profile/unequipitem';
import {createButton, createDiv} from '../common/cElement';

var profileCombatSetDiv;

function removeItem(link) {
  function clearBox(json) {
    if (json.s) {
      link.parentNode.innerHTML = '';
    }
  }
  var item = /inventory_id=(\d+)/.exec(link.href)[1];
  if (item) {
    unequipitem(item).done(clearBox);
  }
}

function getNekid() {
  sendEvent('profile', 'nekidBtn');
  var profileBlock = profileCombatSetDiv.nextElementSibling;
  var aLinks = profileBlock.getElementsByTagName('a');
  Array.prototype.forEach.call(aLinks, removeItem);
}

export default function nekidBtn() {
  var profileRightColumn = getElementById('profileRightColumn');
  profileCombatSetDiv = getElementById('profileCombatSetDiv');
{'fraction_non_alphanumeric': 0.14171656686626746, 'fraction_numerical': 0.000998003992015968, 'mean_word_length': 5.1503067484662575, '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': '498749', 'n_tokens_mistral': 610, 'n_tokens_neox': 607, 'n_words': 121}