Fix new eslint warnings

This commit is contained in:
Tom Hughes 2019-04-14 19:39:40 +01:00
parent d67b057851
commit 176b853174
2 changed files with 53 additions and 53 deletions

View file

@ -47,7 +47,7 @@
move the map without the hash changing.
*/
OSM.Router = function (map, rts) {
var escapeRegExp = /[\-{}\[\]+?.,\\\^$|#\s]/g;
var escapeRegExp = /[-{}[\]+?.,\\^$|#\s]/g;
var optionalParam = /\((.*?)\)/g;
var namedParam = /(\(\?)?:\w+/g;
var splatParam = /\*\w+/g;
@ -57,7 +57,7 @@ OSM.Router = function (map, rts) {
path.replace(escapeRegExp, "\\$&")
.replace(optionalParam, "(?:$1)?")
.replace(namedParam, function (match, optional) {
return optional ? match : "([^\/]+)";
return optional ? match : "([^/]+)";
})
.replace(splatParam, "(.*?)") + "(?:\\?.*)?$");