<commit_before>import calf from '../support/calf';
import createDocument from '../system/createDocument';
import displayUpgradeMsg from './displayUpgradeMsg';
import setValue from '../system/setValue';

function findDoc(data) {
  if (location.search.indexOf('cmd=points&type=1') === -1) {
    return createDocument(data);
  }
  document.querySelectorAll('#pCC input[name="quantity"]')[1].value = '10';
  return document;
}

function checkUpgrade(limit) {
  var checkDoneUpgrade = limit.textContent.split(' / ');
  if (checkDoneUpgrade[0] !== checkDoneUpgrade[1]) {
    displayUpgradeMsg();
    setValue('needToDoUpgrade', true);
  } else {
    setValue('needToDoUpgrade', false);
    setValue('lastUpgradeCheck',
      Date.parse(limit.nextElementSibling.textContent + ' GMT'));
  }
}

export default function parseGoldUpgrades(data) {
  if (!calf.enableUpgradeAlert) {return;}<commit_msg>auto-fill gold upgrades current stam #174<commit_after>import calf from '../support/calf';
import createDocument from '../system/createDocument';
import displayUpgradeMsg from './displayUpgradeMsg';
import setValue from '../system/setValue';

function findDoc(data) {
  if (location.search.indexOf('cmd=points&type=1') === -1) {
    return createDocument(data);
  }
  var boxes = document.querySelectorAll('#pCC input[name="quantity"]');
  boxes[0].value = '100';
  boxes[1].value = '10';
  return document;
}

function checkUpgrade(limit) {
  var checkDoneUpgrade = limit.textContent.split(' / ');
  if (checkDoneUpgrade[0] !== checkDoneUpgrade[1]) {
    displayUpgradeMsg();
    setValue('needToDoUpgrade', true);
  } else {
    setValue('needToDoUpgrade', false);
    setValue('lastUpgradeCheck',
      Date.parse(limit.nextElementSibling.textContent + ' GMT'));
  }
}

export default function parseGoldUpgrades(data) {
  if (!calf.enableUpgradeAlert) {return;}
{'fraction_non_alphanumeric': 0.15380464112250405, 'fraction_numerical': 0.011332973556395036, 'mean_word_length': 5.078688524590164, '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': '5442257', 'n_tokens_mistral': 585, 'n_tokens_neox': 577, 'n_words': 113}