(propsObj, defaultProps)
| 653 | }; |
| 654 | |
| 655 | const getPropInfo = (propsObj, defaultProps) => { |
| 656 | const propsType = checker.getTypeOfSymbolAtLocation( |
| 657 | propsObj, |
| 658 | propsObj.valueDeclaration |
| 659 | ); |
| 660 | const baseProps = propsType.getApparentProperties(); |
| 661 | let propertiesOfProps = baseProps; |
| 662 | |
| 663 | if (propsType.isUnionOrIntersection()) { |
| 664 | propertiesOfProps = [ |
| 665 | ...checker.getAllPossiblePropertiesOfTypes(propsType.types), |
| 666 | ...baseProps |
| 667 | ]; |
| 668 | |
| 669 | if (!propertiesOfProps.length) { |
| 670 | const subTypes = checker.getAllPossiblePropertiesOfTypes( |
| 671 | propsType.types.reduce( |
| 672 | (all, t) => [...all, ...(t.types || [])], |
| 673 | [] |
| 674 | ) |
| 675 | ); |
| 676 | propertiesOfProps = [...subTypes, ...baseProps]; |
| 677 | } |
| 678 | } |
| 679 | |
| 680 | return getProps(propertiesOfProps, propsObj, baseProps, defaultProps); |
| 681 | }; |
| 682 | |
| 683 | zipArrays(filepaths, names).forEach(([filepath, name]) => { |
| 684 | const source = program.getSourceFile(filepath); |
no test coverage detected
searching dependent graphs…