<commit_before>let ellipsisIntervals = {};
let tempId = 0;

export default {
  start: function(elementOrId, durationBetween, maxEllipsis) {
    var elementId;
    var element;
    var text;
    var count = 0;
    var max = maxEllipsis || 5;
    var duration = durationBetween || 200;

    if (typeof elementOrId === 'string') {
      elementId = elementOrId;
      element = document.getElementById(elementId);
    } else {
      element = elementOrId;
      if (element.id) {
        elementId = element.id;
      } else {
        elementId = element.id = 'temp-' + tempId++;
      }
    }

    text = element.innerText;

    ellipsisIntervals[elementId] = setInterval(function() {
      var displayText = text;
      count++;
      if (count > max) count = 0;
      for (let i = 0; i < count; i++) displayText += '.';
      element.innerText = displayText;
    }, duration);
  },

  stop: function(elementOrId) {
    var elementId = typeof elementOrId === 'string' ? elementOrId : elementOrId.id;
    clearInterval(ellipsisIntervals[elementId]);
  }
};<commit_msg>Favor let vs. var in dynamicEllipsis.js<commit_after>let ellipsisIntervals = {};
let tempId = 0;

export default {
  start: function(elementOrId, durationBetween, maxEllipsis) {
    let elementId;
    let element;
    let text;
    let count = 0;
    let max = maxEllipsis || 5;
    let duration = durationBetween || 200;

    if (typeof elementOrId === 'string') {
      elementId = elementOrId;
      element = document.getElementById(elementId);
    } else {
      element = elementOrId;
      if (element.id) {
        elementId = element.id;
      } else {
        elementId = element.id = 'temp-' + tempId++;
      }
    }

    text = element.innerText;

    ellipsisIntervals[elementId] = setInterval(function() {
      let displayText = text;
      count++;
      if (count > max) count = 0;
      for (let i = 0; i < count; i++) displayText += '.';
      element.innerText = displayText;
    }, duration);
  },

  stop: function(elementOrId) {
    let elementId = typeof elementOrId === 'string' ? elementOrId : elementOrId.id;
    clearInterval(ellipsisIntervals[elementId]);
  }
};
{'fraction_non_alphanumeric': 0.12511584800741427, 'fraction_numerical': 0.0074142724745134385, 'mean_word_length': 2.709621993127148, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3298115', 'n_tokens_mistral': 702, 'n_tokens_neox': 668, 'n_words': 169}