in src/utils/getMemberValuePath.ts [88:117]
export default function getMemberValuePath(
componentDefinition: NodePath,
memberName: string,
importer: Importer,
): NodePath | null {
if (!isSupportedDefinitionType(componentDefinition)) {
throw new TypeError(
'Got unsupported definition type. Definition must be one of ' +
'ObjectExpression, ClassDeclaration, ClassExpression,' +
'VariableDeclaration, ArrowFunctionExpression, FunctionExpression, ' +
'TaggedTemplateExpression, FunctionDeclaration or CallExpression. Got "' +
componentDefinition.node.type +
'" instead.',
);
}
const lookupMethod =
LOOKUP_METHOD.get(componentDefinition.node.type) ||
getMemberExpressionValuePath;
let result = lookupMethod(componentDefinition, memberName, importer);
if (!result && SYNONYMS[memberName]) {
result = lookupMethod(componentDefinition, SYNONYMS[memberName], importer);
}
const postprocessMethod = POSTPROCESS_MEMBERS.get(memberName);
if (result && postprocessMethod) {
result = postprocessMethod(result, importer);
}
return result;
}