task-135(记录与版本中心): 修正发布可操作性判定(仅 DRAFT 可发布) 补 GREEN。

This commit is contained in:
2026-09-05 17:41:03 +08:00
parent 883625a072
commit 21e4bfc221
@@ -1,9 +1,8 @@
/** 数字人版本发布操作(任务 135):可发布判定与确认文案;纯逻辑。 */
import { normalizeDigitalHumanStatus } from './digitalhuman-dto.ts'
/** 仅草稿版本可发布。 */
/** 仅明确为草稿(DRAFT)的版本可发布;未知/已发布不可。 */
export function canReleaseDigitalHumanVersion(status: unknown): boolean {
return normalizeDigitalHumanStatus(status) === 'DRAFT'
return typeof status === 'string' && status.trim().toUpperCase() === 'DRAFT'
}
/** 发布确认文案;空版本返回 null。 */