From: Eduardo San Martin Morote Date: Sat, 15 May 2021 20:48:29 +0000 (+0200) Subject: refactor: fix typing errors X-Git-Tag: v2.0.0-alpha.17~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2891dbcb9e44cc3e74f1d054e10e0047d5673ae6;p=thirdparty%2Fvuejs%2Fpinia.git refactor: fix typing errors --- diff --git a/src/devtools/plugin.ts b/src/devtools/plugin.ts index 23e25cab..86f8260a 100644 --- a/src/devtools/plugin.ts +++ b/src/devtools/plugin.ts @@ -91,6 +91,7 @@ export function addDevtools(app: App, store: Store) { key: 'getters', editable: false, value: store._getters.reduce((getters, key) => { + // @ts-expect-error getters[key] = store[key] return getters }, {} as GettersTree), @@ -311,15 +312,16 @@ export function devtoolsPlugin< G extends GettersTree = GettersTree, A /* extends ActionsTree */ = ActionsTree >({ app, store, options, pinia }: PiniaPluginContext) { - const wrappedActions = {} as Pick + const wrappedActions = {} as A // original actions of the store as they are given by pinia. We are going to override them const actions = Object.keys(options.actions || ({} as A)).reduce( (storeActions, actionName) => { - storeActions[actionName as keyof A] = store[actionName as keyof A] + // @ts-expect-error + storeActions[actionName] = store[actionName] return storeActions }, - {} as Pick + {} as ActionsTree ) for (const actionName in actions) {