File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ import { step, navigateQueue } from '../index'
31
31
import { createRoute , getOption } from './route'
32
32
import { createComponent } from './components'
33
33
import Log from '../../Log'
34
- import { isWildcard } from './regex'
34
+ import { isWildcard , stripRegex } from './regex'
35
35
import emit from './emit'
36
36
import { updateWidgets } from './widgets'
37
37
import { setHistory , updateHistory } from './history'
@@ -263,11 +263,11 @@ const init = config => {
263
263
}
264
264
}
265
265
config . routes . forEach ( item => {
266
- let path = item . path
266
+ const path = stripRegex ( item . path )
267
267
// Pattern to identify the last path of the route
268
268
// It should start with "/:" + any word and ends with "?"
269
269
// Example /player/:asset/:assetId?
270
- const pattern = / \/ : { 1 } \w + \ ?$ /
270
+ const pattern = / . * \/ : . * ? \ ?$ / u
271
271
if ( pattern . test ( item . path ) ) {
272
272
const optionalPath = path . substring ( 0 , path . lastIndexOf ( '/' ) )
273
273
const originalPath = path . substring ( 0 , path . lastIndexOf ( '?' ) )
You can’t perform that action at this time.
0 commit comments