@@ -184,8 +184,8 @@ Router.prototype._on = function _on (method, path, opts, handler, store) {
184
184
if ( ! this . caseSensitive ) {
185
185
staticNodePath = staticNodePath . toLowerCase ( )
186
186
}
187
- staticNodePath = staticNodePath . split ( '::' ) . join ( ':' )
188
- staticNodePath = staticNodePath . split ( '%' ) . join ( '%25' )
187
+ staticNodePath = staticNodePath . replaceAll ( '::' , ':' )
188
+ staticNodePath = staticNodePath . replaceAll ( '%' , '%25' )
189
189
// add the static part of the route to the tree
190
190
currentNode = currentNode . createStaticChild ( staticNodePath )
191
191
}
@@ -240,8 +240,8 @@ Router.prototype._on = function _on (method, path, opts, handler, store) {
240
240
241
241
let staticPart = pattern . slice ( staticPartStartIndex , j )
242
242
if ( staticPart ) {
243
- staticPart = staticPart . split ( '::' ) . join ( ':' )
244
- staticPart = staticPart . split ( '%' ) . join ( '%25' )
243
+ staticPart = staticPart . replaceAll ( '::' , ':' )
244
+ staticPart = staticPart . replaceAll ( '%' , '%25' )
245
245
regexps . push ( backtrack = escapeRegExp ( staticPart ) )
246
246
}
247
247
@@ -328,8 +328,8 @@ Router.prototype.findRoute = function findNode (method, path, constraints = {})
328
328
if ( ! this . caseSensitive ) {
329
329
staticNodePath = staticNodePath . toLowerCase ( )
330
330
}
331
- staticNodePath = staticNodePath . split ( '::' ) . join ( ':' )
332
- staticNodePath = staticNodePath . split ( '%' ) . join ( '%25' )
331
+ staticNodePath = staticNodePath . replaceAll ( '::' , ':' )
332
+ staticNodePath = staticNodePath . replaceAll ( '%' , '%25' )
333
333
// add the static part of the route to the tree
334
334
currentNode = currentNode . getStaticChild ( staticNodePath )
335
335
if ( currentNode === null ) {
@@ -387,8 +387,8 @@ Router.prototype.findRoute = function findNode (method, path, constraints = {})
387
387
388
388
let staticPart = pattern . slice ( staticPartStartIndex , j )
389
389
if ( staticPart ) {
390
- staticPart = staticPart . split ( '::' ) . join ( ':' )
391
- staticPart = staticPart . split ( '%' ) . join ( '%25' )
390
+ staticPart = staticPart . replaceAll ( '::' , ':' )
391
+ staticPart = staticPart . replaceAll ( '%' , '%25' )
392
392
regexps . push ( backtrack = escapeRegExp ( staticPart ) )
393
393
}
394
394
0 commit comments