| 391 | // simplifies `getDefaultProps` or converts it to an IIFE; |
| 392 | // and collects everything else in the `statics` property object. |
| 393 | const collectStatics = specPath => { |
| 394 | const result = []; |
| 395 | |
| 396 | for (let i = 0; i < specPath.properties.length; i++) { |
| 397 | const property = specPath.properties[i]; |
| 398 | if (createFindPropFn('statics')(property) && property.value && property.value.properties) { |
| 399 | result.push(...property.value.properties); |
| 400 | } else if (createFindPropFn(DEFAULT_PROPS_FIELD)(property)) { |
| 401 | result.push(createDefaultProps(property)); |
| 402 | } else if (property.key && STATIC_KEYS.hasOwnProperty(property.key.name)) { |
| 403 | result.push(property); |
| 404 | } |
| 405 | } |
| 406 | |
| 407 | return result; |
| 408 | }; |
| 409 | |
| 410 | const collectNonStaticProperties = specPath => specPath.properties |
| 411 | .filter(prop => |
no test coverage detected