11 lines
247 B
TypeScript
11 lines
247 B
TypeScript
export function normalizeStatus(raw: string | null | undefined): string {
|
|
if (typeof raw !== 'string') {
|
|
return ''
|
|
}
|
|
const trimmed = raw.trim()
|
|
if (!trimmed) {
|
|
return ''
|
|
}
|
|
return trimmed.toUpperCase().replace(/[\s-]+/g, '_')
|
|
}
|