expressionTo.d.ts 453 B

123456789101112
  1. import type { NodePath } from '@babel/traverse';
  2. import type { Node } from '@babel/types';
  3. /**
  4. * Splits a MemberExpression or CallExpression into parts.
  5. * E.g. foo.bar.baz becomes ['foo', 'bar', 'baz']
  6. */
  7. declare function toArray(path: NodePath<Node | null>): string[];
  8. /**
  9. * Creates a string representation of a member expression.
  10. */
  11. declare function toString(path: NodePath<Node | null>): string;
  12. export { toString as String, toArray as Array };