File tree 3 files changed +11
-11
lines changed
3 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -57,11 +57,11 @@ function create (context) {
57
57
58
58
return utils . executeOnVue ( context , ( obj ) => {
59
59
const node = obj . properties
60
- . filter ( item => (
60
+ . find ( item => (
61
61
item . type === 'Property' &&
62
62
item . key . name === 'name' &&
63
63
item . value . type === 'Literal'
64
- ) ) [ 0 ]
64
+ ) )
65
65
66
66
if ( ! node ) return
67
67
Original file line number Diff line number Diff line change @@ -13,18 +13,18 @@ function create (context) {
13
13
14
14
function objectHasType ( node ) {
15
15
const typeProperty = node . properties
16
- . filter ( p =>
16
+ . find ( p =>
17
17
utils . getStaticPropertyName ( p . key ) === 'type' &&
18
18
(
19
19
p . value . type !== 'ArrayExpression' ||
20
20
p . value . elements . length > 0
21
21
)
22
- ) [ 0 ]
22
+ )
23
23
return Boolean ( typeProperty )
24
24
}
25
25
26
26
function checkProperties ( items ) {
27
- items . map ( cp => {
27
+ for ( const cp of items ) {
28
28
if ( cp . type !== 'Property' ) {
29
29
return
30
30
}
@@ -45,7 +45,7 @@ function create (context) {
45
45
}
46
46
} )
47
47
}
48
- } )
48
+ }
49
49
}
50
50
51
51
// ----------------------------------------------------------------------
@@ -54,13 +54,13 @@ function create (context) {
54
54
55
55
return utils . executeOnVue ( context , ( obj ) => {
56
56
const node = obj . properties
57
- . filter ( p =>
57
+ . find ( p =>
58
58
p . type === 'Property' &&
59
59
p . key . type === 'Identifier' &&
60
60
p . key . name === 'props'
61
- ) [ 0 ]
61
+ )
62
62
63
- if ( ! node ) return null
63
+ if ( ! node ) return
64
64
65
65
if ( node . value . type === 'ObjectExpression' ) {
66
66
checkProperties ( node . value . properties )
Original file line number Diff line number Diff line change @@ -321,11 +321,11 @@ module.exports = {
321
321
*/
322
322
getComputedProperties ( componentObject ) {
323
323
const computedPropertiesNode = componentObject . properties
324
- . filter ( p =>
324
+ . find ( p =>
325
325
p . key . type === 'Identifier' &&
326
326
p . key . name === 'computed' &&
327
327
p . value . type === 'ObjectExpression'
328
- ) [ 0 ]
328
+ )
329
329
330
330
if ( ! computedPropertiesNode ) { return [ ] }
331
331
You can’t perform that action at this time.
0 commit comments