Files
hive/frontend/node_modules/react-docgen/dist/utils/getMembers.js
anthonyrawlins e89f2f4b7b Add comprehensive development roadmap via GitHub Issues
Created 10 detailed GitHub issues covering:
- Project activation and management UI (#1-2)
- Worker node coordination and visualization (#3-4)
- Automated GitHub repository scanning (#5)
- Intelligent model-to-issue matching (#6)
- Multi-model task execution system (#7)
- N8N workflow integration (#8)
- Hive-Bzzz P2P bridge (#9)
- Peer assistance protocol (#10)

Each issue includes detailed specifications, acceptance criteria,
technical implementation notes, and dependency mapping.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-12 19:41:01 +10:00

51 lines
1.4 KiB
JavaScript

/**
* Given a "nested" Member/CallExpression, e.g.
*
* foo.bar()[baz][42]
*
* this returns a list of "members". In this example it would be something like
* [
* {path: NodePath<bar>, arguments: NodePath<empty>, computed: false},
* {path: NodePath<baz>, arguments: null, computed: true},
* {path: NodePath<42>, arguments: null, computed: false}
* ]
*/
export default function getMembers(path, includeRoot = false) {
const result = [];
let argumentPaths = [];
let resultPath = path;
while (true) {
if (resultPath.isMemberExpression()) {
const property = resultPath.get('property');
result.push({
path: property,
computed: resultPath.node.computed,
argumentPaths,
});
argumentPaths = [];
resultPath = resultPath.get('object');
}
else if (resultPath.isCallExpression()) {
const callee = resultPath.get('callee');
if (callee.isExpression()) {
argumentPaths = resultPath.get('arguments');
resultPath = callee;
}
else {
break;
}
}
else {
break;
}
}
if (includeRoot && result.length > 0) {
result.push({
path: resultPath,
computed: false,
argumentPaths,
});
}
return result.reverse();
}