in src/importer/makeFsImporter.ts [97:127]
visitExportNamedDeclaration(path: NodePath) {
const { declaration, specifiers, source } = path.node;
if (declaration && declaration.id && declaration.id.name === name) {
resultPath = path.get('declaration');
} else if (declaration && declaration.declarations) {
path.get('declaration', 'declarations').each((declPath: NodePath) => {
const decl = declPath.node;
// TODO: ArrayPattern and ObjectPattern
if (
t.Identifier.check(decl.id) &&
decl.id.name === name &&
decl.init
) {
resultPath = declPath.get('init');
}
});
} else if (specifiers) {
path.get('specifiers').each((specifierPath: NodePath) => {
if (specifierPath.node.exported.name === name) {
if (source) {
const local = specifierPath.node.local.name;
resultPath = resolveImportedValue(path, local, seen);
} else {
resultPath = specifierPath.get('local');
}
}
});
}
return false;
},