Files
Shifted/node_modules/react-docgen/dist/utils/isImportSpecifier.js
2026-02-10 01:14:19 +00:00

9 lines
310 B
JavaScript

/**
* Checks if the path is a ImportSpecifier that imports the given named export
*/
export default function isImportSpecifier(path, name) {
return (path.isImportSpecifier() &&
(path.get('imported').isIdentifier({ name }) ||
path.get('imported').isStringLiteral({ value: name })));
}