From bf5d153fb0e93cd474f4cda28b74573cb7cbfb0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Exbrayat?= Date: Wed, 31 Aug 2022 16:56:27 +0200 Subject: [PATCH] chore: improve type for stub cache The current one does not compile with TS v4.8 changes --- src/stubs.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/stubs.ts b/src/stubs.ts index 861323503..f4bf0a12f 100644 --- a/src/stubs.ts +++ b/src/stubs.ts @@ -132,7 +132,7 @@ const resolveComponentStubByName = (componentName: string, stubs: Stubs) => { function createStubOnceForType( type: ConcreteComponent, factoryFn: () => ConcreteComponent, - cache: WeakMap<{} & VNodeTypes, ConcreteComponent> + cache: WeakMap ): ConcreteComponent { const cachedStub = cache.get(type) if (cachedStub) { @@ -149,7 +149,7 @@ export function stubComponents( shallow = false, renderStubDefaultSlot = false ) { - const createdStubsMap: WeakMap<{} & VNodeTypes, ConcreteComponent> = + const createdStubsMap: WeakMap = new WeakMap() const createStubOnce = (