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

26 lines
807 B
JavaScript

import printValue from './printValue.js';
/**
* If node is an Identifier, it returns its name. If it is a literal, it returns
* its value.
*/
export default function getNameOrValue(path) {
if (path.isIdentifier()) {
return path.node.name;
}
else if (path.isQualifiedTypeIdentifier() || path.isTSQualifiedName()) {
return printValue(path);
}
else if (path.isStringLiteral() ||
path.isNumericLiteral() ||
path.isBooleanLiteral()) {
return path.node.value;
}
else if (path.isRegExpLiteral()) {
return path.node.pattern;
}
else if (path.isNullLiteral()) {
return null;
}
throw new TypeError(`Argument must be Identifier, Literal, QualifiedTypeIdentifier or TSQualifiedName. Received '${path.node.type}'`);
}