mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-10-18 09:24:15 +00:00
Remove hardcoded CATEGORY_IDS and CATEGORY_LABELS constants. Categories now come from the API and are formatted dynamically.
16 lines
412 B
TypeScript
16 lines
412 B
TypeScript
/**
|
|
* Converts a category ID to a human-readable label.
|
|
* Capitalizes each word and replaces hyphens with spaces.
|
|
*
|
|
* Examples:
|
|
* - "internet-exposed" -> "Internet Exposed"
|
|
* - "iam" -> "Iam"
|
|
* - "forensics-ready" -> "Forensics Ready"
|
|
*/
|
|
export function getCategoryLabel(id: string): string {
|
|
return id
|
|
.split("-")
|
|
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
|
.join(" ");
|
|
}
|