UNPKG

475 BTypeScriptView Raw
1import type { NodePath } from '@babel/traverse';
2import type { Expression, ObjectExpression, ObjectMethod } from '@babel/types';
3/**
4 * Given an ObjectExpression, this function returns the path of the value of
5 * the property with name `propertyName`. if the property is an ObjectMethod we
6 * return the ObjectMethod itself.
7 */
8export default function getPropertyValuePath(path: NodePath<ObjectExpression>, propertyName: string): NodePath<Expression | ObjectMethod> | null;