From: Eduardo San Martin Morote Date: Mon, 3 Aug 2020 08:56:50 +0000 (+0200) Subject: chore: expose createRouterMatcher as internal X-Git-Tag: v4.0.0-beta.5~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=815171f48c536026f368310aa94c5eab1d8bec3e;p=thirdparty%2Fvuejs%2Frouter.git chore: expose createRouterMatcher as internal --- diff --git a/src/index.ts b/src/index.ts index ce896361..d1636592 100644 --- a/src/index.ts +++ b/src/index.ts @@ -8,6 +8,7 @@ import { Router } from './router' export { createWebHistory } from './history/html5' export { createMemoryHistory } from './history/memory' export { createWebHashHistory } from './history/hash' +export { createRouterMatcher } from './matcher' export { LocationQuery, diff --git a/src/matcher/index.ts b/src/matcher/index.ts index cf2d9213..7111a18d 100644 --- a/src/matcher/index.ts +++ b/src/matcher/index.ts @@ -26,12 +26,26 @@ interface RouterMatcher { } getRoutes: () => RouteRecordMatcher[] getRecordMatcher: (name: RouteRecordName) => RouteRecordMatcher | undefined + + /** + * Resolves a location. Gives access to the route record that corresponds to the actual path as well as filling the corresponding params objects + * + * @param location - MatcherLocationRaw to resolve to a url + * @param currentLocation - MatcherLocation of the current location + */ resolve: ( location: MatcherLocationRaw, currentLocation: MatcherLocation ) => MatcherLocation } +/** + * Creates a Router Matcher. + * + * @internal + * @param routes - array of initial routes + * @param globalOptions - global route options + */ export function createRouterMatcher( routes: RouteRecordRaw[], globalOptions: PathParserOptions @@ -192,12 +206,6 @@ export function createRouterMatcher( matcherMap.set(matcher.record.name, matcher) } - /** - * Resolves a location. Gives access to the route record that corresponds to the actual path as well as filling the corresponding params objects - * - * @param location - MatcherLocationRaw to resolve to a url - * @param currentLocation - MatcherLocation of the current location - */ function resolve( location: Readonly, currentLocation: Readonly