Skip to content

Commit

Permalink
fix: route parse fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dalisoft committed May 30, 2021
1 parent 5590078 commit 9fadd91
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/find-route.js
Expand Up @@ -28,14 +28,15 @@ export default class FindRoute {
if (typeof route.path === 'string') {
if (route.path === '*' || route.path === '/*') {
route.all = true;
}
if (route.path.indexOf(':') !== -1) {
} else if (route.path.indexOf(':') !== -1) {
route.fetch_params = true;
route.params_id = [];
route.path = pathToRegexp(route.path, route.params_id);
route.regex = true;
} else if (route.path.indexOf('*') !== -1) {
route.path = pathToRegexp(route.path);
route.params_id = [];
route.path = pathToRegexp(route.path, route.params_id);
route.fetch_params = route.params_id.length > 0;
route.regex = true;
}
} else if (route.path instanceof RegExp) {
Expand Down

0 comments on commit 9fadd91

Please sign in to comment.