File tree 1 file changed +8
-12
lines changed
1 file changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -139,19 +139,15 @@ module.exports = {
139
139
// Takes an ObjectExpression node and adds all named Property nodes to the
140
140
// current set of state fields.
141
141
function addStateFields ( node ) {
142
- for ( const prop of node . properties ) {
143
- const key = prop . key ;
144
-
145
- if (
146
- prop . type === 'Property'
147
- && ( key . type === 'Literal'
148
- || ( key . type === 'TemplateLiteral' && key . expressions . length === 0 )
149
- || ( prop . computed === false && key . type === 'Identifier' ) )
142
+ node . properties . filter ( ( prop ) => (
143
+ prop . type === 'Property'
144
+ && ( prop . key . type === 'Literal'
145
+ || ( prop . key . type === 'TemplateLiteral' && prop . key . expressions . length === 0 )
146
+ || ( prop . computed === false && prop . key . type === 'Identifier' ) )
150
147
&& getName ( prop . key ) !== null
151
- ) {
152
- classInfo . stateFields . add ( prop ) ;
153
- }
154
- }
148
+ ) ) . forEach ( ( prop ) => {
149
+ classInfo . stateFields . add ( prop ) ;
150
+ } ) ;
155
151
}
156
152
157
153
// Adds the name of the given node as a used state field if the node is an
You can’t perform that action at this time.
0 commit comments