Files
hive/frontend/node_modules/react-docgen/dist/utils/resolveHOC.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

33 lines
1.4 KiB
JavaScript

import isReactCreateClassCall from './isReactCreateClassCall.js';
import isReactForwardRefCall from './isReactForwardRefCall.js';
import resolveToValue from './resolveToValue.js';
/**
* If the path is a call expression, it recursively resolves to the
* rightmost argument, stopping if it finds a React.createClass call expression
*
* Else the path itself is returned.
*/
export default function resolveHOC(path) {
if (path.isCallExpression() &&
!isReactCreateClassCall(path) &&
!isReactForwardRefCall(path)) {
const node = path.node;
const argumentLength = node.arguments.length;
if (argumentLength && argumentLength > 0) {
const args = path.get('arguments');
const firstArg = args[0];
// If the first argument is one of these types then the component might be the last argument
// If there are all identifiers then we cannot figure out exactly and have to assume it is the first
if (argumentLength > 1 &&
(firstArg.isLiteral() ||
firstArg.isObjectExpression() ||
firstArg.isArrayExpression() ||
firstArg.isSpreadElement())) {
return resolveHOC(resolveToValue(args[argumentLength - 1]));
}
return resolveHOC(resolveToValue(firstArg));
}
}
return path;
}