]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
refactor(types): remove redundant type
authorEduardo San Martin Morote <posva13@gmail.com>
Fri, 11 Sep 2020 13:24:37 +0000 (15:24 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Fri, 11 Sep 2020 13:24:37 +0000 (15:24 +0200)
src/matcher/pathTokenizer.ts
src/types/index.ts

index bb54f3a5d3f21012ff4df57126086da10970a6a6..f5913d3d5ba2054e110c3934c4f5c1a845a8bdc2 100644 (file)
@@ -155,6 +155,11 @@ export function tokenizePath(path: string): Array<Token[]> {
         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] == '\\')
index 77ad864bfdc6836846e11a130954728784c2fc7b..6c1aa92494d5604f9f370dbd052fbd9882157ed0 100644 (file)
@@ -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 {