<commit_before>'use strict';

/**
 *
 */
var bind = 'addEventListener',
    unbind = 'removeEventListener',
    touchesSupported = 'createTouch' in window.document,
    msPointerSupported = window.navigator.msPointerEnabled,
    touch = {
      'start': msPointerSupported ? 'MSPointerDown' : 'touchstart',
      'move': msPointerSupported ? 'MSPointerMove' : 'touchmove',
      'end': msPointerSupported ? 'MSPointerUp' : 'touchend'
    },
    pointerCanceled = false;

if (touchesSupported) {
  document[bind](touch.start, function() { pointerCanceled = false; }, false);
  document[bind](touch.move, function() { pointerCanceled = true; }, false);
}

/**
 *
 */
function clicktap(el, listener, capture) {

  function fn(eve) {
    if (pointerCanceled) { pointerCanceled = false; return; }
    listener.call(el, eve);
    eve.preventDefault();
  }

  listener.fn = fn;

  el[bind](touch.end, listener.fn, capture || false);
  el[bind]('click', listener.fn, capture || false);

  return clicktap;
}

/**
 *
 */
clicktap.on = clicktap;

/**
 *
 */
clicktap.off = function(el, listener) {
  el[unbind](prefix + touch.end, listener.fn);
  el[unbind](prefix + 'click', listener.fn);
  return clicktap;
};

/**
 * Expose clicktap
 */
module.exports = clicktap;<commit_msg>Remove unused prefix variable.<commit_after>'use strict';

/**
 * Scopped variables
 */
var bind = 'addEventListener',
    unbind = 'removeEventListener',
    touchesSupported = 'createTouch' in window.document,
    msPointerSupported = window.navigator.msPointerEnabled,
    touch = {
      'start': msPointerSupported ? 'MSPointerDown' : 'touchstart',
      'move': msPointerSupported ? 'MSPointerMove' : 'touchmove',
      'end': msPointerSupported ? 'MSPointerUp' : 'touchend'
    },
    pointerCanceled = false;

if (touchesSupported) {
  document[bind](touch.start, function() { pointerCanceled = false; }, false);
  document[bind](touch.move, function() { pointerCanceled = true; }, false);
}

/**
 * Adds a listener to the collection for a specified event.
 * @public
 * @function
 * @name clicktap#on
 * @param {String} el - DOM element.
 * @param {Function} listener - Listener function.
 * @param {Boolean} capture - Indicate if use capture path.
 * @example
 * var startDoingStuff = function (event, param1, param2, ...) {
 *   // Some code here!
 * };
 *
 * clicktap.on(document, startDoingStuff);
 */
function clicktap(el, listener, capture) {

  function fn(eve) {
    if (pointerCanceled) { pointerCanceled = false; return; }
    listener.call(el, eve);
    eve.preventDefault();
  }

  listener.fn = fn;

  el[bind](touch.end, listener.fn, capture || false);
  el[bind]('click', listener.fn, capture || false);

  return clicktap;
}

/**
 * Adds a listener to the collection for a specified event.
 * @public
 * @function
 * @name clicktap#on
 * @param {String} el - DOM element.
 * @param {Function} listener - Listener function.
 * @param {Boolean} capture - Indicate if use capture path.
 * @example
 * var startDoingStuff = function (event, param1, param2, ...) {
 *   // Some code here!
 * };
 *
 * clicktap.on(document, startDoingStuff);
 */
clicktap.on = clicktap;

/**
 * Removes a listener from the collection for a specified event.
 * @public
 * @function
 * @name clicktap#on
 * @param {String} el - DOM element.
 * @param {Function} listener = Listener function.
 * @returns itself
 * @example
 * clicktap.off(document, startDoingStuff);
 */
clicktap.off = function(el, listener) {
  el[unbind](touch.end, listener.fn);
  el[unbind]('click', listener.fn);
  return clicktap;
};

/**
 * Expose clicktap
 */
module.exports = clicktap;
{'fraction_non_alphanumeric': 0.1512813447230642, 'fraction_numerical': 0.0011022320198401765, 'mean_word_length': 3.80794701986755, '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': '3029495', 'n_tokens_mistral': 1171, 'n_tokens_neox': 1151, 'n_words': 285}