From 9b336e2c222c262e9f45a87ca6299c3345e5fd70 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Fri, 11 Sep 2020 15:24:37 +0200 Subject: [PATCH] refactor(types): remove redundant type --- src/matcher/pathTokenizer.ts | 5 +++++ src/types/index.ts | 7 +------ 2 files changed, 6 insertions(+), 6 deletions(-) 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 { -- 2.47.3