]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
refactor(matcher): remove dead code
authorEduardo San Martin Morote <posva13@gmail.com>
Fri, 2 Oct 2020 09:50:39 +0000 (11:50 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Fri, 2 Oct 2020 09:55:02 +0000 (11:55 +0200)
src/matcher/pathTokenizer.ts

index 92b0cbaa1a83b4bdc19d57bba2e3bc69ea91497b..aa1dd7b385e6fad69a610decfbf7a5ca95a65fe7 100644 (file)
@@ -46,17 +46,11 @@ const VALID_PARAM_RE = /[a-zA-Z0-9_]/
 export function tokenizePath(path: string): Array<Token[]> {
   if (!path) return [[]]
   if (path === '/') return [[ROOT_TOKEN]]
-  // // v3 catchAll must be renew
-  // if (/^\/?\*/.test(path))
-  //   throw new Error(
-  //     `Catch all routes (/*) must now be defined using a parameter with a custom regex: /:catchAll(.*)`
-  //   )
   // remove the leading slash
   if (__DEV__ && !path.startsWith('/')) {
     throw new Error(
       `Route path should start with a "/": "${path}" should be "/${path}". This will break in production.`
     )
-    path = '/' + path
   }
 
   // if (tokenCache.has(path)) return tokenCache.get(path)!