Skip to content

Commit

Permalink
fix(create-matcher): warn about root paths without a leading slash
Browse files Browse the repository at this point in the history
  • Loading branch information
Sayegh7 committed Jan 22, 2019
1 parent 2191ee1 commit b1c178c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/create-matcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ export function createMatcher (
router: VueRouter
): Matcher {
const { pathList, pathMap, nameMap } = createRouteMap(routes)
const pathsMissingSlashes = pathList.filter(path => !!path && path.charAt(0) !== '/')

if (pathsMissingSlashes.length > 0) {
warn(false, `There is at least one root route without a leading slash in its path.`)
}

function addRoutes (routes) {
createRouteMap(routes, pathList, pathMap, nameMap)
Expand Down

0 comments on commit b1c178c

Please sign in to comment.