### shouldCallPushState Checks if a route is matched, if one is, returns true
320309
function(node, event) {
		if (!(event.isDefaultPrevented ? event.isDefaultPrevented() : event.defaultPrevented === true)) {
			// If href has some JavaScript in it, let it run.
			if (node.href === "javascript://") {
				return;
			}

			// Do not pushstate if target is for blank window.
			if (node.target === "_blank") {
				return;
			}

			// Do not pushstate if meta key was pressed, mimicking standard browser behavior.
			if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) {
				return;
			}

			// linksHost is a Fix for IE showing blank host, but blank host means current host.
			var linksHost = node.host || window.location.host;

			// If link is within the same domain and descendant of `root`.
			if (window.location.host === linksHost) {
				var root = cleanRoot(),
					pathname,
					href,
					nodePathWithSearch;

				if (node instanceof HTMLAnchorElement) {
					pathname = node.pathname;
					href = node.href;
					nodePathWithSearch = pathname + node.search;
				} else if (node.namespaceURI === "http://www.w3.org/1999/xlink") {
					pathname = href = node.getAttributeNS("http://www.w3.org/1999/xlink", "href");
					nodePathWithSearch = href;
				}

				// If the link is within the `root`.
				if (pathname !== undefined && pathname.indexOf(root) === 0) {
					var url = nodePathWithSearch.substr(root.length);

					// If a matching route exists.
					if (route.rule(url) !== undefined) {
						// Makes it possible to have a link with a hash.
						// Calling .pushState will dispatch events, causing
						// `can-route` to update its data, and then try to set back
						// the url without the hash.  We need to retain that.
						if (href.indexOf("#") >= 0) {
							this.keepHash = true;
						}

						// We do not want to call preventDefault() if the link is to the
						// same page and just a different hash; see can-route-pushstate#75.
						var windowPathWithSearch = window.location.pathname + window.location.search;
						var shouldCallPreventDefault = nodePathWithSearch !== windowPathWithSearch || node.hash === window.location.hash;

						// Test if you can preventDefault.
						if (shouldCallPreventDefault && event.preventDefault) {
							event.preventDefault();
						}
						return true;
					}
					return false;
				}
			}
		}
	}
119188
private function _getRouteMatch($path,$routes)
	{
		foreach ($routes as $route)
		{
			if ($match = $route->getMatch($path, $this->metadata($route->getName())))
				return $match;
		}
		return false;
	}
1085804
protected function matchDirect()
    {
        // Create variable used to keep track on progress
        $endpoint = false;

        // check without a trailing slash
        if (isset($this->routes[$this->requestUri])) {
            $endpoint = $this->routes[$this->requestUri];
        } else {
            // no match return false
            return false;
        }

        // check if endpoint class exists
        if (!$this->endpointExists($endpoint)) {
            throw new NotFound();
        } elseif (!$this->endpointMethodExists($endpoint, $this->requestMethod)) {
            // route found but method can't be found
            throw new MethodNotAllowed();
        }

        // found a direct match, set needed properties
        $this->matchedRoute = $this->requestUri;
        $this->matchedEndpoint = $endpoint;
        $this->matchedMethod = $this->requestMethod;

        // we found our match, stop looking for more
        return true;
    }
1276675
public function matches(Route $route, Request $request)
    {
        /** @var \LaraPress\Routing\Route $route */
        return $route->wordpressConditional() == null || call_user_func($route->wordpressConditional(), $route->uri());
    }
1364050
function isActive(_ref, indexOnly, currentLocation, routes, params) {
  var pathname = _ref.pathname;
  var query = _ref.query;

  if (currentLocation == null) return false;

  // TODO: This is a bit ugly. It keeps around support for treating pathnames
  // without preceding slashes as absolute paths, but possibly also works
  // around the same quirks with basenames as in matchRoutes.
  if (pathname.charAt(0) !== '/') {
    pathname = '/' + pathname;
  }

  if (!pathIsActive(pathname, currentLocation.pathname)) {
    // The path check is necessary and sufficient for indexOnly, but otherwise
    // we still need to check the routes.
    if (indexOnly || !routeIsActive(pathname, routes, params)) {
      return false;
    }
  }

  return queryIsActive(query, currentLocation.query);
}
1154540
function call(handle, route, err, req, res, next) {
  var arity = handle.length;
  var hasError = Boolean(err);

  debug('%s %s : %s', handle.name || '<anonymous>', route, req.originalUrl);

  try {
    if (hasError && arity === 4) {
      // error-handling middleware
      handle(err, req, res, next);
      return;
    } else if (!hasError && arity < 4) {
      // request-handling middleware
      handle(req, res, next);
      return;
    }
  } catch (e) {
    // reset the error
    err = e;
  }

  // continue
  next(err);
}
689364
function(uri) {

        if (this._routes[uri] !== undefined) {
            return uri;
        }

        for (var route in this._routes) {
            if (this.is(route, uri)) {
                return route;
            }
        }

        return false;
    }
