| 474 | }; |
| 475 | |
| 476 | const getPropsForFunctionalComponent = type => { |
| 477 | const callSignatures = type.getCallSignatures(); |
| 478 | |
| 479 | for (const sig of callSignatures) { |
| 480 | const params = sig.getParameters(); |
| 481 | if (params.length === 0) { |
| 482 | continue; |
| 483 | } |
| 484 | |
| 485 | // There is only one parameter for functional components: props |
| 486 | const p = params[0]; |
| 487 | if (p.name === 'props' || params.length === 1) { |
| 488 | return p; |
| 489 | } |
| 490 | } |
| 491 | return null; |
| 492 | }; |
| 493 | |
| 494 | const getPropsForClassComponent = (typeSymbol, source, defaultProps) => { |
| 495 | const childs = source.getChildAt(0); |
no outgoing calls
no test coverage detected
searching dependent graphs…