From: Eduardo San Martin Morote Date: Fri, 2 Oct 2020 09:50:39 +0000 (+0200) Subject: refactor(matcher): remove dead code X-Git-Tag: v4.0.0-beta.13~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=960d9adbe97e96f5c2baa1a5dccdc1d415b9beb3;p=thirdparty%2Fvuejs%2Frouter.git refactor(matcher): remove dead code --- diff --git a/src/matcher/pathTokenizer.ts b/src/matcher/pathTokenizer.ts index 92b0cbaa..aa1dd7b3 100644 --- a/src/matcher/pathTokenizer.ts +++ b/src/matcher/pathTokenizer.ts @@ -46,17 +46,11 @@ const VALID_PARAM_RE = /[a-zA-Z0-9_]/ export function tokenizePath(path: string): Array { 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)!