574923
function switchRouteMatcher(on, when) {
      // TODO(i): this code is convoluted and inefficient, we should construct the route matching
      //   regex only once and then reuse it
      var regex = '^' + when.replace(/([\.\\\(\)\^\$])/g, "\\$1") + '$',
          params = [],
          dst = {};
      forEach(when.split(/\W/), function(param) {
        if (param) {
          var paramRegExp = new RegExp(":" + param + "([\\W])");
          if (regex.match(paramRegExp)) {
            regex = regex.replace(paramRegExp, "([^\\/]*)$1");
            params.push(param);
          }
        }
      });
      var match = on.match(new RegExp(regex));
      if (match) {
        forEach(params, function(name, index) {
          dst[name] = match[index + 1];
        });
      }
      return match ? dst : null;
    }
407221
public function match($route, $method = 'GET', $options = [])
    {
        $this->method = $method;
        $this->options = $options;
        $this->count = 0;

        // Init some data
        $this->buildRouteMaps()
            ->buildTree();

        // Match
        $segments = explode('/', RouteHelper::sanitize($route));

        $routeItem = $this->matchSegment($segments, $this->tree);

        if (!$routeItem) {
            return false;
        }

        $routeItem->setVariables(array_merge($routeItem->getVariables(), $this->vars));

        return $routeItem;
    }
659903
function() {
            if (this.started) {
                logging.warn("routing history already started");
                return false;
            }

            var self = this;
            var $window = $(window);
            var rootUrl = document.location.protocol+'//'+(document.location.hostname||document.location.host);

            logging.log("start routing history");
            $window.bind('hashchange', _.bind(this._handleCurrentState, this));

            var ret = this._handleCurrentState();
            this.started = true;

            return ret;
        }
556846
public function match($route, $method = 'GET', $options = [])
    {
        $this->count = 0;

        foreach ($this->routes as $routeItem) {
            $this->count++;

            if (!$this->matchOptions($routeItem, $method, $options)) {
                continue;
            }

            if ($this->matchRoute($route, $routeItem)) {
                return $routeItem;
            }
        }

        return false;
    }
196652
function match(mapEntry, request, route) {
    var keys = [];

    var m = pathToRegexpService.pathToRegexp(mapEntry.path, keys).exec(request.url);

    if (!m) {
      return false;
    }

    if (mapEntry.method != request.method) {
      return false;
    }

    route.params = {};
    route.path = m[0];
    route.handler = mapEntry.handler;

    // Assign url parameters to the request.
    for (var i = 1; i < m.length; i++) {
      var key = keys[i - 1];
      var prop = key.name;
      var val = decodeParam(m[i]);

      if (val !== undefined || !(hasOwnProperty.call(route.params, prop))) {
        route.params[prop] = val;
      }
    }

    request.params = route.params;
    return true;
  }
86255
function matchRoute(route, path) {

  if (route.pattern === undefined && route.path !== undefined) {
    var routePattern;

    if (route.path instanceof RegExp) {
      routePattern = route.path;
    } else {
      var routePath = normalize(route.path);
      routePattern = route.children.length > 0 ? routePath + '*' : routePath;
    }

    Object.defineProperty(route, 'pattern', {
      enumerable: false,
      value: pattern.newPattern(routePattern)
    });
  }

  if (route.pattern) {
    var match = route.pattern.match(path);

    if (match) {
      if (route.pattern.isRegex) {
        match = {_: match};
      }

      if (!match._ || match._[0] === '/' || match._[0] === '') {
        delete match._;
      }
    }

    return match;

  } else {
    return path === '/' || path === '' ? {} : {_: [path]};
  }
}
1023258
protected function isValidRoute()
    {
        try {

            $current = Route::current();
            if (!$current) {
                return false;
            }
            $action = $current->action;
            $as     = array_get($action, 'as');
            return str_contains($as, 'show') or str_contains($as, 'dashboard');
        } catch (Exception $ex) {
            return false;
        }
    }
1255516
function(uri, haystack_url = window.location.pathname) {
        var original_segments = haystack_url.split('/');
        var route_segments = uri.split('/');
        var original_length = original_segments.length;
        var route_length = route_segments.length;
        if (original_length !== route_length) {
            return false;
        }
        for (var i = 1; i < original_length; i++) {
            if (route_segments[i].indexOf('{') === -1 && route_segments[i] !== original_segments[i]) {
                return false;
            }
        }
        return true;
    }
3551
protected function isMatchingRouteName()
    {
        return $this->getCurrentRouteName() == $this->getRouteName() || array_key_exists($this->getCurrentRouteName(), $this->getAliasRouteNames());
    }
894690
protected function check(array $routes, $request, $includingMethod = true)
    {
        return Arr::first($routes, function ($key, $route) use ($request, $includingMethod)
        {
            return $route->matches($request, $includingMethod);
        });
    }