Skip to content

Commit 33e48bd

Browse files
4xiizhangzhonghe
authored andcommitted
chore: symbols as helperNameMap index type (vuejs#6622)
1 parent e735f5e commit 33e48bd

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packages/compiler-core/src/runtimeHelpers.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ export const IS_MEMO_SAME = Symbol(__DEV__ ? `isMemoSame` : ``)
4242

4343
// Name mapping for runtime helpers that need to be imported from 'vue' in
4444
// generated code. Make sure these are correctly exported in the runtime!
45-
// Using `any` here because TS doesn't allow symbols as index type.
46-
export const helperNameMap: any = {
45+
export const helperNameMap: Record<symbol, string> = {
4746
[FRAGMENT]: `Fragment`,
4847
[TELEPORT]: `Teleport`,
4948
[SUSPENSE]: `Suspense`,
@@ -85,7 +84,7 @@ export const helperNameMap: any = {
8584
[IS_MEMO_SAME]: `isMemoSame`
8685
}
8786

88-
export function registerRuntimeHelpers(helpers: any) {
87+
export function registerRuntimeHelpers(helpers: Record<symbol, string>) {
8988
Object.getOwnPropertySymbols(helpers).forEach(s => {
9089
helperNameMap[s] = helpers[s]
9190
})

0 commit comments

Comments
 (0)