]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
refactor(types): missing generic constraint
authorEduardo San Martin Morote <posva13@gmail.com>
Thu, 12 May 2022 09:37:23 +0000 (11:37 +0200)
committerEduardo San Martin Morote <posva@users.noreply.github.com>
Thu, 30 Jun 2022 07:59:00 +0000 (09:59 +0200)
src/matcher/index.ts

index d8b2dfb81e2739f1f7ef26e5229e76ad2fb76e8e..e6d2ceac4b67f37adcf5fead716c46143b033bcc 100644 (file)
@@ -415,7 +415,10 @@ function mergeMetaFields(matched: MatcherLocation['matched']) {
   )
 }
 
-function mergeOptions<T>(defaults: T, partialOptions: Partial<T>): T {
+function mergeOptions<T extends object>(
+  defaults: T,
+  partialOptions: Partial<T>
+): T {
   const options = {} as T
   for (const key in defaults) {
     options[key] = key in partialOptions ? partialOptions[key]! : defaults[key]