code: 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;
      }
docs: Check if current URL is attached to route (1st param)
  or if second optional param passed - checks against haystack_url not current URL
  @param uri
  @param haystack_url
  @returns {boolean}