]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
chore: remove unnecessary await keyword (#1783)
authorKirk Lin <linkirk@163.com>
Fri, 7 Apr 2023 09:23:43 +0000 (17:23 +0800)
committerGitHub <noreply@github.com>
Fri, 7 Apr 2023 09:23:43 +0000 (11:23 +0200)
packages/router/__tests__/guards/extractComponentsGuards.spec.ts
packages/router/__tests__/utils.ts
packages/router/e2e/guards-instances/index.ts
packages/router/e2e/modal/index.ts
packages/router/e2e/suspense/index.ts
packages/router/src/history/html5.ts
packages/router/src/location.ts

index 64d61ca100bfbf514bd29e99747a1920a33a8658..560d9cc1e2a0e6f5ce98d19be097fe1320d20d5f 100644 (file)
@@ -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',
index 000b838d3b6da68a812816491945ddf54b20079d..2922ea5f557e0993f1f56690382da712e581e609 100644 (file)
@@ -4,7 +4,6 @@ import {
   RouteRecordMultipleViews,
   MatcherLocation,
   RouteLocationNormalized,
-  _RouteRecordBase,
   RouteComponent,
   RouteRecordRaw,
   RouteRecordName,
index e792b193f70bf35551f6946f4138c9496b867572..2a4aa04f00f0732110753089f9f4242510840fb2 100644 (file)
@@ -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({
index 215670e42095d2d5dda37d2de4183a817534bb0f..8cd329e96ed2501334028e884e9e1f85afdd9804 100644 (file)
@@ -12,7 +12,6 @@ import {
   ref,
   watchEffect,
   computed,
-  toRefs,
   defineComponent,
 } from 'vue'
 
index ba228d399b81bd859ec65b9c0e35b5d8397c7ce8..94f1e72f5259d9b90b76d491d13b1015d7311482 100644 (file)
@@ -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,
index 6aeda01ac86618d2b1d65be5c2df7ff97d1fd8e8..f945fe45cc7e26a981f5c282525ab3c3b3bb9337 100644 (file)
@@ -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,
index 0f981b47df7679b6ee972c3252d81f7f962d2c56..d2017a3f6f164b738df5739b9e40907a6227a135 100644 (file)
@@ -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}
  */