Skip to content

Commit f004fb2

Browse files
committed
Remove redundant star check.
This check is actually breaking compatibility between using a star after a route and after an express param.
1 parent b1d0063 commit f004fb2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function pathtoRegexp(path, keys, options) {
3333
path = path
3434
.concat(strict ? '' : '/?')
3535
.replace(/\/\(/g, '(?:/')
36-
.replace(/(\/)?(\.)?:(\w+)(?:(\(.*?\)))?(\?)?(\*)?/g, function(_, slash, format, key, capture, optional, star){
36+
.replace(/(\/)?(\.)?:(\w+)(?:(\(.*?\)))?(\?)?/g, function (_, slash, format, key, capture, optional) {
3737
keys.push({ name: key, optional: !! optional });
3838
slash = slash || '';
3939
return ''
@@ -42,7 +42,6 @@ function pathtoRegexp(path, keys, options) {
4242
+ (optional ? slash : '')
4343
+ (format || '') + (capture || (format && '([^/.]+)' || '([^/]+)')) + ')'
4444
+ (optional || '')
45-
+ (star ? '(/*)?' : '');
4645
})
4746
.replace(/([\/.])/g, '\\$1')
4847
.replace(/\*/g, '(.*)');

0 commit comments

Comments
 (0)