Skip to content

Commit 0f20817

Browse files
committed
fix: check for object properties
1 parent c266a1e commit 0f20817

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/utils/parseSetupScript.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,12 @@ export function parseSetupScript (id: string, descriptor: SFCDescriptor) {
5050
visit(script.scriptSetupAst, node => node.type === 'CallExpression' && node.callee?.name === 'defineProps', (node) => {
5151
const properties = node.arguments[0]?.properties || []
5252
properties.reduce((props, p) => {
53-
props.push({
54-
name: p.key.name,
55-
...getValue(p.value)
56-
})
53+
if (p.type === 'ObjectProperty') {
54+
props.push({
55+
name: p.key.name,
56+
...getValue(p.value)
57+
})
58+
}
5759
return props
5860
}, props)
5961
visit(node, n => n.type === 'TSPropertySignature', (property) => {

0 commit comments

Comments
 (0)