<commit_before>(function (global, factory) {
  if (typeof define === "function" && define.amd) {
    define(['exports'], factory);
  } else if (typeof exports !== "undefined") {
    factory(exports);
  } else {
    var mod = {
      exports: {}
    };
    factory(mod.exports);
    global.jouter = mod.exports;
  }
})(this, function (exports) {
  'use strict';

  Object.defineProperty(exports, "__esModule", {
    value: true
  });

  var _extends = Object.assign || function (target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = arguments[i];

      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }

    return target;
  };

  function _toConsumableArray(arr) {
    if (Array.isArray(arr)) {
      for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {
        arr2[i] = arr[i];
      }

      return arr2;
    } else {
      return Array.from(arr);
    }
  }

  var TOKEN_RE = /:[^\/]+/g;
  var ANY_RE = /\*/g;
  var SUBPATH_RE = /\/\.\.\./g;

  var regexify = function regexify(x) {
    return x.replace(TOKEN_RE, '([^/]+)').replace(ANY_RE, '.*').replace(SUBPATH_RE, '(\/.*)');
  };

  // parseRoute :: String | RegExp -> RegExp
  var routeRe = function routeRe(x) {
    return x instanceof RegExp ? new RegExp(x.source) : new RegExp('^' + regexify(x) + '$');
  };

  // route ::  (* -> *), String -> (String -> _)
  var route = function route(f, r) {
    var re = routeRe(r);
    return function (path) {
      var match = re.exec(path);
      if (!match) return;
      f.apply(undefined, _toConsumableArray(match.slice(1)));
    };
  };

  // Unsafe functions
  var pathHandler = {
    // get :: _ -> String
    get: function get() {
      return window.location.pathname;
    },

    // set :: (String, String) -> _
    set: function set(path, title) {
      return window.history.pushState(undefined, title, path);
    },

    // listen :: (* -> *) -> _
    listen: function listen(f) {
      return window.onpopstate = f;
    },

    // decorate :: (* -> *) -> (* -> *)
    decorate: function decorate(f) {
      return f;
    }
  };

  var createRouter = exports.createRouter = function createRouter() {
    var myPathHandler = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

    var routes = [];
    var path = _extends({}, pathHandler, myPathHandler);

    var add = function add(f, r) {
      return routes.push(route(path.decorate(f), r));
    };

    var dispatch = function dispatch(p) {
      return routes.forEach(function (f) {
        return f(p);
      });
    };

    var go = function go(p, t) {
      path.set(p, t);
      dispatch(path.get());
    };

    var handleEvent = function handleEvent(e) {
      e.preventDefault();
      go(e.target.href, e.target.title);<commit_msg>Update dist<commit_after>(function (global, factory) {
  if (typeof define === "function" && define.amd) {
    define(['exports'], factory);
  } else if (typeof exports !== "undefined") {
    factory(exports);
  } else {
    var mod = {
      exports: {}
    };
    factory(mod.exports);
    global.jouter = mod.exports;
  }
})(this, function (exports) {
  'use strict';

  Object.defineProperty(exports, "__esModule", {
    value: true
  });

  var _extends = Object.assign || function (target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = arguments[i];

      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }

    return target;
  };

  function _toConsumableArray(arr) {
    if (Array.isArray(arr)) {
      for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {
        arr2[i] = arr[i];
      }

      return arr2;
    } else {
      return Array.from(arr);
    }
  }

  var TOKEN_RE = /:[^\/]+/g;
  var ANY_RE = /\*/g;
  var SUBPATH_RE = /\/\.\.\./g;

  var regexify = function regexify(x) {
    return x.replace(TOKEN_RE, '([^/]+)').replace(ANY_RE, '.*').replace(SUBPATH_RE, '(\/.*)');
  };

  // parseRoute :: String | RegExp -> RegExp
  var routeRe = function routeRe(x) {
    return x instanceof RegExp ? new RegExp(x.source) : new RegExp('^' + regexify(x) + '$');
  };

  // route ::  (* -> *), String -> (String -> _)
  var route = function route(f, r) {
    var re = routeRe(r);
    return function (path) {
      var match = re.exec(path);
      if (!match) return;
      f.apply(undefined, _toConsumableArray(match.slice(1)));
      return true;
    };
  };

  // Unsafe functions
  var pathHandler = {
    // get :: _ -> String
    get: function get() {
      return window.location.pathname;
    },

    // set :: (String, String) -> _
    set: function set(path, title) {
      return window.history.pushState(undefined, title, path);
    },

    // listen :: (* -> *) -> _
    listen: function listen(f) {
      return window.onpopstate = f;
    },

    // decorate :: (* -> *) -> (* -> *)
    decorate: function decorate(f) {
      return f;
    },

    // onNoMatch :: (String -> _) -> _
    onNoMatch: function onNoMatch(f) {
      return undefined;
    }
  };

  var createRouter = exports.createRouter = function createRouter() {
    var myPathHandler = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

    var routes = [];
    var path = _extends({}, pathHandler, myPathHandler);

    var add = function add(f, r) {
      return routes.push(route(path.decorate(f), r));
    };

    var dispatch = function dispatch(p) {
      var hadMatch = routes.reduce(function (result, f) {
        var match = f(p);
        return result || match;
      }, false);
      if (!hadMatch) path.onNoMatch(p);
      return hadMatch;
    };

    var go = function go(p, t) {
      path.set(p, t);
      dispatch(path.get());
    };

    var handleEvent = function handleEvent(e) {
      e.preventDefault();
      go(e.target.href, e.target.title);
{'fraction_non_alphanumeric': 0.17505433873934126, 'fraction_numerical': 0.0030095301788998496, 'mean_word_length': 2.3418994413407823, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 29, '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': '2170414', 'n_tokens_mistral': 2011, 'n_tokens_neox': 1971, 'n_words': 463}