<commit_before>var errors = require('./errors')

module.exports = function callbackTimeout (f, t, e) {
  if (!t) return f
  var timer = setTimeout(onTimeout, t)
  return callback

  function onTimeout () {
    clearTimeout(timer)
    timer = null
    var msg = e || 'timeout of ' +
      t + 'ms exceeded for callback ' +
      (f.name || 'anonymous')
    f.call(f, new errors.TimeoutError(msg))
  }

  function callback () {
    if (timer) {
      clearTimeout(timer)
      f.apply(f, arguments)<commit_msg>Remove unnecessary clearTimeout. Closes #7<commit_after>var errors = require('./errors')

module.exports = function callbackTimeout (f, t, e) {
  if (!t) return f
  var timer = setTimeout(onTimeout, t)
  return callback

  function onTimeout () {
    timer = null
    var msg = e || 'timeout of ' +
      t + 'ms exceeded for callback ' +
      (f.name || 'anonymous')
    f.call(f, new errors.TimeoutError(msg))
  }

  function callback () {
    if (timer) {
      clearTimeout(timer)
      f.apply(f, arguments)
{'fraction_non_alphanumeric': 0.13124387855044076, 'fraction_numerical': 0.0009794319294809011, 'mean_word_length': 2.9157088122605366, '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': '2506461', 'n_tokens_mistral': 324, 'n_tokens_neox': 318, 'n_words': 94}