* Convert kebab/snake names into readable titles.
(value)
| 70 | * Convert kebab/snake names into readable titles. |
| 71 | */ |
| 72 | function formatDisplayName(value) { |
| 73 | const acronymMap = new Map([ |
| 74 | ["ai", "AI"], |
| 75 | ["api", "API"], |
| 76 | ["cli", "CLI"], |
| 77 | ["css", "CSS"], |
| 78 | ["html", "HTML"], |
| 79 | ["json", "JSON"], |
| 80 | ["llm", "LLM"], |
| 81 | ["mcp", "MCP"], |
| 82 | ["ui", "UI"], |
| 83 | ["ux", "UX"], |
| 84 | ["vscode", "VS Code"], |
| 85 | ]); |
| 86 | |
| 87 | return value |
| 88 | .split(/[-_]+/) |
| 89 | .filter(Boolean) |
| 90 | .map((part) => { |
| 91 | const lower = part.toLowerCase(); |
| 92 | if (acronymMap.has(lower)) { |
| 93 | return acronymMap.get(lower); |
| 94 | } |
| 95 | return part.charAt(0).toUpperCase() + part.slice(1).toLowerCase(); |
| 96 | }) |
| 97 | .join(" "); |
| 98 | } |
| 99 | |
| 100 | function normalizeText(value, fallback = "") { |
| 101 | return typeof value === "string" ? value.trim() : fallback; |
no outgoing calls
no test coverage detected