isImportSpecifier.js 310 B

12345678
  1. /**
  2. * Checks if the path is a ImportSpecifier that imports the given named export
  3. */
  4. export default function isImportSpecifier(path, name) {
  5. return (path.isImportSpecifier() &&
  6. (path.get('imported').isIdentifier({ name }) ||
  7. path.get('imported').isStringLiteral({ value: name })));
  8. }