(importSpecifiers, identifier)
| 1 | module.exports = ({ root, jscodeshift }) => { |
| 2 | const findImportIdentifierOf = (importSpecifiers, identifier) => { |
| 3 | const specifier = importSpecifiers |
| 4 | .filter((node) => node.value.imported.name === identifier) |
| 5 | .paths() |
| 6 | |
| 7 | if (specifier.length > 0) { |
| 8 | return specifier[0].value.local |
| 9 | } |
| 10 | |
| 11 | return jscodeshift.identifier(identifier) |
| 12 | } |
| 13 | |
| 14 | const findImportSpecifiers = (packageName) => |
| 15 | root |
no outgoing calls
no test coverage detected
searching dependent graphs…