build(deps): upgrade to TypeScript 4

This commit is contained in:
Evan You
2020-08-20 17:48:28 -04:00
parent 91700fbec2
commit 7454e2a52b
9 changed files with 60 additions and 36 deletions

View File

@@ -258,7 +258,7 @@ export function createAppAPI<HostElement>(
},
provide(key, value) {
if (__DEV__ && key in context.provides) {
if (__DEV__ && (key as string | symbol) in context.provides) {
warn(
`App already provides property with key "${String(key)}". ` +
`It will be overwritten with the new value.`

View File

@@ -37,7 +37,7 @@ export function inject(
const instance = currentInstance || currentRenderingInstance
if (instance) {
const provides = instance.provides
if (key in provides) {
if ((key as string | symbol) in provides) {
// TS doesn't allow symbol as index type
return provides[key as string]
} else if (arguments.length > 1) {