Files
crawler-plugin/frontend-vue/src/shared/api/status.ts
T

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, '_')
}