File tree Expand file tree Collapse file tree 1 file changed +4
-15
lines changed Expand file tree Collapse file tree 1 file changed +4
-15
lines changed Original file line number Diff line number Diff line change @@ -44,21 +44,10 @@ const getComponentPropsType = (property) => {
44
44
* Check object props `props: { objectProps: {...} }`
45
45
*/
46
46
if ( property . property . value . type === 'ObjectExpression' ) {
47
- const propsIncludeTypeProperty = property . property . value . properties . find (
48
- ( property ) =>
49
- property . type === 'Property' &&
50
- property . key . type === 'Identifier' &&
51
- property . key . name === 'type' &&
52
- property . value . type === 'Identifier'
53
- )
54
-
55
- if ( propsIncludeTypeProperty === undefined ) return null
56
-
57
- if (
58
- propsIncludeTypeProperty . type === 'Property' &&
59
- propsIncludeTypeProperty . value . type === 'Identifier'
60
- )
61
- return propsIncludeTypeProperty . value . name
47
+ const typeProperty = utils . findProperty ( property . property . value , 'type' )
48
+ if ( typeProperty == null ) return null
49
+
50
+ if ( typeProperty . value . type === 'Identifier' ) return typeProperty . value . name
62
51
}
63
52
return null
64
53
}
You can’t perform that action at this time.
0 commit comments