(value?: string | null)
| 248 | } |
| 249 | |
| 250 | export function normalizeComponentCategory(value?: string | null): ComponentCategory | null { |
| 251 | if (!value) { |
| 252 | return null; |
| 253 | } |
| 254 | |
| 255 | const normalized = value.trim().toLowerCase(); |
| 256 | return isComponentCategory(normalized) ? normalized : null; |
| 257 | } |
| 258 | |
| 259 | export function resolveComponentCategory(value?: string | null): ComponentCategory { |
| 260 | return normalizeComponentCategory(value) ?? DEFAULT_COMPONENT_CATEGORY; |
no test coverage detected