From: Kirk Lin Date: Fri, 7 Apr 2023 09:23:43 +0000 (+0800) Subject: chore: remove unnecessary await keyword (#1783) X-Git-Tag: v4.2.0~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f929cc5a4d78b0dc0361199dce49296c8781b28d;p=thirdparty%2Fvuejs%2Frouter.git chore: remove unnecessary await keyword (#1783) --- diff --git a/packages/router/__tests__/guards/extractComponentsGuards.spec.ts b/packages/router/__tests__/guards/extractComponentsGuards.spec.ts index 64d61ca1..560d9cc1 100644 --- a/packages/router/__tests__/guards/extractComponentsGuards.spec.ts +++ b/packages/router/__tests__/guards/extractComponentsGuards.spec.ts @@ -50,7 +50,7 @@ async function checkGuards( guardsLength: number = n ) { beforeRouteEnter.mockClear() - const guards = await extractComponentsGuards( + const guards = extractComponentsGuards( // type is fine as we excluded RouteRecordRedirect in components argument components.map(normalizeRouteRecord) as RouteRecordNormalized[], 'beforeRouteEnter', diff --git a/packages/router/__tests__/utils.ts b/packages/router/__tests__/utils.ts index 000b838d..2922ea5f 100644 --- a/packages/router/__tests__/utils.ts +++ b/packages/router/__tests__/utils.ts @@ -4,7 +4,6 @@ import { RouteRecordMultipleViews, MatcherLocation, RouteLocationNormalized, - _RouteRecordBase, RouteComponent, RouteRecordRaw, RouteRecordName, diff --git a/packages/router/e2e/guards-instances/index.ts b/packages/router/e2e/guards-instances/index.ts index e792b193..2a4aa04f 100644 --- a/packages/router/e2e/guards-instances/index.ts +++ b/packages/router/e2e/guards-instances/index.ts @@ -45,7 +45,8 @@ const state = reactive({ /** * creates a component that logs the guards - * @param name + * @param key {string} - a unique identifier for the component + * @returns {object} - a Vue component object with beforeRouteEnter, beforeRouteUpdate, and beforeRouteLeave navigation guards implemented */ function createTestComponent(key: string) { return defineComponent({ diff --git a/packages/router/e2e/modal/index.ts b/packages/router/e2e/modal/index.ts index 215670e4..8cd329e9 100644 --- a/packages/router/e2e/modal/index.ts +++ b/packages/router/e2e/modal/index.ts @@ -12,7 +12,6 @@ import { ref, watchEffect, computed, - toRefs, defineComponent, } from 'vue' diff --git a/packages/router/e2e/suspense/index.ts b/packages/router/e2e/suspense/index.ts index ba228d39..94f1e72f 100644 --- a/packages/router/e2e/suspense/index.ts +++ b/packages/router/e2e/suspense/index.ts @@ -35,8 +35,13 @@ const state = reactive({ const delay = (t: number) => new Promise(r => setTimeout(r, t)) /** - * creates a component that logs the guards - * @param name + * Creates a test component with the given key, optionally specifying whether it should be async and whether creation should be logged. + * + * @param {string} key - The key of the component. + * @param {boolean} [isAsync=false] - Whether the component should be async. + * @param {boolean} [logCreation=false] - Whether creation should be logged. + * @returns {object} The component object. + * */ function createTestComponent( key: string, diff --git a/packages/router/src/history/html5.ts b/packages/router/src/history/html5.ts index 6aeda01a..f945fe45 100644 --- a/packages/router/src/history/html5.ts +++ b/packages/router/src/history/html5.ts @@ -32,7 +32,8 @@ interface StateEntry extends HistoryState { /** * Creates a normalized history location from a window.location object - * @param location - + * @param base - The base path + * @param location - The window.location object */ function createCurrentLocation( base: string, diff --git a/packages/router/src/location.ts b/packages/router/src/location.ts index 0f981b47..d2017a3f 100644 --- a/packages/router/src/location.ts +++ b/packages/router/src/location.ts @@ -121,6 +121,7 @@ export function stripBase(pathname: string, base: string): string { * pointing towards the same {@link RouteRecord} and that all `params`, `query` * parameters and `hash` are the same * + * @param stringifyQuery - A function that takes a query object of type LocationQueryRaw and returns a string representation of it. * @param a - first {@link RouteLocation} * @param b - second {@link RouteLocation} */