react-docgen
Version:
A library to extract information from React components for documentation generation.
10 lines (9 loc) • 382 B
TypeScript
import type { NodePath } from '@babel/traverse';
/**
* If the path is an identifier, it is resolved in the scope chain.
* If it is an assignment expression, it resolves to the right hand side.
* If it is a member expression it is resolved to it's initialization value.
*
* Else the path itself is returned.
*/
export default function resolveToValue(path: NodePath): NodePath;