]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
refactor: rename PathParserOptions
authorEduardo San Martin Morote <posva13@gmail.com>
Wed, 29 Apr 2020 17:12:28 +0000 (19:12 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Wed, 29 Apr 2020 17:12:28 +0000 (19:12 +0200)
src/index.ts
src/matcher/index.ts
src/matcher/pathParserRanker.ts

index 7495b1eb528ef9176e49b9de542382d2642c1513..0f4e1e1d6a97cdf106b6854eed215d38d24e5b6b 100644 (file)
@@ -13,6 +13,10 @@ export {
 export { RouterHistory } from './history/common'
 
 export { RouteRecord, RouteRecordNormalized } from './matcher/types'
+export {
+  PathParserOptions,
+  _PathParserOptions,
+} from './matcher/pathParserRanker'
 
 export {
   RouteLocationRaw,
index bd6db66dbca59034aa08db78b72ae7a81443902c..0630b25fad5a1067c40d1a4f2a6fcf739c07a659 100644 (file)
@@ -12,7 +12,7 @@ import {
   PathParams,
   comparePathParserScore,
   PathParserOptions,
-  PathParserOptionsPublic,
+  _PathParserOptions,
 } from './pathParserRanker'
 import { warn } from 'vue'
 
@@ -40,7 +40,7 @@ export function createRouterMatcher(
   const matchers: RouteRecordMatcher[] = []
   const matcherMap = new Map<RouteRecordName, RouteRecordMatcher>()
   globalOptions = mergeOptions(
-    { strict: false, end: true, sensitive: false } as PathParserOptionsPublic,
+    { strict: false, end: true, sensitive: false } as PathParserOptions,
     globalOptions
   )
 
@@ -362,4 +362,4 @@ function mergeOptions<T>(defaults: T, partialOptions: Partial<T>): T {
   return options
 }
 
-export { PathParserOptionsPublic as PathParserOptions }
+export { PathParserOptions, _PathParserOptions }
index 9811387d6ae40124a742078fdfd4564d29f0d225..1519c4f858c17a3b791828a8af5c8c69bd7574c4 100644 (file)
@@ -43,7 +43,7 @@ export interface PathParser {
   stringify(params: PathParams): string
 }
 
-export interface PathParserOptions {
+export interface _PathParserOptions {
   /**
    * Makes the RegExp case sensitive. Defaults to false
    */
@@ -62,15 +62,15 @@ export interface PathParserOptions {
   end?: boolean
 }
 
-export type PathParserOptionsPublic = Pick<
-  PathParserOptions,
+export type PathParserOptions = Pick<
+  _PathParserOptions,
   'end' | 'sensitive' | 'strict'
 >
 
 // default pattern for a param: non greedy everything but /
 const BASE_PARAM_PATTERN = '[^/]+?'
 
-const BASE_PATH_PARSER_OPTIONS: Required<PathParserOptions> = {
+const BASE_PATH_PARSER_OPTIONS: Required<_PathParserOptions> = {
   sensitive: false,
   strict: false,
   start: true,
@@ -106,7 +106,7 @@ const REGEX_CHARS_RE = /[.+*?^${}()[\]/\\]/g
  */
 export function tokensToParser(
   segments: Array<Token[]>,
-  extraOptions?: PathParserOptions
+  extraOptions?: _PathParserOptions
 ): PathParser {
   const options = {
     ...BASE_PATH_PARSER_OPTIONS,