From: Eduardo San Martin Morote Date: Fri, 11 Sep 2020 13:24:37 +0000 (+0200) Subject: refactor(types): remove redundant type X-Git-Tag: v4.0.0-beta.10~28 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9b336e2c222c262e9f45a87ca6299c3345e5fd70;p=thirdparty%2Fvuejs%2Frouter.git refactor(types): remove redundant type --- diff --git a/src/matcher/pathTokenizer.ts b/src/matcher/pathTokenizer.ts index bb54f3a5..f5913d3d 100644 --- a/src/matcher/pathTokenizer.ts +++ b/src/matcher/pathTokenizer.ts @@ -155,6 +155,11 @@ export function tokenizePath(path: string): Array { break case TokenizerState.ParamRegExp: + // TODO: is it worth handling nested regexp? like :p(?:prefix_([^/]+)_suffix) + // it already works by escaping the closing ) + // https://paths.esm.dev/?p=AAMeJbiAwQEcDKbAoAAkP60PG2R6QAvgNaA6AFACM2ABuQBB# + // is this really something people need since you can also write + // /prefix_:p()_suffix if (char === ')') { // handle the escaped ) if (customRe[customRe.length - 1] == '\\') diff --git a/src/types/index.ts b/src/types/index.ts index 77ad864b..6c1aa924 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -35,17 +35,13 @@ export interface LocationAsPath { path: string } -export interface LocationAsNameRaw { - name: RouteRecordName - params?: RouteParamsRaw -} - export interface LocationAsName { name: RouteRecordName params?: RouteParams } export interface LocationAsRelativeRaw { + name?: RouteRecordName params?: RouteParamsRaw } @@ -74,7 +70,6 @@ export interface RouteLocationOptions { export type RouteLocationRaw = | string | (RouteQueryAndHash & LocationAsPath & RouteLocationOptions) - | (RouteQueryAndHash & LocationAsNameRaw & RouteLocationOptions) | (RouteQueryAndHash & LocationAsRelativeRaw & RouteLocationOptions) export interface RouteLocationMatched extends RouteRecordNormalized {