getPropertyValuePath.d.ts 475 B

12345678
  1. import type { NodePath } from '@babel/traverse';
  2. import 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. */
  8. export default function getPropertyValuePath(path: NodePath<ObjectExpression>, propertyName: string): NodePath<Expression | ObjectMethod> | null;