fix: types

This commit is contained in:
zqran 2023-06-23 23:37:21 +08:00
parent 31deb48a89
commit 87519fa279
1 changed files with 3 additions and 3 deletions

View File

@ -649,12 +649,12 @@ export function compileScript(
}
if (child.type === 'Identifier') {
if (parent.type === 'VariableDeclarator') {
if (parent!.type === 'VariableDeclarator') {
withDefaultsVariables[child.name] = {
node
}
} else if (
parent.type === 'CallExpression' &&
parent!.type === 'CallExpression' &&
parent.callee.type === 'Identifier' &&
parent.callee.name === WITH_DEFAULTS &&
withDefaultsVariables[child.name]
@ -664,7 +664,7 @@ export function compileScript(
variable.needHoist = true
}
} else if (
parent.type !== 'VariableDeclaration' &&
parent!.type !== 'VariableDeclaration' &&
withDefaultsVariables[child.name]
) {
const variable = withDefaultsVariables[child.name]