(language: string)
| 73 | } |
| 74 | |
| 75 | function getLanguageCandidates(language: string): string[] { |
| 76 | const normalized = normalizeLanguageName(language); |
| 77 | if (!normalized) return []; |
| 78 | |
| 79 | const candidates = new Set([normalized]); |
| 80 | if (normalized.endsWith("react")) { |
| 81 | const withoutReact = normalized.slice(0, -"react".length); |
| 82 | if (withoutReact) candidates.add(withoutReact); |
| 83 | } |
| 84 | return [...candidates]; |
| 85 | } |
| 86 | |
| 87 | function findLanguageDescription(language: string): LanguageDescription | null { |
| 88 | for (const candidate of getLanguageCandidates(language)) { |
no test coverage detected