Skip to content

Commit

Permalink
fix: check for object properties
Browse files Browse the repository at this point in the history
  • Loading branch information
farnabaz committed Jul 20, 2022
1 parent c266a1e commit 0f20817
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/utils/parseSetupScript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,12 @@ export function parseSetupScript (id: string, descriptor: SFCDescriptor) {
visit(script.scriptSetupAst, node => node.type === 'CallExpression' && node.callee?.name === 'defineProps', (node) => {
const properties = node.arguments[0]?.properties || []
properties.reduce((props, p) => {
props.push({
name: p.key.name,
...getValue(p.value)
})
if (p.type === 'ObjectProperty') {
props.push({
name: p.key.name,
...getValue(p.value)
})
}
return props
}, props)
visit(node, n => n.type === 'TSPropertySignature', (property) => {
Expand Down

0 comments on commit 0f20817

Please sign in to comment.