MCPcopy
hub / github.com/plotly/dash / getPropInfo

Function getPropInfo

dash/extract-meta.js:655–681  ·  view source on GitHub ↗
(propsObj, defaultProps)

Source from the content-addressed store, hash-verified

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);

Callers 1

gatherComponentsFunction · 0.85

Calls 2

reduceMethod · 0.80
getPropsFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…