]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore: symbols as helperNameMap index type (#6622)
author世新 <73146951+4xii@users.noreply.github.com>
Wed, 5 Oct 2022 21:26:16 +0000 (05:26 +0800)
committerGitHub <noreply@github.com>
Wed, 5 Oct 2022 21:26:16 +0000 (05:26 +0800)
packages/compiler-core/src/runtimeHelpers.ts

index 3bfe73935b84f4a04015a55f7517da2772f9a1c1..3f5ef02479792bf10783ffcff18be6a169c01a17 100644 (file)
@@ -42,8 +42,7 @@ export const IS_MEMO_SAME = Symbol(__DEV__ ? `isMemoSame` : ``)
 
 // Name mapping for runtime helpers that need to be imported from 'vue' in
 // generated code. Make sure these are correctly exported in the runtime!
-// Using `any` here because TS doesn't allow symbols as index type.
-export const helperNameMap: any = {
+export const helperNameMap: Record<symbol, string> = {
   [FRAGMENT]: `Fragment`,
   [TELEPORT]: `Teleport`,
   [SUSPENSE]: `Suspense`,
@@ -85,7 +84,7 @@ export const helperNameMap: any = {
   [IS_MEMO_SAME]: `isMemoSame`
 }
 
-export function registerRuntimeHelpers(helpers: any) {
+export function registerRuntimeHelpers(helpers: Record<symbol, string>) {
   Object.getOwnPropertySymbols(helpers).forEach(s => {
     helperNameMap[s] = helpers[s]
   })