Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Download web_app/src/lib/themeLabel.ts from CommunityOne/open-navigator: direct link, hf CLI and curl.
- Browser
- Download file 547 Bytes
-
https://huggingface.co/spaces/CommunityOne/open-navigator/resolve/main/web_app/src/lib/themeLabel.ts
- Command line
-
hf download hf://spaces/CommunityOne/open-navigator/web_app/src/lib/themeLabel.ts
-
curl -L -o themeLabel.ts https://huggingface.co/spaces/CommunityOne/open-navigator/resolve/main/web_app/src/lib/themeLabel.ts
547 Bytes
| /** | |
| * Readable label for a coarse `primary_theme` code (#499): | |
| * "economic_development" / "ECONOMIC_DEVELOPMENT" → "Economic development". | |
| * Returns null for empty or the "__unthemed__" sentinel so callers can hide it. | |
| */ | |
| export function themeLabel(code: string | null | undefined): string | null { | |
| const raw = (code ?? '').trim() | |
| if (!raw || raw === '__unthemed__') return null | |
| const words = raw.replace(/[_-]+/g, ' ').replace(/\s+/g, ' ').trim().toLowerCase() | |
| return words ? words.charAt(0).toUpperCase() + words.slice(1) : null | |
| } | |