Skip to content

Commit

Permalink
Update prepareRoute
Browse files Browse the repository at this point in the history
  • Loading branch information
ijjk committed Jun 19, 2020
1 parent 20133c6 commit 0bc2953
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/next/next-server/lib/router/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ function toRoute(path: string): string {
return path.replace(/\/$/, '') || '/'
}

const prepareRoute = (path: string) =>
toRoute(!path || delBasePath(path) === '/' ? '/index' : path)
function prepareRoute(path: string) {
path = delBasePath(path || '')
return toRoute(!path || path === '/' ? '/index' : path)
}

type Url = UrlObject | string

Expand Down

0 comments on commit 0bc2953

Please sign in to comment.