Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

Commit

Permalink
Merge pull request #154 from GoogleChrome/issue-3
Browse files Browse the repository at this point in the history
Fixes #3
  • Loading branch information
Matthew Gaunt authored Jun 29, 2016
2 parents 79ade01 + 30e5b6d commit b2a7036
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
'use strict';

var Route = require('./route');
var helpers = require('./helpers');

function regexEscape(s) {
return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
Expand Down Expand Up @@ -83,6 +84,11 @@ Router.prototype.add = function(method, path, handler, options) {

var routeMap = methodMap.get(method);
var regExp = route.regexp || route.fullUrlRegExp;

if (routeMap.has(regExp.source)) {
helpers.debug('"' + path + '" resolves to same regex as existing route.');
}

routeMap.set(regExp.source, route);
};

Expand Down

0 comments on commit b2a7036

Please sign in to comment.