From 68451570df030099ea2ec4f3751cf66c114dd249 Mon Sep 17 00:00:00 2001 From: Ezra Ashenafi Date: Mon, 16 Sep 2024 16:38:04 +0300 Subject: [PATCH] fix(nuxt): simplify plugin `InjectionType` template conditional (#29023) --- packages/nuxt/src/core/templates.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/nuxt/src/core/templates.ts b/packages/nuxt/src/core/templates.ts index 759d070562..8aef343fe9 100644 --- a/packages/nuxt/src/core/templates.ts +++ b/packages/nuxt/src/core/templates.ts @@ -151,10 +151,9 @@ import type { Plugin } from '#app' type Decorate> = { [K in keyof T as K extends string ? \`$\${K}\` : never]: T[K] } -type IsAny = 0 extends 1 & T ? true : false -type InjectionType = IsAny extends true ? unknown : A extends Plugin ? Decorate : unknown +type InjectionType = A extends {default: Plugin} ? Decorate : unknown -type NuxtAppInjections = \n ${tsImports.map(p => `InjectionType`).join(' &\n ')} +type NuxtAppInjections = \n ${tsImports.map(p => `InjectionType`).join(' &\n ')} declare module '#app' { interface NuxtApp extends NuxtAppInjections { }